Relations
A relation is just a precise way of saying "x is linked to y". Once we have the Cartesian product A×B, every relation is simply a subset , a chosen list of pairs that we call related. This single idea unifies geometry, algebra, and (later) calculus.
Definitions
Let A and B be non-empty sets. A relation R from A to B is a subset of A×B. We write
aRbor(a,b)∈R
to mean "a is related to b" under R. A relation from A to itself is called a relation on A.
The domain of R is the set of first coordinates that actually appear:
Dom(R)={a∈A:∃b∈B, (a,b)∈R}.
The range of R is the set of second coordinates that actually appear:
Range(R)={b∈B:∃a∈A, (a,b)∈R}.
The codomain of R is the entire set B. Note range ⊆ codomain, but they need not be equal.
Three ways to describe a relation
A relation can be given in three equivalent ways.
1. Roster form. List the pairs.
R={(1,2),(1,3),(2,4)}.
2. Set-builder form. Use a rule.
R={(x,y)∈A×B:x+y=5}.
3. Arrow diagram. Draw the sets A and B as ovals of dots and connect a→b when (a,b)∈R. Helpful for visualising small relations.
Any single relation can be reformulated freely between these three.
Counting relations
How many relations are there from A to B when both are finite? A relation is any subset of A×B, and ∣A×B∣=∣A∣⋅∣B∣. The number of subsets of a finite set with k elements is 2k. Hence
Number of relations from A to B=2∣A∣⋅∣B∣.
For ∣A∣=2,∣B∣=3 this is 26=64 , already too many to enumerate by hand for casual problems.
A first taste of "kinds of relations"
You will study these formally in Class XII, but the vocabulary is worth meeting now. A relation R on A is called:
- Reflexive if aRa for every a∈A.
- Symmetric if aRb⇒bRa.
- Transitive if aRb and bRc together imply aRc.
The equality relation = has all three properties; the relation "is a brother of" is not reflexive but (loosely) symmetric, and the relation "is less than or equal to" is reflexive and transitive but not symmetric.
Worked examples
Example 1. Let A={1,2,3,4}, B={1,4,9,16}. Define R={(x,y)∈A×B:y=x2}. List the pairs, domain, range, codomain.
For each x∈A, check if x2∈B:
- x=1: 1∈B, pair (1,1).
- x=2: 4∈B, pair (2,4).
- x=3: 9∈B, pair (3,9).
- x=4: 16∈B, pair (4,16).
R={(1,1),(2,4),(3,9),(4,16)}.
Dom(R)={1,2,3,4}, Range(R)={1,4,9,16}, Codomain=B={1,4,9,16}.
Example 2. Let A={1,2,3,4,5}. Define R={(x,y):y=x+2, x,y∈A}. List R and find its domain and range.
For each x∈A check if x+2∈A. x=1:3∈A. x=2:4∈A. x=3:5∈A. x=4:6∈/A. x=5:7∈/A. So
R={(1,3),(2,4),(3,5)}.
Domain ={1,2,3}, Range ={3,4,5}.
Example 3. How many relations are there from a 3-element set A to a 2-element set B?
2∣A∣⋅∣B∣=26=64.
Example 4. The relation R on R is defined by xRy⟺x+y=0. Describe R as a set of ordered pairs and as a graph.
R={(x,−x):x∈R}. The graph is the line y=−x in the Cartesian plane.
Example 5 (harder). Let A={1,2,3,4,6} and define R on A by xRy⟺x divides y. List R, find Dom and Range, and decide if R is reflexive, symmetric, transitive.
For each pair (x,y) with x∣y and both in A:
- 1: divides 1,2,3,4,6 , pairs (1,1),(1,2),(1,3),(1,4),(1,6).
- 2: divides 2,4,6 , (2,2),(2,4),(2,6).
- 3: divides 3,6 , (3,3),(3,6).
- 4: divides 4 , (4,4).
- 6: divides 6 , (6,6).
R={(1,1),(1,2),(1,3),(1,4),(1,6),(2,2),(2,4),(2,6),(3,3),(3,6),(4,4),(6,6)}.
Domain = Range =A (since each element divides itself).
Reflexive: yes, (a,a)∈R for all a. Symmetric: no, e.g. (1,2)∈R but (2,1)∈/R. Transitive: yes (a∣b and b∣c imply a∣c).
Try it yourself
- Let A={1,2,3}, B={4,5,6}. Write R={(x,y):x+y=7} in roster form. Find Dom, Range, Codomain.
- Find the number of relations from a set of 5 elements to itself.
- Define R on Z by xRy⟺x−y is divisible by 3. Is R reflexive? Symmetric? Transitive?
- Let A={1,2,3,4}. Write R={(x,y):y=2x} in roster form.
- Let A={−2,−1,0,1,2}. Write R={(x,y):y=∣x∣,y∈A} in roster form.
- Find Dom and Range of R={(x,x3):x∈{1,2,3,4}}.
- Draw the arrow diagram of R={(1,a),(2,a),(3,b)} from {1,2,3} to {a,b,c}.
- Express the relation "x+2y=8, x,y∈N" in roster form.
- Find the relation R on {1,2,3,4,5,6} given by xRy⟺y=x+1.
- Decide if "is a friend of" (on people) is reflexive, symmetric, transitive.
- If A has 4 elements, how many relations on A are reflexive? (Hint: each "diagonal" pair must be in; each off-diagonal pair is free.)
- The relation R on N is aRb⟺a≤b. Is it reflexive, symmetric, transitive?
Pitfalls / Tricks
- Range vs codomain. The codomain is what you declare the output set to be; the range is what actually appears. Always answer the question literally , many MCQs distinguish these.
- A relation from A to B that lists (a,b) does not imply bRa. Ordered pairs in a relation are directed.
- An empty subset of A×B is a relation too (the empty relation).
- Insight. Every equation linking two variables , say x2+y2=1 , defines a relation on R. The graph of the equation is the relation viewed as a subset of R2.