How to use these solu­tions

These are full worked solu­tions to the prac­tice ques­tions in the les­son Types of Rela­tions and Func­tions. Try each ques­tion first, and then com­pare your rea­son­ing with the steps below. In this topic the answer "yes" or "no" is worth lit­tle on its own: for every prop­erty you must either prove it in gen­eral or give one spe­cific counter-exam­ple, and the solu­tions show you how to do both.

Ques­tion 1: Prop­er­ties of three rela­tions

The prob­lem

On {1,2,3,4}\{1, 2, 3, 4\}, decide which prop­er­ties hold:
R1={(1,1),(2,2),(3,3),(4,4),(1,3),(3,1)}R_1 = \{(1, 1), (2, 2), (3, 3), (4, 4), (1, 3), (3, 1)\}; R2={(1,2),(2,1)}R_2 = \{(1, 2), (2, 1)\}; R3={(1,2),(2,3),(1,3)}R_3 = \{(1, 2), (2, 3), (1, 3)\}.

Under­stand­ing the prob­lem

For each rela­tion check three prop­er­ties on the set A={1,2,3,4}A = \{1, 2, 3, 4\}:

  • reflex­ive: all four pairs (1,1),(2,2),(3,3),(4,4)(1,1), (2,2), (3,3), (4,4) are present;
  • sym­met­ric: when­ever (a,b)(a, b) is present, so is (b,a)(b, a);
  • tran­si­tive: when­ever (a,b)(a, b) and (b,c)(b, c) are present, so is (a,c)(a, c).

The idea

Test each prop­erty pair by pair. To show a prop­erty fails, one miss­ing pair is enough.

Step-by-step solu­tion

Rela­tion R1R_1

Step 1. Reflex­ive: (1,1),(2,2),(3,3),(4,4)(1,1), (2,2), (3,3), (4,4) are all in R1R_1. ✓

Step 2. Sym­met­ric: the only non-diag­o­nal pairs are (1,3)(1, 3) and (3,1)(3, 1), and each has its reverse. ✓

Step 3. Tran­si­tive: the chains are (1,3),(3,1)⇒(1,1)(1,3),(3,1) \Rightarrow (1,1) ✓; (3,1),(1,3)⇒(3,3)(3,1),(1,3) \Rightarrow (3,3) ✓; any chain through a diag­o­nal pair like (1,1),(1,3)(1,1),(1,3) gives back (1,3)(1,3) ✓.

Step 4. All three hold, so R1R_1 is an equiv­a­lence rela­tion.

Rela­tion R2R_2

Step 1. Reflex­ive? (1,1)∉R2(1, 1) \notin R_2. ✗

Step 2. Sym­met­ric: (1,2)(1, 2) and (2,1)(2, 1) are both present. ✓

Step 3. Tran­si­tive? (1,2)(1, 2) and (2,1)(2, 1) are present, so (1,1)(1, 1) would have to be, but it is not. ✗

Rela­tion R3R_3

Step 1. Reflex­ive? (1,1)∉R3(1, 1) \notin R_3. ✗

Step 2. Sym­met­ric? (1,2)∈R3(1, 2) \in R_3 but (2,1)∉R3(2, 1) \notin R_3. ✗

Step 3. Tran­si­tive: the only chain is (1,2),(2,3)(1, 2), (2, 3), which needs (1,3)(1, 3), and it is present. No other pair (b,c)(b, c) starts where another pair ends. ✓

Check­ing the answer

A brute-force check of all pairs by com­puter gives: R1R_1 (reflex­ive, sym­met­ric, tran­si­tive); R2R_2 (sym­met­ric only); R3R_3 (tran­si­tive only). ✓

Answer

R1R_1 is an equiv­a­lence rela­tion; R2R_2 is sym­met­ric only; R3R_3 is tran­si­tive only.

Com­mon mis­take to avoid

