A relation from A to B need not use every element of A or every element of B. The elements that actually take part form the domain and the range of the relation. Reversing every pair of a relation gives another relation, called its inverse. These three ideas carry straight over to functions, where they are used all the time.
Domain and range#
Let R be a relation from A to B. Then:
- The domain of R is the set of first entries of the pairs in R: {a∈A:aRb for some b∈B}.
- The range of R is the set of second entries of the pairs in R: {b∈B:aRb for some a∈A}.
The whole set B is sometimes called the codomain of R. The range is always a subset of the codomain, and the domain is a subset of A.
Example 1#
Let A={1,2,3} and B={a,b}, so that A×B={(1,a),(1,b),(2,a),(2,b),(3,a),(3,b)}. Let R1={(1,a),(2,a)}. Find the domain and range of R1.
The first entries are 1 and 2, so the domain of R1 is {1,2}. The only second entry is a, so the range of R1 is {a}. The element 3 of A and the element b of B take no part.
Example 2#
Let A={1,2,3,4,5,6} and let R be the relation on A given by R={(a,b):b=a+2}. Write R as a set of pairs, and find its domain and range.
For a=1,2,3,4 the number a+2 is in A; for a=5,6 it is not. So
R={(1,3),(2,4),(3,5),(4,6)}
The domain is {1,2,3,4} and the range is {3,4,5,6}.
Example 3#
Let R={(x,y):x,y∈N, x+2y=10}. Find R, its domain and its range.
Since x=10−2y must be a natural number, y can be 1, 2, 3 or 4 (for y=5, x=0, which is not natural). This gives
R={(8,1),(6,2),(4,3),(2,4)}
The domain is {2,4,6,8} and the range is {1,2,3,4}.
Arrow diagrams#
A relation between small sets can be shown by an arrow diagram: draw two ovals, list the elements of A in the first and those of B in the second, and draw an arrow from a to b for each pair (a,b) in the relation. The domain is the set of elements in the first oval that have an arrow leaving them; the range is the set of elements in the second oval that have an arrow arriving.
The inverse of a relation#
If R is a relation from A to B, then the inverse relation R−1 is the relation from B to A obtained by reversing every pair:
R−1={(b,a):(a,b)∈R}
In an arrow diagram, the inverse simply reverses every arrow.
Example 4#
Let A={1,2,3}, B={a,b} and R1={(1,b),(3,b)}. Find R1−1.
Reverse each pair: R1−1={(b,1),(b,3)}. It is a relation from B to A.
Since reversing swaps first and second entries:
- the domain of R−1 is the range of R, and
- the range of R−1 is the domain of R.
Reversing twice gives back the original relation: (R−1)−1=R.
Example 5#
For R={(1,3),(2,4),(3,5),(4,6)} from Example 2, find R−1 with its domain and range, and describe it by a rule.
R−1={(3,1),(4,2),(5,3),(6,4)}. Its domain is {3,4,5,6}, the range of R; its range is {1,2,3,4}, the domain of R. Since R was "b=a+2", the inverse is "b=a−2": each element is related to the number 2 less than it.
Example 6#
Let R={(x,x2):x is a prime number less than 10}. Find R, R−1, and the domain and range of each.
The primes less than 10 are 2, 3, 5, 7. So R={(2,4),(3,9),(5,25),(7,49)}, with domain {2,3,5,7} and range {4,9,25,49}.
R−1={(4,2),(9,3),(25,5),(49,7)}, with domain {4,9,25,49} and range {2,3,5,7}.
Practice#
- Find the domain and range of R={(1,2),(1,3),(2,5),(4,5)}.
- Let A={1,2,3,4,5} and R={(a,b):a,b∈A, b=2a−1}. Write R and find its domain and range.
- Let R={(x,y):x,y∈N, 2x+y=9}. Write R and find its domain and range.
- Find the inverse of R={(a,1),(b,2),(c,2)}.
- If the domain of a relation R is {1,2,3} and its range is {7,8}, what are the domain and range of R−1?
- Let A={1,2,3,4,6} and R={(a,b):a,b∈A, a divides b, a=b}. Write R and find its domain and range.
- Let R={(x,y):x∈{1,2,3}, y=x2+1}. Write R and R−1.
- The relation R on {1,2,3,4} is "a<b". Write R and R−1, and describe R−1 in words.
Answers#
Show answers
- Domain {1,2,4}, range {2,3,5}.
- R={(1,1),(2,3),(3,5)}; domain {1,2,3}, range {1,3,5}. (For a=4,5, 2a−1 is not in A.)
- R={(1,7),(2,5),(3,3),(4,1)}; domain {1,2,3,4}, range {1,3,5,7}.
- {(1,a),(2,b),(2,c)}
- Domain {7,8}, range {1,2,3}.
- R={(1,2),(1,3),(1,4),(1,6),(2,4),(2,6),(3,6)}; domain {1,2,3}, range {2,3,4,6}.
- R={(1,2),(2,5),(3,10)} and R−1={(2,1),(5,2),(10,3)}.
- R={(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}; R−1={(2,1),(3,1),(4,1),(3,2),(4,2),(4,3)}, which is the relation "a>b".