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