All Possible Combinations from N Sublists
- To: mathgroup at smc.vnet.net
- Subject: [mg97639] All Possible Combinations from N Sublists
- From: Donald DuBois <donabc at comcast.net>
- Date: Tue, 17 Mar 2009 05:02:44 -0500 (EST)
Given a list of N sublists, how can I produce all possible combinations where the first element comes from the first sublst, the second element from the second sublist 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.
- Follow-Ups:
- Re: All Possible Combinations from N Sublists
- From: Curtis Osterhoudt <cfo@lanl.gov>
- Re: All Possible Combinations from N Sublists
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: All Possible Combinations from N Sublists
- From: Adriano Pascoletti <adriano.pascoletti@dimi.uniud.it>
- Re: All Possible Combinations from N Sublists