Skip to content

Mathematics · Ch 2 — Relations and Functions

Relations

2.3

Relations

2.3 Relations

From Cartesian Product to Relation

When we have two sets, the Cartesian product gives us every possible pairing of elements. But in mathematics, we rarely need all possible pairs — we usually care about pairs that satisfy some specific condition. That subset of the Cartesian product is what we call a relation.

Consider the sets P={a,b,c}P = \{a, b, c\} and Q={Ali,Bhanu,Binoy,Chandra,Divya}Q = \{\text{Ali}, \text{Bhanu}, \text{Binoy}, \text{Chandra}, \text{Divya}\}. Their Cartesian product P×QP \times Q contains 15 ordered pairs. Now suppose we only want pairs where the first element (a letter) is the first letter of the second element (a name). This gives us:

R={(a,Ali),(b,Bhanu),(b,Binoy),(c,Chandra)}R = \{(a, \text{Ali}), (b, \text{Bhanu}), (b, \text{Binoy}), (c, \text{Chandra})\}

This set RR is a relation from PP to QQ. It is a subset of P×QP \times Q, and it was obtained by describing a specific relationship between the first and second elements of the ordered pairs.

Formal Definition of a Relation

Definition 2: A relation RR from a non-empty set AA to a non-empty set BB is a subset of the Cartesian product A×BA \times B. The subset is derived by describing a relationship between the first element and the second element of the ordered pairs in A×BA \times B.

In a relation, the second element of an ordered pair is called the image of the first element. So in the pair (a,Ali)(a, \text{Ali}), Ali\text{Ali} is the image of aa.

Domain, Range, and Codomain

Every relation comes with three important sets associated with it.

Definition 3: The set of all first elements of the ordered pairs in a relation RR from a set AA to a set BB is called the domain of RR.

Definition 4: The set of all second elements in a relation RR from a set AA to a set BB is called the range of RR. The whole set BB is called the codomain of RR.

A critical observation: the range is always a subset of the codomain. Not every element of BB needs to appear as the second element of some ordered pair in RR, but every second element that does appear must belong to BB.

Important

Range ⊂\subset Codomain. The domain is a subset of AA, and the range is a subset of BB (the codomain).

Representing Relations

Relations can be represented in three ways:

  1. Roster form — listing all ordered pairs explicitly within curly braces.
  2. Set-builder form — describing the condition that defines the relation.
  3. Arrow diagram — a visual representation where arrows connect elements of the domain to their images in the codomain.

Counting Relations

Since a relation from AA to BB is simply a subset of A×BA \times B, the number of possible relations equals the number of subsets of A×BA \times B.

If n(A)=pn(A) = p and n(B)=qn(B) = q, then n(A×B)=pqn(A \times B) = pq, and the total number of relations from AA to BB is 2pq2^{pq}.

Example 9: Counting Relations Between Small Sets

Let A={1,2}A = \{1, 2\} and B={3,4}B = \{3, 4\}.

First, A×B={(1,3),(1,4),(2,3),(2,4)}A \times B = \{(1, 3), (1, 4), (2, 3), (2, 4)\}. So n(A×B)=4n(A \times B) = 4. …

Definition 2Relations

A relation RR from a non-empty set AA to a non-empty set BB is any subset of the Cartesian product A×BA \times B.

That is, R⊆A×BR \subseteq A \times B.

The subset is formed by picking only those ordered pairs (x,y)(x, y) from A×BA \times B for which a specific condition or relationship holds between xx (the first element) and yy (the second element).

The second element yy in such an ordered pair is called the image of the first element xx.

Note

If AA and BB are the same set, we often say "RR is a relation on AA" instead of "from AA to AA".

Intuition: A relation is like a filter on the full list of all possible pairings — you keep only those pairs where the two things are connected in a particular way.

Example:

Let A={1,2}A = \{1, 2\} and B={3,4}B = \{3, 4\}.

Then A×B={(1,3),(1,4),(2,3),(2,4)}A \times B = \{(1,3), (1,4), (2,3), (2,4)\}.

Define a relation RR by the rule "yy is one more than xx" (i.e. y=x+1y = x + 1). …

Definition 3Domain of the Relation R

The domain of a relation RR from a set AA to a set BB is the set of all first elements of the ordered pairs that belong to RR.

In other words, if R⊆A×BR \subseteq A \times B and you list every ordered pair (x,y)(x, y) in RR, then the domain is the collection of all the xx's that actually appear in those pairs. The textbook (Definition 3) states this exactly: "The set of all first elements of the ordered pairs in a relation RR from a set AA to a set BB is called the domain of the relation RR."

Intuition: Think of a relation as a set of connections — each connection is an arrow from some element of AA to some element of BB. The domain is simply the group of "starting points" from AA that actually have at least one arrow leaving them. Not every element of AA needs to be in the domain; only those that are used as a first coordinate in some ordered pair of RR. …

Definition 4Range of the Relation R

Definition 4 states: The set of all second elements in a relation RR from a set AA to a set BB is called the range of the relation RR. The whole set BB is called the codomain of the relation RR. Note that range⊂codomain\text{range} \subset \text{codomain}.

In other words, if R⊆A×BR \subseteq A \times B is a relation, then:

  • Range of RR = {y∈B∣(x,y)∈R for some x∈A}\{ y \in B \mid (x, y) \in R \text{ for some } x \in A \}.
  • Codomain of RR = the entire set BB (given in advance, regardless of which elements actually appear in RR).

The range is always a subset of the codomain — it collects only those second elements that actually get paired with some first element. The codomain is the full target set, which may contain elements that never appear as a second element in any ordered pair of RR.

Intuition: Think of a relation as a matching between two groups. The codomain is the whole group on the right side; the range is just the set of people from that group who actually get matched.

Concrete example (from Example 7 of the textbook):

Let A={1,2,3,4,5,6}A = \{1, 2, 3, 4, 5, 6\} and define R={(x,y):y=x+1}R = \{(x, y) : y = x + 1\}. Then:

  • R={(1,2),(2,3),(3,4),(4,5),(5,6)}R = \{(1,2), (2,3), (3,4), (4,5), (5,6)\}. …
Figure 2.4Arrow diagram: x is the first letter of name y (P→Q)
Fig. 2.4 — Arrow diagram: x is the first letter of name y (P→Q)

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your NCERT textbook's own diagram.

What Fig. 2.4 Shows

The arrow diagram presents two sets side by side. On the left is set P={a,b,c}P = \{a, b, c\}, written inside an oval. On the right is set Q={Ali, Bhanu, Binoy, Chandra, Divya}Q = \{\text{Ali, Bhanu, Binoy, Chandra, Divya}\}, inside another oval. Indigo arrows connect elements of PP to elements of QQ according to a specific rule: aa points to Ali, bb points to both Bhanu and Binoy, and cc points to Chandra. Divya receives no arrow at all.

This is not just a random collection of arrows. The diagram is a visual representation of a relation — a subset of the Cartesian product P×QP \times Q. The rule that decides which arrows exist is: xx is the first letter of the name yy. So aa is the first letter of Ali, bb is the first letter of both Bhanu and Binoy, and cc is the first letter of Chandra. Divya starts with D, which is not in PP, so no arrow reaches her.

Note

The arrow diagram makes two key ideas immediately visible. First, a relation can map one element of PP to multiple elements of QQ (like bb mapping to two names). Second, not every element of QQ needs to be the image of something — Divya is in the codomain but not in the range.

The Physical Idea

The figure teaches that a relation is fundamentally a matching rule between two sets. The Cartesian product P×QP \times Q contains all 15 possible ordered pairs, but the relation picks out only those pairs that satisfy the given condition. The arrow diagram shows this selection at a glance: each arrow corresponds to one ordered pair in the relation.

The textbook then formalises this into three definitions. The domain is the set of all first elements that actually appear in the relation — here {a,b,c}\{a, b, c\}, which happens to be the whole of PP. The range is the set of all second elements that receive arrows — {Ali, Bhanu, Binoy, Chandra}\{\text{Ali, Bhanu, Binoy, Chandra}\}. The codomain is the entire set QQ, which includes Divya even though she is not related to any element of PP.

Important

The range is always a subset of the codomain, but they need not be equal. In this figure, range ⊂\subset codomain because Divya is in QQ but not in the relation.

The Key Formula

The central result that this figure introduces is the number of possible relations between two finite sets. If n(A)=pn(A) = p and n(B)=qn(B) = q, then:

n(A×B)=pqn(A \times B) = pq

Number of relations from A to B=2pq\text{Number of relations from } A \text{ to } B = 2^{pq}

Why 2pq2^{pq}? A relation is a subset of A×BA \times B. The Cartesian product has pqpq ordered pairs. For each pair, you have two choices: include it in the relation or leave it out. So the total number of distinct relations equals the number of subsets of a set with pqpq elements, which is 2pq2^{pq}. …

Figure 2.5Arrow diagram of the relation R = {(x, y) : y = x + 1} on the set A = {1, 2, 3, 4, 5, 6}, with arrows mapping each element to its successor.
Fig. 2.5 — Arrow diagram of the relation R = {(x, y) : y = x + 1} on the set A = {1, 2, 3, 4, 5, 6}, with arrows mapping each element to its successor.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your NCERT textbook's own diagram.

Fig 2.5 is the arrow diagram for the relation R={(x,y):y=x+1}R = \{(x, y) : y = x + 1\} defined on the set A={1,2,3,4,5,6}A = \{1, 2, 3, 4, 5, 6\}. The diagram uses two vertical lists (often drawn as ovals or columns) of the numbers 1 through 6, placed side by side. The left list represents the domain (the set of first elements xx), and the right list represents the codomain (the set of possible second elements yy, which is also AA here).

