NIMCET, GATE, CUET & CBSE test series are live — start practicing free
syllabuzAI

Cartesian Product and Introduction to Relations | NIMCET

Learn ordered pairs, the Cartesian product A × B, its properties, and how a relation is defined as a subset of A × B, with domain, range, inverse relations and counting results for NIMCET.

5 min read

SP

SHIVAM PRADHAN

Updated 25 October 2026

On this page

Quick answer: The Cartesian product A×BA \times B is the set of all ordered pairs (a,b)(a, b) with a∈Aa \in A and b∈Bb \in B, so n(A×B)=n(A)⋅n(B)n(A \times B) = n(A) \cdot n(B). A relation from A to B is any subset of A×BA \times B. If n(A)=mn(A) = m and n(B)=nn(B) = n, there are 2mn2^{mn} relations from A to B.

Ordered pairs

An ordered pair (a,b)(a, b) has a first and a second element, so order matters: (1,2)≠(2,1)(1, 2) \ne (2, 1).

Two ordered pairs are equal only when corresponding elements are equal: (a,b)=(c,d)(a, b) = (c, d) means a=ca = c and b=db = d.

Cartesian product

A×B={(a,b):a∈A,b∈B}A \times B = \{(a, b) : a \in A, b \in B\}

Example: If A={1,2}A = \{1, 2\} and B={x,y,z}B = \{x, y, z\}, then

A×B={(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)}A \times B = \{(1, x), (1, y), (1, z), (2, x), (2, y), (2, z)\}

which has 2×3=62 \times 3 = 6 elements.

Properties

PropertyStatement
Sizen(A×B)=n(A)⋅n(B)n(A \times B) = n(A) \cdot n(B)
Not commutativeA×B≠B×AA \times B \ne B \times A unless A=BA = B or one set is empty
Empty setA×ϕ=ϕA \times \phi = \phi
Over unionA×(B∪C)=(A×B)∪(A×C)A \times (B \cup C) = (A \times B) \cup (A \times C)
Over intersectionA×(B∩C)=(A×B)∩(A×C)A \times (B \cap C) = (A \times B) \cap (A \times C)
Over differenceA×(B−C)=(A×B)−(A×C)A \times (B - C) = (A \times B) - (A \times C)
Mixed(A×B)∩(C×D)=(A∩C)×(B∩D)(A \times B) \cap (C \times D) = (A \cap C) \times (B \cap D)

A×AA \times A is often written A2A^2, and R×R\mathbb{R} \times \mathbb{R} is the coordinate plane.

Relations

A relation R from A to B is a subset of A×BA \times B. We write a R ba\,R\,b when (a,b)∈R(a, b) \in R.

TermMeaning
DomainSet of first elements of pairs in R
RangeSet of second elements of pairs in R
Co-domainThe whole set B
Relation on AA subset of A×AA \times A

Example: Let A={1,2,3,4}A = \{1, 2, 3, 4\} and R={(a,b):b=a+1}R = \{(a, b) : b = a + 1\} on A. Then R={(1,2),(2,3),(3,4)}R = \{(1, 2), (2, 3), (3, 4)\}, the domain is {1,2,3}\{1, 2, 3\} and the range is {2,3,4}\{2, 3, 4\}.

Inverse relation

R−1={(b,a):(a,b)∈R}R^{-1} = \{(b, a) : (a, b) \in R\}

The domain of R−1R^{-1} is the range of R, and vice versa.

Counting results

QuantityCount
Elements of A×BA \times Bmnmn
Relations from A to B2mn2^{mn}
Relations on A, with n(A)=nn(A) = n2n22^{n^2}
Non-empty relations from A to B2mn−12^{mn} - 1

Why 2mn2^{mn}: a relation is any subset of A×BA \times B, and a set of mnmn elements has 2mn2^{mn} subsets (see power sets).

Worked examples

Example 1: equal ordered pairs

If (x+1,y−2)=(3,1)(x + 1, y - 2) = (3, 1), find x and y.

x+1=3x + 1 = 3 and y−2=1y - 2 = 1, so x=2x = 2 and y=3y = 3.

Example 2: counting relations

If n(A)=2n(A) = 2 and n(B)=3n(B) = 3, how many relations are there from A to B?

22⋅3=26=642^{2 \cdot 3} = 2^6 = 64.

Example 3: recovering sets from a product

If A×B={(a,1),(a,2),(b,1),(b,2)}A \times B = \{(a, 1), (a, 2), (b, 1), (b, 2)\}, then A={a,b}A = \{a, b\} and B={1,2}B = \{1, 2\}.

Example 4: common elements

If n(A)=3n(A) = 3, n(B)=4n(B) = 4 and n(A∩B)=2n(A \cap B) = 2, find n((A×B)∩(B×A))n((A \times B) \cap (B \times A)).

Using the mixed property, it equals n((A∩B)×(B∩A))=2×2=4n((A \cap B) \times (B \cap A)) = 2 \times 2 = 4.

Summary table

IdeaKey result
Ordered pairOrder matters
n(A×B)n(A \times B)n(A)⋅n(B)n(A) \cdot n(B)
RelationAny subset of A×BA \times B
Number of relations2mn2^{mn}
Inverse relationSwap each pair

Exam tips

  • For "how many relations" questions, find n(A×B)n(A \times B) first, then raise 2 to that power.
  • Use the mixed property for intersections of two Cartesian products.
  • Do not confuse the range of a relation with its co-domain.

Next, study types of relations and equivalence relations or browse the NIMCET Set Theory chapter.

Common mistakes

  • Treating (a,b)(a, b) and (b,a)(b, a) as the same pair.
  • Writing the number of relations as mnmn instead of 2mn2^{mn}.
  • Assuming A×B=B×AA \times B = B \times A.
  • Forgetting that the empty relation is also a relation.

Frequently Asked Questions

What is the Cartesian product of two sets?

A × B is the set of all ordered pairs (a, b) with a in A and b in B.

How many relations are there from A to B?

If n(A) = m and n(B) = n, there are 2^(mn) relations from A to B.

Is A × B equal to B × A?

Not in general. They are equal only when A = B or when one of the sets is empty.

What is a relation in set theory?

A relation from A to B is any subset of the Cartesian product A × B.

What is the inverse of a relation?

The inverse R⁻¹ contains every pair of R with its elements swapped.

Concept Check

MEDIUM

Find the area bounded by the parabola y2=4xy^2 = 4x and the line y=2xy = 2x.

Suggested for you