Think­ing R2R_2 is tran­si­tive because "there is noth­ing to chain". The chain (1,2),(2,1)(1, 2), (2, 1) demands (1,1)(1, 1).

Ques­tion 2: Con­gru­ence mod­ulo 5

The prob­lem

Show that R={(a,b):a−b is a multiple of 5}R = \{(a, b) : a - b \text{ is a multiple of } 5\} on Z\mathbf{Z} is an equiv­a­lence rela­tion. Describe [2][2].

Under­stand­ing the prob­lem

You must prove all three prop­er­ties for every inte­ger, not just check exam­ples. Then list the class of 22: all inte­gers related to 22.

The idea

Fol­low Exam­ple 1 of the les­son, which does the same for 44. Write "mul­ti­ple of 55" as 5k5k with kk an inte­ger.

Step-by-step solu­tion

Step 1. Reflex­ive. For any inte­ger aa, a−a=0=5×0a - a = 0 = 5 \times 0, a mul­ti­ple of 55. So (a,a)∈R(a, a) \in R.

Step 2. Sym­met­ric. Sup­pose (a,b)∈R(a, b) \in R, so a−b=5ka - b = 5k. Then

b−a=−5k=5(−k),b - a = -5k = 5(-k),

a mul­ti­ple of 55. So (b,a)∈R(b, a) \in R.

Step 3. Tran­si­tive. Sup­pose a−b=5ka - b = 5k and b−c=5mb - c = 5m. Add them.

a−c=(a−b)+(b−c)=5k+5m=5(k+m)a - c = (a - b) + (b - c) = 5k + 5m = 5(k + m)

So (a,c)∈R(a, c) \in R.

Step 4. All three hold, so RR is an equiv­a­lence rela­tion.

Step 5. The class of 22: all xx with x−2=5kx - 2 = 5k, that is x=5k+2x = 5k + 2.

[2]={…,−8,−3,2,7,12,…}[2] = \{\ldots, -8, -3, 2, 7, 12, \ldots\}

Check­ing the answer

12−2=1012 - 2 = 10 ✓ and −3−2=−5-3 - 2 = -5 ✓, both mul­ti­ples of 55. Each ele­ment of [2][2] leaves remain­der 22 on divi­sion by 55.

Answer

RR is reflex­ive, sym­met­ric and tran­si­tive, hence an equiv­a­lence rela­tion; [2]={5k+2:k∈Z}={…,−8,−3,2,7,12,…}[2] = \{5k + 2 : k \in \mathbf{Z}\} = \{\ldots, -8, -3, 2, 7, 12, \ldots\}.

Ques­tion 3: Sim­i­lar­ity of tri­an­gles

The prob­lem

On the set of all tri­an­gles, show that "is sim­i­lar to" is an equiv­a­lence rela­tion.

Under­stand­ing the prob­lem

Say T1 R T2T_1 \, R \, T_2 when tri­an­gle T1T_1 is sim­i­lar to tri­an­gle T2T_2, mean­ing their cor­re­spond­ing angles are equal (equiv­a­lently, cor­re­spond­ing sides are in the same ratio). You must prove the three prop­er­ties.

The idea

Use the angle descrip­tion of sim­i­lar­ity: two tri­an­gles are sim­i­lar when their angles can be matched so that cor­re­spond­ing angles are equal. Equal­ity of num­bers is reflex­ive, sym­met­ric and tran­si­tive, and that car­ries over.

Step-by-step solu­tion

Step 1. Reflex­ive. Any tri­an­gle TT has the same angles as itself (match each angle with itself), so TT is sim­i­lar to TT.

Step 2. Sym­met­ric. If T1T_1 is sim­i­lar to T2T_2, the angles of T1T_1 equal the cor­re­spond­ing angles of T2T_2. Read­ing the same cor­re­spon­dence back­wards, the angles of T2T_2 equal those of T1T_1, so T2T_2 is sim­i­lar to T1T_1.

