M BUZZ CRAZE NEWS
// general

Cartesian product of 3 sets

By Emma Johnson
$\begingroup$

I'm not sure on how to do the Cartesian product of the 3rd set. But this is how I have done it not sure if I'm correct.

A = {0,1}
B = {1,2}
C = {0,1,2}
Calculate (A X B ) X C
A X B = { (0,1),(0,2),(1,1), (1,2) }
(A X B) X C = {(0,1,0) , (0,2,1) , (1,1,2) , (1,2,0) , (1,1,1), (1,2,2), (1,2,0), (1,2,1) } 
$\endgroup$ 1

1 Answer

$\begingroup$

Fix the first element of the first set, which is $0$. This alone generates the triplets:

$\{0,1,0\}, \{0,1,1\}, \{0,1,2\}, \{0,2,0\}, \{0,2,1\}, \{0,2,2\}$.

Keep going in this fashion. You should end up with a set that has (size of $A$) $\times$ (size of $B$) $\times$ (size of $C$) elements.

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy