Re: clever way to do a product?
- To: mathgroup at smc.vnet.net
- Subject: [mg27167] Re: [mg27164] clever way to do a product?
- From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
- Date: Fri, 9 Feb 2001 03:10:16 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
It am not sure if it deserves to be called "clever" but it is probably the
most obvious:
In[4]:=
Product[If[i != j,x[i]-x[j],1],{i,1,2},{j,1,2}]//Expand
Out[4]=
2 2
-x[1] + 2 x[1] x[2] - x[2]
on 01.2.8 6:40 PM, Tim Ebringer at drearyslig at hotmail.com wrote:
> Does anyone know of a clever way where I can calculate a product, where i
> runs from 1 to n, except where i=j?
>
> Tim.
>
>
>
>
--
Andrzej Kozlowski
Toyama International University
JAPAN
http://platon.c.u-tokyo.ac.jp/andrzej/
http://sigma.tuins.ac.jp/