Combinations of two lists
- To: mathgroup at smc.vnet.net
- Subject: [mg41750] Combinations of two lists
- From: "John C. Erb, Ph.D." <John_C_Erb at prodigy.net>
- Date: Wed, 4 Jun 2003 08:34:35 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello,
A simple example of what I would like to do is:
list1={x1,y1,z1}
list2={x2,y2,z2}
pair up the two lists to get all possible combinations
{x1,x2},{y1,y2},{z1,z2}
{x1,x2},{y1,z2},{z1,y2}
{x1,y2},{y1,x2},{z1,z2}
{x1,y2},{y1,z2},{z1,x2}
{x1,z2},{y1,x2},{z1,y2}
{x1,z2},{y1,y2},{z1,x2}
I would like a general way of telling how many ways
I can match up the two lists as shown above, and
optionally print out the combinations.
Thank you,
John C. Erb
email: John_C_Erb at prodigy.net