Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Product over an arbitrary index.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68704] Re: [mg68683] Product over an arbitrary index.
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 17 Aug 2006 04:18:11 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

index1={1,4,3};

m=2;

Product[f[index1[[i]],j],{i,Length[index1]},{j,m}]

f[1, 1]*f[1, 2]*f[3, 1]*f[3, 2]*f[4, 1]*f[4, 2]

Times@@Flatten@Outer[f[#1,#2]&, index1, Range[m]]

f[1, 1]*f[1, 2]*f[3, 1]*f[3, 2]*f[4, 1]*f[4, 2]


Bob Hanlon

---- quantieny at gmail.com wrote: 
> I have a function f(x,y)   that I would like to compute the product
> over indices i,j
> where i goes from an arbitrary list {1,4,3}  and j goes 1 to m.
> 
> Is this possible in mathematica the function Product itself seems to
> only work over a continous sequence and it is not clear how I can use
> two set of indices.
> 
> Additionally can I specify the product over an intersection or
> complement of a list?.
> 
> Thanks,
> K Frou
> 


  • Prev by Date: Rapid execution of gaussian integrals
  • Next by Date: Re: perplexed by blank sequence in pattern replacement
  • Previous by thread: Re: Product over an arbitrary index.
  • Next by thread: FileNames subdirectory count discrepancy