Step 3. Tran­si­tive. If T1∼T2T_1 \sim T_2 and T2∼T3T_2 \sim T_3, each angle of T1T_1 equals the match­ing angle of T2T_2, which equals the match­ing angle of T3T_3. So the angles of T1T_1 equal those of T3T_3, and T1∼T3T_1 \sim T_3.

Step 4. Hence sim­i­lar­ity is an equiv­a­lence rela­tion.

Check­ing the answer

The same argu­ment works with side ratios: if the ratio is kk from T1T_1 to T2T_2 and mm from T2T_2 to T3T_3, it is kmkm from T1T_1 to T3T_3, and 1k\displaystyle \tfrac{1}{k} from T2T_2 back to T1T_1.

Answer

Sim­i­lar­ity is reflex­ive, sym­met­ric and tran­si­tive, so it is an equiv­a­lence rela­tion on tri­an­gles.

Ques­tion 4: "Divides" on the nat­ural num­bers

The prob­lem

On N\mathbf{N}, is R={(a,b):a divides b}R = \{(a, b) : a \text{ divides } b\} reflex­ive, sym­met­ric, tran­si­tive?

Under­stand­ing the prob­lem

"aa divides bb" means b=akb = ak for some nat­ural num­ber kk. Check each prop­erty; for a fail­ure give a spe­cific counter-exam­ple.

The idea

Write divis­i­bil­ity as mul­ti­pli­ca­tion and test each prop­erty.

Step-by-step solu­tion

Step 1. Reflex­ive. a=a×1a = a \times 1, so aa divides aa for every aa. ✓

Step 2. Sym­met­ric? Counter-exam­ple: 22 divides 44, but 44 does not divide 22. So (2,4)∈R(2, 4) \in R but (4,2)∉R(4, 2) \notin R. ✗

Step 3. Tran­si­tive. If a∣ba \mid b and b∣cb \mid c, then b=akb = ak and c=bmc = bm. So

c=(ak)m=a(km),c = (ak)m = a(km),

and a∣ca \mid c. ✓

Check­ing the answer

Exam­ple of tran­si­tiv­ity: 2∣62 \mid 6 and 6∣186 \mid 18, and indeed 2∣182 \mid 18.

Answer

RR is reflex­ive and tran­si­tive, but not sym­met­ric.

Ques­tion 5: Sym­met­ric and tran­si­tive but not reflex­ive

The prob­lem

Give an exam­ple of a rela­tion on {1,2,3}\{1, 2, 3\} that is sym­met­ric and tran­si­tive but not reflex­ive.

Under­stand­ing the prob­lem

You must build one rela­tion that has two prop­er­ties and lacks the third. It fails to be reflex­ive if at least one of (1,1),(2,2),(3,3)(1,1), (2,2), (3,3) is miss­ing.

The idea

Leave out one ele­ment entirely: relate 11 and 22 only to them­selves and never men­tion 33. Then there are no pairs that could break sym­me­try or tran­si­tiv­ity.

Step-by-step solu­tion

Step 1. Take R={(1,1),(2,2)}R = \{(1, 1), (2, 2)\}.

Step 2. Not reflex­ive: (3,3)∉R(3, 3) \notin R.

Step 3. Sym­met­ric: each pair (a,a)(a, a) is its own reverse.

Step 4. Tran­si­tive: the only chains are (1,1),(1,1)⇒(1,1)(1,1),(1,1) \Rightarrow (1,1) and (2,2),(2,2)⇒(2,2)(2,2),(2,2) \Rightarrow (2,2), both present.

Check­ing the answer

A com­puter check of the three prop­er­ties gives (not reflex­ive, sym­met­ric, tran­si­tive). ✓ Other answers are pos­si­ble, for exam­ple {(1,1),(1,2),(2,1),(2,2)}\{(1,1),(1,2),(2,1),(2,2)\}.

Answer

