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: [mg53287] Re: [mg53264] direct product of two sets
  • From: "David Park" <djmp at earthlink.net>
  • Date: Tue, 4 Jan 2005 03:13:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Cong,

Use Outer and Flatten...

aset = {a1, a2, a3};
bset = {b1, b2, b3, b4};

Flatten[Outer[List, aset, bset ], 1]
{{a1, b1}, {a1, b2}, {a1, b3}, {a1, b4}, {a2, b1}, {a2, b2}, {a2, b3}, {a2,
    b4}, {a3, b1}, {a3, b2}, {a3, b3}, {a3, b4}}

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: Cong [mailto:vo.chi.cong at is.titech.ac.jp]
To: mathgroup at smc.vnet.net


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





  • Prev by Date: SymbolShape
  • Next by Date: any updates to Mathematica control system professional application?
  • Previous by thread: Re: direct product of two sets
  • Next by thread: Re: direct product of two sets