# Mathematics 220 Workshop 3 - Proofs involving integers and sets;... 1. (a) Prove that 3|2n ⇔ 3|n. ```Mathematics 220 Workshop 3 - Proofs involving integers and sets; proof by contradiction
1. (a) Prove that 3|2n ⇔ 3|n.
Hint: the contrapositive will really help in one direction.
Solution:
Proof. (⇐) Let 3|n. Then, there exists k ∈ N such that n = 3k. So, 2n = 3(2k).
Hence, 3|2n.
(⇒) We instead prove the contrapositive: “If 3 ∤ n then 3 ∤ 2n.”
Assume 3 ∤ n. Then n = 3k + 1 or n = 3k + 2 for some k ∈ Z.
• If n = 3k + 1 then 2n = 6k + 2 = 3(2k) + 2. This is clearly not a multiple of 3
and so 3 ∤ 2n.
• If n = 3k + 2 then 2n = 6k + 4 = 3(2k + 1) + 1. This is clearly not a multiple of
3 and so 3 ∤ 2n.
In either case 3 ∤ 2n.
(b) Prove that if 2|n and 3|n then 6|n.
Solution: Since 2|n, there exists an integer k such that n = 2k. Then we have 3|2k.
Then by part (a), 3|k. Then there exists an integer m, such that k = 3m. Then
n = 2 &middot; 3m = 6m, so 6|n.
(c) Is it true that if a natural number is divisible by 4 and by 6, then it must be divisible by
4 &times; 6 = 24?
Solution: It is false. Let n = 12. Then, n is divisible by 4 and 6 being n = 4(3) = 6(2),
but 12 is not divisible by 4 &times; 6 = 24 (being less than 24).
2. Find the number a ∈ {0, 1, 2, 3, 4} such that 20172018 ≡ a mod 5.
Solution: Recall that we proved in class that if a ≡ b mod m and c ≡ d mod m, then
ac ≡ bd mod m. Applying this theorem to a = 2017 and b = 2 (with m = 5) 2018 times,
we get that 20172018 ≡ 22018 mod 5.
So, now we need to find the remainder of 22018 modulo 5. Consider the first few powers of
2:
21 ≡ 2 mod 5
22 = 4 ≡ 4
3
2 =8≡3
mod 5
mod 5
24 = 16 ≡ 1 mod 5.
Now we stop, because we found a power of 2, namely, 24 , that is congruent to 1 modulo
5. Then, by the fact about congruences that we already used above, any power of 16 will
be congruent to the same power of 1, that is, to 1, modulo 5. Next, note that 2018 =
2016 + 2 = 4 &middot; 504 + 2. Then
22018 = 22016 &middot; 4 = (24 )504 &middot; 4 = 16504 &middot; 4 ≡ 1504 &middot; 4 ≡ 4 mod 5.
Page 1 of 4
Mathematics 220 Workshop 3 - Proofs involving integers and sets; proof by contradiction
3. Prove that a sum of a rational number and an irrational number must be irrational.
Solution: Use proof by contradiction. Suppose to the contrary that there is a rational ab ,
an irrational number z and a rational dc so that ab + z = dc . (Here a, b, c, d are all integers
with b, d both non-zero). Therefore z = dc − ab = bc−da
bd
4. For sets A, B, C in the universal set U , prove or disprove the following:
(a) (A &times; B) ∪ (C &times; D) ⊆ (A ∪ C) &times; (B ∪ D).
(b) (A &times; B) ∪ (C &times; D) = (A ∪ C) &times; (B ∪ D)
(c) A ⊆ B ⇒ A − (B ∩ C) ⊆ A − C
(d) A ∪ (B ∩ C) = (A ∪ B) ∩ C
Solution:
(a) This statement is true. Proof: let (x, y) ∈ (A &times; B) ∪ (C &times; D). We need to prove
that (x, y) ∈ (A ∪ C) &times; (B ∪ D). Since (x, y) ∈ (A &times; B) ∪ (C &times; D), we know that
(x, y) ∈ A &times; B or (x, y) ∈ C &times; D, by definition of the union of sets. In the first case,
x ∈ A and y ∈ B, and in the second case, x ∈ C and y ∈ D, by definition of the
Cartesian product. We obtain that in either case, x ∈ A ∪ C and y ∈ B ∪ D, and
therefore (x, y) ∈ (A ∪ C) &times; (B ∪ D), as required.
(b) The statement is False. Counterexample (in fact, almost any example works): Let
A = {1}, B = {2}, C = {3}, and D = {4}. Then A &times; B is a 1-element set A &times; B =
{(1, 2)}, and similarly, C &times; D = {(3, 4)}. Then (A &times; B) ∪ (C &times; D) = {(1, 2), (3, 4)}.
On the other hand, A ∪ C = {1, 3} and B ∪ D = {2, 4}. Then (A ∪ C) &times; (B ∪ D)
consists of 4 elements:
(A ∪ C) &times; (B ∪ D) = {(1, 2), (1, 4), (3, 2), (3, 4)},
and we see that it contains the set (A &times; B) ∪ (C &times; D) as a proper subset.
(c) Claim: A ⊆ B ⇒ A − (B ∩ C) ⊆ A − C
Proof:
Let x ∈ A − (B ∩ C). Then, x ∈ A, and x 6∈ B ∩ C. Since A ⊆ B, x ∈ A implies that
x ∈ B. On the other hand, x 6∈ B ∩ C implies that x 6∈ B or x 6∈ C, but we showed
that x ∈ B, so x 6∈ C. Thus, x ∈ A but x 6∈ C, which means x ∈ A − C. Hence,
A − (B ∩ C) ⊆ A − C.
(d) A ∪ (B ∩ C) = (A ∪ B) ∩ C is false. A counter example is when A = Q, B = C = ∅.
Then, A ∪ (B ∩ C) = Q ∪ (∅ ∩ ∅) = Q, whereas (A ∪ B) ∩ C = (Q ∪ ∅) ∩ ∅ = ∅, and
they are not equal.
5. (a) Prove that any number is congruent to the sum of its digits modulo 9.
Hint: consider a two-digit number ab first, and use the definition of congruence.
Page 2 of 4
Mathematics 220 Workshop 3 - Proofs involving integers and sets; proof by contradiction
(b) Prove that any number is congruent to alternating sum of it digits mod 11. The alternating sum is: a0 − a1 + a2 − a3 + a4 − &middot; &middot; &middot; + (−1)n an , where a0 is the last digit (the number
of units).
Solution: Let the integer a be written with the digits an , an−1 , . . . , a0 : that is,
a = an an−1 . . . a1 a0 .
Note that a0 is the number of units, a1 is he number of 10s, etc., and so a is in fact expressed
as:
n
X
ak 10k .
a = 10n an + 10n−1 an−1 + &middot; &middot; &middot; + 10a1 + a0 =
k=0
(If you are confused by this notation, consider an example: 879 = 8 &middot; 100 + 7 &middot; 10 + 9; in this
example n = 2).
In part (a), we need to prove that a ≡ (a0 + a1 + &middot; &middot; &middot; + an ) mod 9. In Part (b), we need to
prove a ≡ a0 − a1 + a2 − a3 + a4 − &middot; &middot; &middot; + (−1)n an mod 11.
Let us start with part (a). By definition of congruence, we need to verify that
a − (a0 + a1 + &middot; &middot; &middot; + an ) is divisible by 9. Using the expression for a, we get:
a − (a0 + &middot; &middot; &middot; + an ) = 10n an + 10n−1 an−1 + &middot; &middot; &middot; + 10a1 + a0 − (a0 + &middot; &middot; &middot; + an )
n
n
n
X
X
X
(10k − 1)ak .
ak =
ak 10k −
=
k=0
k=0
k=0
It remains to observe that for every k ≥ 0, 10k −1 is divisible by 9 (make sure you know how
to prove it! For example, you can use the same technique we used before: 10 is congruent
to 1 mod 9, so any power of 10 is congruent to that power of 1, i.e. to 1). Thus, every
term of the sum is divisible by 9, and the whole sum is divisible by 9.
Part (b) is prove similarly. We have:
a − (a0 − a1 + a2 − a3 + a4 − &middot; &middot; &middot; + (−1)n an ) =
n
X
ak 10k −
k=0
n
X
ak (−1)k =
k=0
n
X
ak (10k − (−1)k ).
k=0
It remains to note that for every k ≥ 0, 10k is congruent to (−1)k mod 11. Try to prove
this fact yourself (and seek help if you cannot!) and also make sure you see how to complete
the proof of Part (b) from here.
6. (a) Prove that n is even iff n3 is even. (Hint: The contrapositive would be very helpful in one
direction.)
Solution: (⇒) Assume n is even. Then n ≡ 0 (mod 2) and so n3 ≡ 03 = 0 (mod 2).
Therefore n3 is even.
(⇐) We prove the contrapositive, that is, n odd⇒ n3 odd. Assume n is odd. Then
n ≡ 1 (mod 2) and so n3 ≡ 13 = 1 (mod 2). That is n3 is odd.
(b) Prove that 21/3 is irrational. Hint: Use proof by contradiction.
Page 3 of 4
Mathematics 220 Workshop 3 - Proofs involving integers and sets; proof by contradiction
Solution: Proof by contradiction. Assume to the contrary that 21/3 is rational. Then
there are integers a and b so that 21/3 = ab and at least one of a and b is odd (by
cancelling factors of 2). Cubing both sides and doing a bit of algebra, we get a3 = 2b3
and so a3 is even. By (a) above this implies a = 2k is even. Therefore 23 k3 = 2b3 and
so b3 = 4k3 is also even. By (a) b is also even. This contradicts the fact that at least
.
one of a or b is odd.
7. Three friends - Adam, Bob and Cindy - are studying at UBC. One is in math, one is in physics,
and one is in chemistry. If Adam is a mathematician, then Cindy is not a physicist. If Bob is
not a physicist, then Adam is a mathematician. If Cindy is not a mathematician, then Bob is
a chemist.
Determine which friend is studying which subject.
Solution: Suppose that Cindy is not a mathematician. By the third statement, Bob is a
chemist. Since neither Cindy nor Bob is a mathematician, Adam is a mathematician. So,
it remains that Cindy is a physicist. However, the first statement is not satisfied because
Adam is a mathematician, and Cindy is a physicist. So, Cindy must be a mathematician.
Adam is not a mathematician (because Cindy already is one), so by the contrapositive of
the second statement, Bob must be a physicist.
So, Cindy is a mathematician, Bob is a physicist, and Adam is a chemist.
Page 4 of 4
```