A rela­tion from AA to BB need not use every ele­ment of AA or every ele­ment of BB. The ele­ments that actu­ally take part form the domain and the range of the rela­tion. Revers­ing every pair of a rela­tion gives another rela­tion, called its inverse. These three ideas carry straight over to func­tions, where they are used all the time.

Domain and range

Let RR be a rela­tion from AA to BB. Then:

  1. The domain of RR is the set of first entries of the pairs in RR: {a∈A:aRb for some b∈B}\{a \in A : aRb \text{ for some } b \in B\}.
  2. The range of RR is the set of sec­ond entries of the pairs in RR: {b∈B:aRb for some a∈A}\{b \in B : aRb \text{ for some } a \in A\}.

The whole set BB is some­times called the codomain of RR. The range is always a sub­set of the codomain, and the domain is a sub­set of AA.

Exam­ple 1

Let A={1,2,3}A = \{1, 2, 3\} and B={a,b}B = \{a, b\}, so that A×B={(1,a),(1,b),(2,a),(2,b),(3,a),(3,b)}A \times B = \{(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)\}. Let R1={(1,a),(2,a)}R_1 = \{(1, a), (2, a)\}. Find the domain and range of R1R_1.

The first entries are 1 and 2, so the domain of R1R_1 is {1,2}\{1, 2\}. The only sec­ond entry is aa, so the range of R1R_1 is {a}\{a\}. The ele­ment 3 of AA and the ele­ment bb of BB take no part.

Exam­ple 2

Let A={1,2,3,4,5,6}A = \{1, 2, 3, 4, 5, 6\} and let RR be the rela­tion on AA given by R={(a,b):b=a+2}R = \{(a, b) : b = a + 2\}. Write RR as a set of pairs, and find its domain and range.

For a=1,2,3,4a = 1, 2, 3, 4 the num­ber a+2a + 2 is in AA; for a=5,6a = 5, 6 it is not. So

R={(1,3),(2,4),(3,5),(4,6)}R = \{(1, 3), (2, 4), (3, 5), (4, 6)\}

The domain is {1,2,3,4}\{1, 2, 3, 4\} and the range is {3,4,5,6}\{3, 4, 5, 6\}.

Exam­ple 3

Let R={(x,y):x,y∈N, x+2y=10}R = \{(x, y) : x, y \in N, \ x + 2y = 10\}. Find RR, its domain and its range.

Since x=10−2yx = 10 - 2y must be a nat­ural num­ber, yy can be 1, 2, 3 or 4 (for y=5y = 5, x=0x = 0, which is not nat­ural). This gives

R={(8,1),(6,2),(4,3),(2,4)}R = \{(8, 1), (6, 2), (4, 3), (2, 4)\}

The domain is {2,4,6,8}\{2, 4, 6, 8\} and the range is {1,2,3,4}\{1, 2, 3, 4\}.

Arrow dia­grams

A rela­tion between small sets can be shown by an arrow dia­gram: draw two ovals, list the ele­ments of AA in the first and those of BB in the sec­ond, and draw an arrow from aa to bb for each pair (a,b)(a, b) in the rela­tion. The domain is the set of ele­ments in the first oval that have an arrow leav­ing them; the range is the set of ele­ments in the sec­ond oval that have an arrow arriv­ing.

The inverse of a rela­tion

If RR is a rela­tion from AA to BB, then the inverse rela­tion R−1R^{-1} is the rela­tion from BB to AA obtained by revers­ing every pair:

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

In an arrow dia­gram, the inverse sim­ply reverses every arrow.

Exam­ple 4

Let A={1,2,3}A = \{1, 2, 3\}, B={a,b}B = \{a, b\} and R1={(1,b),(3,b)}R_1 = \{(1, b), (3, b)\}. Find R1−1R_1^{-1}.

Reverse each pair: R1−1={(b,1),(b,3)}R_1^{-1} = \{(b, 1), (b, 3)\}. It is a rela­tion from BB to AA.

Since revers­ing swaps first and sec­ond entries:

  • the domain of R−1R^{-1} is the range of RR, and
  • the range of R−1R^{-1} is the domain of RR.

Revers­ing twice gives back the orig­i­nal rela­tion: (R−1)−1=R(R^{-1})^{-1} = R.

Exam­ple 5

For R={(1,3),(2,4),(3,5),(4,6)}R = \{(1, 3), (2, 4), (3, 5), (4, 6)\} from Exam­ple 2, find R−1R^{-1} with its domain and range, and describe it by a rule.

