MathGroup Archive 2005

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

Search the Archive

Re: direct product of two sets


Use Distribute

A = Range[5]; B = Range[5] + 10;
Distribute[{A, B}, List, List]

gives

{{1, 11}, {1, 12}, {1, 13}, {1, 14}, {1, 15}, {2, 11}, {2, 12}, {2,  
13}, {
   2, 14}, {2, 15}, {3, 11}, {3, 12}, {3, 13}, {3, 14}, {3, 15}, {4,  
11}, {
   4, 12}, {4, 13}, {4, 14}, {4, 15}, {5, 11}, {5, 12}, {5, 13}, {5,  
14}, {
   5, 15}}


Adriano Pascoletti


Il giorno 03/gen/05, alle 10:29, Cong ha scritto:

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


------------------------------------------------------------------------ 

Adriano Pascoletti
Dipartimento di Matematica e Informatica
Universita' di Udine
Via delle scienze 206
I-33100 Udine
Italy



  • Prev by Date: Re: direct product of two sets
  • Next by Date: Re: How to draw a trajectory in DensityPlot?
  • Previous by thread: Re: direct product of two sets
  • Next by thread: Re: direct product of two sets