MathGroup Archive 1995

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

Search the Archive

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


 >      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?