MathGroup Archive 2005

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

Search the Archive

Re: direct product of two sets


For instance:

a=Range@3;b=Range@2;
Distribute[{a,b},List]

{{1,1},{1,2},{2,1},{2,2},{3,1},{3,2}}

or

Flatten[Outer[List,a,b],1]

{{1,1},{1,2},{2,1},{2,2},{3,1},{3,2}}

Bobby

On Mon, 3 Jan 2005 04:29:45 -0500 (EST), Cong <vo.chi.cong at is.titech.ac.jp> wrote:

> Hello!
>
> Give 2 finite sets A and B, how can I compute their direct product
> A x B := {(a,b) : a\in A, b\in B}
>
> Can someone help me?
>
> Best Regards,
>
> Cong
>
>
>
>



-- 
DrBob at bigfoot.com
www.eclecticdreams.net


  • Prev by Date: Re: direct product of two sets
  • Next by Date: Re: For to Map to Increase Speed
  • Previous by thread: Re: direct product of two sets
  • Next by thread: Re: direct product of two sets