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
>