R={(1,1),(2,2)}R = \{(1, 1), (2, 2)\} is sym­met­ric and tran­si­tive but not reflex­ive, since (3,3)∉R(3, 3) \notin R.

Ques­tion 6: Equiv­a­lence classes mod­ulo 3

The prob­lem

On A={1,2,…,12}A = \{1, 2, \ldots, 12\}, R={(a,b):3∣a−b}R = \{(a, b) : 3 \mid a - b\}. List the equiv­a­lence classes.

Under­stand­ing the prob­lem

Two num­bers are related when their dif­fer­ence is a mul­ti­ple of 33, that is, when they leave the same remain­der on divi­sion by 33. Each class col­lects all num­bers with the same remain­der.

The idea

Sort 11 to 1212 by remain­der on divi­sion by 33: remain­der 11, 22 or 00.

Step-by-step solu­tion

Step 1. Remain­der 11: 1,4,7,101, 4, 7, 10.

Step 2. Remain­der 22: 2,5,8,112, 5, 8, 11.

Step 3. Remain­der 00: 3,6,9,123, 6, 9, 12.

Step 4. These three sets are the classes [1][1], [2][2] and [3][3].

Check­ing the answer

The classes are dis­joint and together con­tain all 1212 ele­ments (4+4+4=124 + 4 + 4 = 12), as equiv­a­lence classes must.

Answer

{1,4,7,10}\{1, 4, 7, 10\}, {2,5,8,11}\{2, 5, 8, 11\}, {3,6,9,12}\{3, 6, 9, 12\}.

Ques­tion 7: One-one and onto for four func­tions

The prob­lem

Decide whether each is one-one and whether it is onto: (a) f:R→Rf : \mathbf{R} \to \mathbf{R}, f(x)=5−2xf(x) = 5 - 2x; (b) f:R→Rf : \mathbf{R} \to \mathbf{R}, f(x)=∣x∣f(x) = \lvert x \rvert; (c) f:N→Nf : \mathbf{N} \to \mathbf{N}, f(n)=n+3f(n) = n + 3; (d) f:R→Rf : \mathbf{R} \to \mathbf{R}, f(x)=x3f(x) = x^3.

Under­stand­ing the prob­lem

One-one: f(x1)=f(x2)f(x_1) = f(x_2) forces x1=x2x_1 = x_2. Onto: every ele­ment yy of the codomain equals f(x)f(x) for some xx in the domain. Pay atten­tion to the domain and codomain given.

The idea

For one-one, start from f(x1)=f(x2)f(x_1) = f(x_2) and try to reach x1=x2x_1 = x_2. For onto, take any yy and solve f(x)=yf(x) = y for xx, check­ing that xx lies in the domain. Use a counter-exam­ple when a prop­erty fails.

Step-by-step solu­tion

Part (a)

Step 1. One-one: 5−2x1=5−2x2⇒−2x1=−2x2⇒x1=x25 - 2x_1 = 5 - 2x_2 \Rightarrow -2x_1 = -2x_2 \Rightarrow x_1 = x_2. ✓

Step 2. Onto: given y∈Ry \in \mathbf{R}, solve 5−2x=y5 - 2x = y to get x=5−y2\displaystyle x = \frac{5 - y}{2}, a real num­ber. Then f(5−y2)=5−(5−y)=y\displaystyle f\left(\frac{5 - y}{2}\right) = 5 - (5 - y) = y. ✓

Step 3. So ff is bijec­tive.

Part (b)

Step 1. One-one? f(2)=2=f(−2)f(2) = 2 = f(-2) but 2≠−22 \ne -2. ✗

Step 2. Onto? ∣x∣≥0\lvert x \rvert \ge 0, so a neg­a­tive num­ber such as −1-1 has no preim­age. ✗

Part (c)

Step 1. One-one: n1+3=n2+3⇒n1=n2n_1 + 3 = n_2 + 3 \Rightarrow n_1 = n_2. ✓