From each element in the left list, an arrow slants downward to the right, pointing to the element in the right list that is exactly one more. So you see arrows: 1→21 \to 2, 2→32 \to 3, 3→43 \to 4, 4→54 \to 5, 5→65 \to 6. The element 66 on the left has no arrow leaving it — because 6+1=76 + 1 = 7, and 77 is not in the set AA. This visual gap is the whole point of the figure: it shows that a relation need not pair every element of the domain with an image.

The relation itself is given by the rule y=x+1y = x + 1, which generates the ordered pairs (1,2),(2,3),(3,4),(4,5),(5,6)(1,2), (2,3), (3,4), (4,5), (5,6). The arrow diagram makes it instantly clear that the domain is {1,2,3,4,5}\{1, 2, 3, 4, 5\} (the elements that actually have arrows), the range is {2,3,4,5,6}\{2, 3, 4, 5, 6\} (the elements that receive arrows), and the codomain is the full set {1,2,3,4,5,6}\{1, 2, 3, 4, 5, 6\}.

Important

The arrow diagram teaches a core distinction: the domain is the set of first elements that actually appear in the relation, not necessarily the whole set AA. Here 66 is in AA but not in the domain. Similarly, the range is a subset of the codomain — here 11 is in the codomain but never appears as an image.

The central formula the textbook develops with this figure is simply the rule defining the relation:

R={(x,y):y=x+1,  x∈A,  y∈A}R = \{(x, y) : y = x + 1, \; x \in A, \; y \in A\} …

Figure 2.6Arrow diagram: 'x is the square of y' (P={9,4,25}→Q)
Fig. 2.6 — Arrow diagram: 'x is the square of y' (P={9,4,25}→Q)

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your NCERT textbook's own diagram.

Fig 2.6 is an arrow diagram that shows a relation between two sets, P and Q. The set P is written on the left as a slate oval containing the numbers 9, 4, and 25. The set Q is on the right as another slate oval containing the numbers 5, 3, 2, 1, −2, −3, and −5. Crossing indigo arrows connect elements of P to elements of Q: 9 points to both 3 and −3, 4 points to both 2 and −2, and 25 points to both 5 and −5. The element 1 in Q has no arrow coming to it from any element of P.

The relation shown is “x is the square of y”. In set-builder form, this is written as

R={(x,y):x=y2,  x∈P,  y∈Q}.R = \{(x, y) : x = y^2,\; x \in P,\; y \in Q\}.

In roster form, the relation is

R={(9,3),(9,−3),(4,2),(4,−2),(25,5),(25,−5)}.R = \{(9, 3), (9, -3), (4, 2), (4, -2), (25, 5), (25, -5)\}.

The domain of this relation is the set of all first elements: {4,9,25}\{4, 9, 25\}. The range is the set of all second elements that actually appear: {−2,2,−3,3,−5,5}\{-2, 2, -3, 3, -5, 5\}. The codomain is the whole set Q, which includes 1 as well — but 1 has no pre-image in P, so it is not part of the range.

Watch out

A common mistake is to think the range must equal the codomain. Here, the codomain Q has seven elements, but the range has only six. The element 1 is in the codomain but not in the range, because no arrow lands on it. …

Figure 2.7Arrow diagram of the relation y = x - 2 mapping the set P = {5, 6, 7} to Q = {3, 4, 5}, with arrows 5 to 3, 6 to 4, and 7 to 5.
Fig. 2.7 — Arrow diagram of the relation y = x - 2 mapping the set P = {5, 6, 7} to Q = {3, 4, 5}, with arrows 5 to 3, 6 to 4, and 7 to 5.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your NCERT textbook's own diagram.

Fig 2.7 is the arrow diagram for the relation defined by y=x−2y = x - 2 between the sets P={5,6,7}P = \{5,6,7\} and Q={3,4,5}Q = \{3,4,5\}. The diagram shows two ovals: the left oval labelled PP contains the numbers 5, 6, 7; the right oval labelled QQ contains 3, 4, 5. Three horizontal arrows run from left to right, each connecting an element of PP to its image in QQ: 5→35 \to 3, 6→46 \to 4, and 7→57 \to 5.

The physical idea is straightforward: each element xx in PP is related to exactly one element yy in QQ through the rule "subtract 2". This is a relation — a subset of the Cartesian product P×QP \times Q. In roster form, the relation is

R={(5,3),(6,4),(7,5)}.R = \{(5,3), (6,4), (7,5)\}.

In set-builder form, it is

R={(x,y):y=x−2,  x∈P,  y∈Q}.R = \{(x,y) : y = x - 2,\; x \in P,\; y \in Q\}.

From the diagram you can read off the three key sets:

  • Domain = {5,6,7}\{5,6,7\} (all first elements, i.e., the entire set PP).
  • Range = {3,4,5}\{3,4,5\} (all second elements that actually appear; here it equals QQ).
  • Codomain = {3,4,5}\{3,4,5\} (the whole set QQ).
Note

In this example the range and codomain are the same set, but that is not always true. The range is always a subset of the codomain — never larger. …