Relations and Functions

Cartesian Product of Sets

We are quite familiar with the term ‘product’ mathematically. It means multiplying. For example, 2 multiplied by 4 gives 8, 16 multiplied by 7 gives 112. Now let’s understand what does the term ‘Cartesian’ stand for? And further, what does a cartesian product mean. Complicated? Let’s find out.

Suggested Videos

previous arrow
next arrow
previous arrownext arrow


Cartesian Product

Before getting familiar with this term, let us understand what does Cartesian mean. Remember the terms used when plotting a graph paper like axes (x-axis, y-axis), origin etc. For example, (2, 3) depicts that the value on the x-plane (axis) is 2 and that for y is 3 which is not the same as (3, 2).

The way of representation is fixed that the value of the x coordinate will come first and then that for y (ordered way). Cartesian product means the product of the elements say x and y in an ordered way.

Cartesian Product

Cartesian Product of Sets

The Cartesian products of sets mean the product of two non-empty sets in an ordered way. Or, in other words, the collection of all ordered pairs obtained by the product of two non-empty sets. An ordered pair means that two elements are taken from each set.

For two non-empty sets (say A & B), the first element of the pair is from one set A and the second element is taken from the second set B. The collection of all such pairs gives us a Cartesian product.

The Cartesian product of two non-empty sets A and B is denoted by A × B. Also, known as the cross-product or the product set of A and B. The ordered pairs (a, b) is such that a ∈ A and b ∈ B. So, A × B = {(a,b): a ∈ A, b ∈ B}. For example, Consider two non-empty sets A = {a1, a2, a3} and B = {b1, b2, b3}

Cartesian product A×B = {(a1,b1), (a1,b2), (a1,b3), ( a2,b1), (a2,b2),(a2,b3), (a3,b1), (a3,b2), (a3,b3)}.

It is interesting to know that (a1,b1) will be different from (b1,a1). If either of the two sets is a null set, i.e., either A = Φ or B = Φ, then, A × B = Φ i.e., A × B will also be a null set

Number of Ordered Pairs

For two non-empty sets, A and B. If the number of elements of A is h i.e., n(A) = h & that of B is k i.e., n(B) = k, then the number of ordered pairs in Cartesian product will be n(A × B) = n(A) × n(B) = hk.

Download Cartesian Product of Sets Cheat Sheet PDF

Solved Example for You

Question 1: Let P & Q be two sets such that n(P) = 4 and n(Q) = 2. If in the Cartesian product we have (m,1), (n,-1), (x,1), (y, -1). Find P and Q, where m, n, x, and y are all distinct.

Answer : P = set of first elements = {m, n, x, y} and Q = set of second elements = {1, -1}

Question 2: What is the Cartesian product used for?

Answer: A Cartesian product in computing is basically the exact same as in mathematics. It will be applicable to matrix applications. In SQL it explains a bug where you join two tables wrongly and get many records from one table being connected to each of the records of the other, instead of the expected one.

Question 3: What is a Cartesian product example?

Answer: As we know that the Cartesian product is the multiplication of two sets to make the set of all ordered pairs. The first element of the ordered pair will be belonging to the first set and the second pair belong the second set. For instance, Suppose, A = {cow, horse} B = {egg, juice} then, A×B = {(cow, egg), (horse, juice), (cow, juice), (horse, egg)}

Question 4: What is the Cartesian product of Sets?

Answer: The Cartesian product of sets refers to the product of two non-empty sets in an ordered way. Or, in other words, the assortment of all ordered pairs attained by the product of two non-empty sets. An ordered pair basically means that two elements are taken from each set.

Question 5: Who invented the Cartesian product?

Answer: René Descartes invented the Cartesian product. It derives the name from the same person. René formulated analytic geometry which helped in the origination of this concept which we further generalize in terms of direct product.

Share with friends

Customize your course in 30 seconds

Which class are you in?
Get ready for all-new Live Classes!
Now learn Live with India's best teachers. Join courses with the best schedule and enjoy fun and interactive classes.
Ashhar Firdausi
IIT Roorkee
Dr. Nazma Shaik
Gaurav Tiwari
Get Started

2 responses to “Relations”

  1. Al quba says:

    The example for onto function doesn’t qualify as a function in the first place. Does it??
    It is a relation but not a function because a single element in the domain has been mapped to two elements in the co domain. Isn’t it??
    Please tell me if I’m correct or not.
    It is really confusing.

    • Eli Simeon says:

      An onto function exists if and only the co-domain is equal to the range that is every element in set A (the domain) is mapped to every element in set B (the range/codomain) i.e without leaving out any element. Irrespective of whether it is a one to one mapping or not. Therefore it is a function. Put simply, take set A as a set of sons and set B as a set of fathers, a function requires that every son has one father (which is normal) yet every father can have more than one son(which is also normal) so if one element in set A maps to more than one element in set B it is not a function (and we will need DNA test to know who really is the father) but if more than one element in set A maps to one element in set B it is still a function (the elements are just brothers). What and onto function requires is that every father has a son. Sorry if I made it a bit complicated I feel that if I continue I might make it worse just it study a bit more and from different sources, videos or books and you will understand it better.

Leave a Reply

Your email address will not be published. Required fields are marked *

Download the App

Watch lectures, practise questions and take tests on the go.

Customize your course in 30 seconds

No thanks.