Step 2. Onto? The small­est out­put is f(1)=4f(1) = 4. So 11, 22 and 33 are never out­puts (their preim­ages would be −2,−1,0-2, -1, 0, not nat­ural num­bers). ✗

Part (d)

Step 1. One-one: if x13=x23x_1^3 = x_2^3, then tak­ing the real cube root of both sides gives x1=x2x_1 = x_2 (every real num­ber has exactly one real cube root). ✓

Step 2. Onto: given y∈Ry \in \mathbf{R}, take x=y3x = \sqrt[3]{y}; then x3=yx^3 = y. ✓

Step 3. So ff is bijec­tive.

Check­ing the answer

Graph­i­cally, (a) and (d) pass the hor­i­zon­tal-line test and cover every height; (b) has a V shape, fail­ing both; (c) shifts every nat­ural num­ber up by 33, never reach­ing 1,2,31, 2, 3.

Answer

(a) bijec­tive; (b) nei­ther one-one nor onto; (c) one-one but not onto (1,2,31, 2, 3 are missed); (d) bijec­tive.

Ques­tion 8: Prov­ing a bijec­tion

The prob­lem

Show that f:R−{2}→R−{1}f : \mathbf{R} - \{2\} \to \mathbf{R} - \{1\}, f(x)=x−1x−2\displaystyle f(x) = \frac{x - 1}{x - 2} is a bijec­tion.

Under­stand­ing the prob­lem

You must show ff is both one-one and onto. The domain leaves out 22 (where the denom­i­na­tor is zero) and the codomain leaves out 11; you will see why 11 is excluded.

The idea

One-one: set f(x1)=f(x2)f(x_1) = f(x_2), cross-mul­ti­ply and sim­plify. Onto: solve x−1x−2=y\displaystyle \frac{x - 1}{x - 2} = y for xx and check that the xx found is allowed.

Step-by-step solu­tion

Step 1. One-one. Sup­pose f(x1)=f(x2)f(x_1) = f(x_2).

x1−1x1−2=x2−1x2−2\displaystyle \frac{x_1 - 1}{x_1 - 2} = \frac{x_2 - 1}{x_2 - 2}

Step 2. Cross-mul­ti­ply and expand.

(x1−1)(x2−2)=(x2−1)(x1−2)x1x2−2x1−x2+2=x1x2−2x2−x1+2\begin{aligned} (x_1 - 1)(x_2 - 2) &= (x_2 - 1)(x_1 - 2) \\ x_1x_2 - 2x_1 - x_2 + 2 &= x_1x_2 - 2x_2 - x_1 + 2 \end{aligned}

Step 3. Can­cel x1x2x_1x_2 and 22 from both sides and col­lect.

−2x1−x2=−2x2−x1⟹−x1=−x2⟹x1=x2-2x_1 - x_2 = -2x_2 - x_1 \quad\Longrightarrow\quad -x_1 = -x_2 \quad\Longrightarrow\quad x_1 = x_2

So ff is one-one.

Step 4. Onto. Take any y≠1y \ne 1 and solve f(x)=yf(x) = y.

x−1=y(x−2)x−1=xy−2yx−xy=1−2yx(1−y)=1−2yx=1−2y1−y=2y−1y−1\displaystyle \begin{aligned} x - 1 &= y(x - 2) \\ x - 1 &= xy - 2y \\ x - xy &= 1 - 2y \\ x(1 - y) &= 1 - 2y \\ x &= \frac{1 - 2y}{1 - y} = \frac{2y - 1}{y - 1} \end{aligned}

This divi­sion is allowed because y≠1y \ne 1.

Step 5. Check that this xx is in the domain, i.e. x≠2x \ne 2. If 2y−1y−1=2\displaystyle \frac{2y - 1}{y - 1} = 2, then 2y−1=2y−22y - 1 = 2y - 2, i.e. −1=−2-1 = -2, impos­si­ble. So x≠2x \ne 2.

