Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: I'm looking for an algorithm: Cartesian Product

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1690] Re: [mg1644] I'm looking for an algorithm: Cartesian Product
  • From: Richard Mercer <richard at seuss.math.wright.edu>
  • Date: Mon, 17 Jul 1995 01:54:22 -0400

 >      I'm looking for an algorithm that can compute
>   Cartesian Product for several sets. For example:
>  ....

The following is not perfect but is probably what you are looking for.


In[20]:=
Distribute[{{a,b},{c,d},{e,f,g}},List]
Out[20]=
{{a, c, e}, {a, c, f}, {a, c, g}, {a, d, e}, {a, d, f}, {a, d, g}, {b, c, e}, 

 

  {b, c, f}, {b, c, g}, {b, d, e}, {b, d, f}, {b, d, g}}

Richard Mercer


  • Prev by Date: Q) How to clear all variables
  • Next by Date: Re: Re: MathLink documentation
  • Previous by thread: Re: I'm looking for an algorithm: Cartesian Product
  • Next by thread: Mathematica --> C convertor, anyone?