Re: newbie: all possible sums of two lists

• To: mathgroup at smc.vnet.net
• Subject: [mg30700] Re: newbie: all possible sums of two lists
• From: "Seth Chandler" <Schandler at uh.edu>
• Date: Sat, 8 Sep 2001 02:23:08 -0400 (EDT)
• References: <9n17po\$24b\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Outer[Plus,list1,list2]  will work and create a two dimensional result.
Flatten[Plus,list1,list2],1] will create a one dimensional list of the
possible sums.

"Alan Tu" <alantu at students.uiuc.edu> wrote in message
news:9n17po\$24b\$1 at smc.vnet.net...
> 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
>
>
>

```

• Prev by Date: Re: newbie: all possible sums of two lists
• Next by Date: Re: newbie: all possible sums of two lists
• Previous by thread: Re: newbie: all possible sums of two lists
• Next by thread: Re: newbie: all possible sums of two lists