Step 6. Check that it works.

f(x)=2y−1y−1−12y−1y−1−2=yy−11y−1=y\displaystyle f(x) = \frac{\frac{2y - 1}{y - 1} - 1}{\frac{2y - 1}{y - 1} - 2} = \frac{\frac{y}{y - 1}}{\frac{1}{y - 1}} = y

So ff is onto, and hence a bijec­tion.

Check­ing the answer

Test y=3y = 3: x=52\displaystyle x = \frac{5}{2}, and f(52)=3/21/2=3\displaystyle f\left(\frac{5}{2}\right) = \frac{3/2}{1/2} = 3. ✓ Also f(x)=1f(x) = 1 would need x−1=x−2x - 1 = x - 2, impos­si­ble, which is why 11 is removed from the codomain.

Answer

f(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2, and every y≠1y \ne 1 equals f(2y−1y−1)\displaystyle f\left(\frac{2y - 1}{y - 1}\right) with 2y−1y−1≠2\displaystyle \frac{2y - 1}{y - 1} \ne 2; so ff is a bijec­tion.

Ques­tion 9: Count­ing one-one and onto func­tions

The prob­lem

How many one-one func­tions are there from {a,b}\{a, b\} to {1,2,3}\{1, 2, 3\}? How many onto func­tions from {1,2,3}\{1, 2, 3\} to {a,b}\{a, b\}?

Under­stand­ing the prob­lem

A func­tion assigns one out­put to each input. For one-one, aa and bb must get dif­fer­ent out­puts. For onto, both aa and bb must be used as out­puts at least once.

The idea

Count one-one func­tions by the mul­ti­pli­ca­tion prin­ci­ple. Count onto func­tions by count­ing all func­tions and sub­tract­ing those that miss an out­put.

Step-by-step solu­tion

Step 1. One-one from {a,b}\{a, b\} to {1,2,3}\{1, 2, 3\}: aa has 33 choices; bb must be dif­fer­ent, so 22 choices.

3×2=63 \times 2 = 6

Step 2. All func­tions from {1,2,3}\{1, 2, 3\} to {a,b}\{a, b\}: each of the 33 inputs has 22 choices.

23=82^3 = 8

Step 3. Func­tions that are not onto use only one out­put: all to aa, or all to bb. That is 22 func­tions.

Step 4. Onto func­tions.

8−2=68 - 2 = 6

Check­ing the answer

List­ing by com­puter: 66 one-one func­tions and 66 onto func­tions. ✓

Answer

66 one-one func­tions and 66 onto func­tions.

Ques­tion 10: The signum func­tion

The prob­lem

Is the signum func­tion one-one? Is it onto R\mathbf{R}?

Under­stand­ing the prob­lem

The signum func­tion f:R→Rf : \mathbf{R} \to \mathbf{R} is

f(x)={1,x>00,x=0−1,x<0.f(x) = \begin{cases} 1, & x > 0 \\ 0, & x = 0 \\ -1, & x < 0. \end{cases}

The idea

For one-one, look for two dif­fer­ent inputs with the same out­put. For onto, look at the range and com­pare it with the codomain R\mathbf{R}.

Step-by-step solu­tion

Step 1. One-one? f(1)=1=f(2)f(1) = 1 = f(2), but 1≠21 \ne 2. So it is not one-one.

Step 2. Onto? The only out­puts are −1-1, 00 and 11. So the range is {−1,0,1}\{-1, 0, 1\}, not all of R\mathbf{R}; for exam­ple, 55 has no preim­age.

Check­ing the answer

The graph is three flat pieces; a hor­i­zon­tal line at height 11 meets it infi­nitely often, and a line at height 55 never meets it.

Answer

No, it is not one-one; and no, it is not onto R\mathbf{R}, since its range is {−1,0,1}\{-1, 0, 1\}.