Re: clever way to do a product?
- To: mathgroup at smc.vnet.net
- Subject: [mg27179] Re: clever way to do a product?
- From: Yossi Lonke <jrl16 at po.cwru.edu>
- Date: Fri, 9 Feb 2001 03:10:24 -0500 (EST)
- Organization: Case Western Reserve University, Cleveland, OH, USA
- References: <95tqsr$mb3@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
> From: "Tim Ebringer" <drearyslig at hotmail.com> To: mathgroup at smc.vnet.net > Organization: Computer Science, University of Melbourne > Newsgroups: comp.soft-sys.math.mathematica > Date: 8 Feb 2001 05:03:07 -0500 > Subject: [mg27179] clever way to do a product? > > 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. > > > I don't know about clever, but you may try: Apply[Times, Delete[your_list, {j}]] So you could define a function of a list and an index: f[your_list_, j_] := Apply[Times, Delete[your_list, {j}]] Best Regards, Yossi Lonke