Re: newbie: all possible sums of two lists
- To: mathgroup at smc.vnet.net
- Subject: [mg30697] Re: newbie: all possible sums of two lists
- From: Mark Westwood <mark at galeawestwood.freeserve.co.uk>
- Date: Sat, 8 Sep 2001 02:22:56 -0400 (EDT)
- References: <9n17po$24b$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Alan I think Outer[Plus, list1, list2] is probably what you want, you may need or want to Flatten the result.. The book will explain what is going on. Regards Mark Westwood Pilot Solutions Ltd Alan Tu wrote: > Hello, I confess I am a newbie to Mathematica. I think I have a basic > understanding of the syntax and concepts, but there are just so many > functions. What is the most efficient way to find all the possible sums of > two lists. > > List[i1, i2, ... i_n] > List[j1, j2, ... j_m] > > I want > > List[i1+j1, i1+j2, i1+j3, ... i1+j_m, i2+j1, i2+j2, i2+j3, ... i2+j_m, ... > i_n+j_m] > > Any ideas would be appreciated. Thanks. > > Regards, > > Alan Tu > > >