R−1={(3,1),(4,2),(5,3),(6,4)}R^{-1} = \{(3, 1), (4, 2), (5, 3), (6, 4)\}. Its domain is {3,4,5,6}\{3, 4, 5, 6\}, the range of RR; its range is {1,2,3,4}\{1, 2, 3, 4\}, the domain of RR. Since RR was "b=a+2b = a + 2", the inverse is "b=a−2b = a - 2": each ele­ment is related to the num­ber 2 less than it.

Exam­ple 6

Let R={(x,x2):x is a prime number less than 10}R = \{(x, x^2) : x \text{ is a prime number less than } 10\}. Find RR, R−1R^{-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)}R = \{(2, 4), (3, 9), (5, 25), (7, 49)\}, with domain {2,3,5,7}\{2, 3, 5, 7\} and range {4,9,25,49}\{4, 9, 25, 49\}.

R−1={(4,2),(9,3),(25,5),(49,7)}R^{-1} = \{(4, 2), (9, 3), (25, 5), (49, 7)\}, with domain {4,9,25,49}\{4, 9, 25, 49\} and range {2,3,5,7}\{2, 3, 5, 7\}.

Prac­tice

  1. Find the domain and range of R={(1,2),(1,3),(2,5),(4,5)}R = \{(1, 2), (1, 3), (2, 5), (4, 5)\}.
  2. Let A={1,2,3,4,5}A = \{1, 2, 3, 4, 5\} and R={(a,b):a,b∈A, b=2a−1}R = \{(a, b) : a, b \in A, \ b = 2a - 1\}. Write RR and find its domain and range.
  3. Let R={(x,y):x,y∈N, 2x+y=9}R = \{(x, y) : x, y \in N, \ 2x + y = 9\}. Write RR and find its domain and range.
  4. Find the inverse of R={(a,1),(b,2),(c,2)}R = \{(a, 1), (b, 2), (c, 2)\}.
  5. If the domain of a rela­tion RR is {1,2,3}\{1, 2, 3\} and its range is {7,8}\{7, 8\}, what are the domain and range of R−1R^{-1}?
  6. Let A={1,2,3,4,6}A = \{1, 2, 3, 4, 6\} and R={(a,b):a,b∈A, a divides b, a≠b}R = \{(a, b) : a, b \in A, \ a \text{ divides } b, \ a \neq b\}. Write RR and find its domain and range.
  7. Let R={(x,y):x∈{1,2,3}, y=x2+1}R = \{(x, y) : x \in \{1, 2, 3\}, \ y = x^2 + 1\}. Write RR and R−1R^{-1}.
  8. The rela­tion RR on {1,2,3,4}\{1, 2, 3, 4\} is "a<ba < b". Write RR and R−1R^{-1}, and describe R−1R^{-1} in words.

Answers

Show answers
  1. Domain {1,2,4}\{1, 2, 4\}, range {2,3,5}\{2, 3, 5\}.
  2. R={(1,1),(2,3),(3,5)}R = \{(1, 1), (2, 3), (3, 5)\}; domain {1,2,3}\{1, 2, 3\}, range {1,3,5}\{1, 3, 5\}. (For a=4,5a = 4, 5, 2a−12a - 1 is not in AA.)
  3. R={(1,7),(2,5),(3,3),(4,1)}R = \{(1, 7), (2, 5), (3, 3), (4, 1)\}; domain {1,2,3,4}\{1, 2, 3, 4\}, range {1,3,5,7}\{1, 3, 5, 7\}.
  4. {(1,a),(2,b),(2,c)}\{(1, a), (2, b), (2, c)\}
  5. Domain {7,8}\{7, 8\}, range {1,2,3}\{1, 2, 3\}.
  6. R={(1,2),(1,3),(1,4),(1,6),(2,4),(2,6),(3,6)}R = \{(1, 2), (1, 3), (1, 4), (1, 6), (2, 4), (2, 6), (3, 6)\}; domain {1,2,3}\{1, 2, 3\}, range {2,3,4,6}\{2, 3, 4, 6\}.
  7. R={(1,2),(2,5),(3,10)}R = \{(1, 2), (2, 5), (3, 10)\} and R−1={(2,1),(5,2),(10,3)}R^{-1} = \{(2, 1), (5, 2), (10, 3)\}.
  8. R={(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}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)}R^{-1} = \{(2, 1), (3, 1), (4, 1), (3, 2), (4, 2), (4, 3)\}, which is the rela­tion "a>ba > b".