Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*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 2005

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

Search the Archive

Re: direct product of two sets

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53282] Re: [mg53264] direct product of two sets
  • From: DrBob <drbob at bigfoot.com>
  • Date: Tue, 4 Jan 2005 03:13:16 -0500 (EST)
  • References: <200501030929.EAA10701@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

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