# Cartesian Product of Sets

In this post we will understand the concept of cartesian product of set.
This concept is not only important from the point of view of set theory, but is also useful to understand the concept of relations and functions.

We have tried to explain the concept in as simple manner as possible and have also provided solved questions for your convenience.

## Cartesian Product of Sets

### What is Cartesian Product?

Suppose there are two sets provided set A and set B as given below
A = { red, blue}
B = { p, q, r, s}
Now let us find the cartesian product of these two sets

A X B = { (red, p), (red, q), (red, r), (red, s), (blue, p), (blue, q ), (blue, r ), (blue, s) }

Here you can see that we have multiplied element of one set with another to come up with complete set of relations

This type of multiplication of two sets is known as cartesian product. The concept is similar to the multiplication of numbers but here we involve operation of sets.

### Ordered Pairs

This is the cartesian product of set A and B we found out earlier

A X B = { (red, p), (red, q), (red, r), (red, s), (blue, p), (blue, q ), (blue, r ), (blue, s) }

Understand that the elements in bracket (red, p) form a pair and are known as ordered pair.
Each element in the pair has unique position:
The element red is the first component and element p is the second component in the ordered pair

Note:
Understand that the pair (red, p) and (p, red) are completely different and are not equal to each other.

In order to have equal pair, each component of the pairs should be equal
Example
(a, b) = (a, b)
Here both the first component and second component of the pair are equal

### Number of elements in cartesian product

It is very easy to find number of elements in cartesian product with the help of simple multiplication.
Consider the below example:

A = { red, blue}
Number of elements in set A = 2

B = { p, q, r, s}
Number of elements in set B = 4

Total number of elements in A X B = 2 * 4 = 8

### Technical Representation of Cartesian Product

The technical illustration of Cartesian product of sets can be given as
Consider the two sets P & Q such as
P= {a1, a2} and,
Q = {b1, b2, b3, b4}

Cartesian product is represented as
P × Q = { (p,q) : p ∈ P, q ∈ Q}
The cartesian product of P × Q contain elements (p, q), where elements of p belong to set P and elements of q belongs to set Q

Then the cartesian product of A & B is given as
A × B = {( a1, b1), (a1, b2), (a1, b3), (a1, b4), (a2, b1), (a2, b2), (a2, b3), (a2, b4)}

### Important Points

1. Keep in mind that element (a1, b1) is not same as (b1,a1), so please don’t intermix between the two
2. Two pairs are equal if first elements of both the pairs and second elements of both the pairs are equal
Example
(1, 3) & (1, 3) {both pairs are equal}
(1, 3) & (1, 2) are not equal as the second element of both pair do not match

### Solved Questions of Cartesian Product

(01) If P = {a, b, c} and Q = {r}, form the sets P × Q and Q × P . Are these two products equal?

Solution
P × Q = {(a, r), (b, r), (c, r)}
Q × P = {(r, a), (r, b), (r, c)}

P × Q and Q × P are not equal to each other because the elements
==> (a, r) and (r,a) both are completely different element and are not equal

(02) If P = {1, 2}, form the set P × P × P

Solution
The number of element in the cartesian product will be
==> 2 * 2* 2 => 8
Hence, there will be total of 8 element

The resulting elements are
P × P × P = {(1,1,1) (1,1,2) (1,2,1) (1,2,2) (2,1,1) (2,1,2) (2,2,1) (2,2,2) }

(03) Let A and B be two sets such that n(A) = 3 and n(B) = 2. If (x, 1), (y, 2), (z, 1) are in A × B, find A and B, where x, y and z are distinct elements

Solution
There are two sets A & B
Number of element in set A = n(A) =3
Number of element in set B = n(B) =2

Total elements of Cartesian Products will be = 3 * 2 => 6

Some elements of cartesian product of A & B is given as (A × B) = (x, 1), (y, 2), (z, 1)

You can see that x, y and z are first elements of each ordered pairs, so they are part of Set A
A = { x, y, z }

And elements 1 and 2 are second pair of cartesian product, so they are part of set B
B = { 1, 2}

(04) If G = {7, 8} and H = {5, 4, 2}, find G × H and H × G.

Solution
Here two sets are given
G = {7, 8} and H = {5, 4, 2}

Lets find G × H first
G × H = {(7,5), (7,4), (7,2), (8,5), (8,4), (8,2)}

Now find H × G
H × G = {(5,7), (5,8), (4,7), (4,8), (2,7), (2,8)}

(H × G) and (G × H) are not equal because element (5,7) and (7,5) are different elements