3
$\begingroup$

When using the cartesian product, and you have three collections, do you take two collections at a time OR all three together to calculate the product?

My question is if you have more than two collections, let's say A, B and C

A = {1,2,3} B = {4,5,6} C = {7,8}  A x B x C {1,2,3} x {4,5,6} x {7,8} 

Do you with the cartesian product calculate A x B, then B x C? And maybe A x C? Which means you take only two collections at a time.

OR

Do you take all three collections at the same time A x B x C?

  • 0
    A X B X C = {(1,4,7), (1,4,8), ... , (3,6,8)}2012-01-30
  • 0
    A Cartesian Product is usually defined as a product of *two* sets, but when you are going to find the [n-ary product](http://en.wikipedia.org/wiki/Cartesian_product#n-ary_product), the product set will contain all possible triplets.2012-01-30
  • 1
    Do you want the fully formal answer, or just a simple, easy-to-us answer?2012-01-30
  • 0
    In the usual formal buildup, it is in principle two at a time. However, let $I_n$ be a fixed $n$-element set, say the set $\{1,2, \dots,n\}$. We could define the $n$-fold Cartesian product $A_1\times\cdots\times A_n$ as the set of all functions $f$ from $I_n$ to $\cup A_i$ such that $f(i)\in A_i$ for $i=1$ to $n$.2012-01-30

3 Answers 3