Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: All Possible Combinations from N Sublists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97670] Re: All Possible Combinations from N Sublists
  • From: Raffy <raffy at mac.com>
  • Date: Wed, 18 Mar 2009 04:55:12 -0500 (EST)
  • References: <gpnsej$gq4$1@smc.vnet.net>

On Mar 17, 3:01 am, Donald DuBois <don... at comcast.net> wrote:
> Given a list of N sublists, how can I produce all possible combinations w=
here the first
> element comes from the first sublst, the second element from the second s=
ublist etc.
>
> For instance,
>
> myList = {{1, 2, 3}, {e, f}, {g, h}}
>
> the result should be,
>
> {{1, e, g}, {1, e, h}, {1, f, g}, {1, f, h}, {2, e, g}, {2, e, h}, {2, f,
>   g}, {2, f, h}, {3, e, g}, {3, e, h}, {3, f, g}, {3, f, h}}
>
> Thank you.

Tuples


  • Prev by Date: Re: All Possible Combinations from N Sublists
  • Next by Date: Re: How to map a list on function
  • Previous by thread: Re: All Possible Combinations from N Sublists
  • Next by thread: Re: All Possible Combinations from N Sublists