MathGroup Archive 2003

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

Search the Archive

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


  • Prev by Date: Re: not linear homogeneus differential equation system... too complicated for mathmeatica... maybe only for me! :)
  • Next by Date: Creating/Solving a cumulative distribution function?
  • Previous by thread: btw...
  • Next by thread: Re: Combinations of two lists