0% found this document useful (0 votes)
98 views4 pages

CS 103X: Discrete Structures Homework Assignment 4 - Solutions

This document contains solutions to homework exercises on discrete structures. Exercise 1 involves analyzing properties of relations such as coprimality, divisibility, and rational number relations. Exercise 2 proves that four relations are equivalence relations. Exercise 3 defines new relations based on an original relation and proves properties. Exercise 4 discusses powers of relations on finite versus infinite sets.

Uploaded by

Michel Magna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views4 pages

CS 103X: Discrete Structures Homework Assignment 4 - Solutions

This document contains solutions to homework exercises on discrete structures. Exercise 1 involves analyzing properties of relations such as coprimality, divisibility, and rational number relations. Exercise 2 proves that four relations are equivalence relations. Exercise 3 defines new relations based on an original relation and proves properties. Exercise 4 discusses powers of relations on finite versus infinite sets.

Uploaded by

Michel Magna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS 103X: Discrete Structures

Homework Assignment 4 — Solutions

Exercise 1 (20 points). For each of the following relations, state whether they fulfill each of the 4 main properties
- reflexive, symmetric, antisymmetric, transitive. Briefly substantiate each of your answers.
(a) The coprime relation on Z. (Recall that a, b ∈ Z are coprime if and only if gcd(a, b) = 1.)
(b) Divisibility on Z.
(c) The relation T on R such that aT b if and only if ab ∈ Q.

Solution
(a) It’s definitely not reflexive, as no integer is coprime with itself except -1 and 1. It is symmetric because
gcd(a, b) = gcd(b, a), so gcd(a, b) = 1 iff gcd(b, a) = 1. Not antisymmetric — every coprime pair, such as (5,7)
and (7,5), will show this. Not transitive — gcd(5, 7) = 1, gcd(7, 10) = 1, but gcd(5, 10) 6= 1.
(b) It’s reflexive since any integer divides itself. Not symmetric, for example 2 | 4 but 4 - 2. It not antisymmetric
on Z, since a | −a and −a | a, although it would be antisymmetric if restricted to N. It is transitive — if a | b
then b = ka for some k ∈ Z, and if b | c then c = lb for some l ∈ Z, thus c = (lk)a and (lk) ∈ Z so a | c.
√ √ √
(c) Not reflexive, for example 4 2 4 2 = 2 which is definitely√not√ in Q.√Definitely
√ symmetric
√ √since multiplication is
commutative, ab = ba always. Not antisymmetric, since 2 8 = 8 2 = 4 but 2 6= 8. Also not transitive
— consider a = π, b = π1 , and c = π. ab, bc ∈ Q but ac = π 2 ∈ / Q.
Exercise 2 (20 points). Prove that each of the following relations ∼ is an equivalence relation:
(a) For positive integers a and b, a ∼ b if and only if a and b have exactly the same prime factors, up to repetitions.
(For example, 6 = 2 × 3 and 432 = 24 × 33 are related by ∼, but 18 = 2 × 32 and 10 = 2 × 5 are not.)
(b) For integers a and b, a ∼ b if and only if a + 3b is divisible by 4.
(c) A sequence of real numbers x1 , x2 , x3 . . . has a limit L if for any real number ε > 0, there is some integer n
such that |xi − L| < ε for all i > n. (Warning: The condition in the above definition must hold for all possible
ε > 0, not just one value of ε. For each ε there should be a corresponding n.) Let A = a1 , a2 , a3 , . . . and B =
b1 , b2 , b3 , . . . be two sequences of real numbers. Then A ∼ B if and only if the sequence a1 −b1 , a2 −b2 , a3 −b3 , . . .
has the limit 0.
(d) Let S be some set and T be a subset of S. For subsets A and B of S, say A ∼ B if and only if (A∪B)\(A∩B) ⊆ T .

Solution
(a) Let P (a) denote the set of prime factors of a — this set is unique by the Fundamental Theorem of Arithmetic.
Then a ∼ b if and only if P (a) = P (b). Trivially, P (a) = P (a), so a ∼ a and ∼ is reflexive. Also, a ∼
b ⇒ P (a) = P (b) ⇒ P (b) = P (a) ⇒ b ∼ a, so the relation is symmetric. Finally, a ∼ b and b ∼ c implies
P (a) = P (b) and P (b) = P (c), and since set equality is transitive, P (a) = P (c), so a ∼ c and the relation is
transitive. Hence ∼ is an equivalence.
(b) a + 3a = 4a is divisible by 4, so a ∼ a and the relation is reflexive. If a + 3b = 4n for some integer n, then
b + 3a = b + 3(4n − 3b) = 12n − 8b = 4(3n − 2b), which is divisible by 4. So a ∼ b ⇒ b ∼ a and the relation
is symmetric. Finally, if a + 3b = 4m and b + 3c = 4n for integers m, n, then adding the equations gives
a + 3b + b + 3c = 4m + 4n, or a + 3c = 4(m + n − b). So a ∼ b and b ∼ c implies a ∼ c and the relation is
transitive. Hence ∼ is an equivalence.
Practice Problem: Show that if a ∼ b if and only if a + mb is divisible by m + 1 for integers a, b, m 6= −1,
then ∼ is an equivalence.

1
(c) The sequence a1 − a1 , a2 − a2 , . . . is nothing but 0, 0, 0, . . . , so for any ε > 0, |xi − 0| = 0 < ε for all xi in
the sequence, i.e. it has limit 0 (for each ε, the corresponding n can be taken to be any integer whatsoever).
So A ∼ A and the relation is reflexive. If A ∼ B, then for each ε > 0, there is an integer n such that
|ai − bi − 0| = |ai − bi | < ε for all i > n. But |ai − bi | = |bi − ai |, so |bi − ai | < ε for all i greater than the
same integer n, i.e the sequence b1 − a1 , b2 − a2 , . . . has limit 0. So B ∼ A and the relation is symmetric.
Lastly, assume A ∼ B and B ∼ C. Then for any given ε, there is an integer m such that |ai − bi | < ε/2 for all
i > m, and there is an integer n such that |bi − ci | < ε/2 for all i > n. Let N = max{m, n}. Then for i > N ,
|ai − ci | = |ai − bi + bi − ci | ≤ |ai − bi | + |bi − ci | < ε/2 + ε/2 = ε (here we have used the standard relation
|x + y| ≤ |x| + |y| — we do not expect you to prove this in your solutions, but it is easy to do so — try it!).
The existence of such an integer N for each ε shows that a1 − c1 , a2 − c2 , . . . has limit 0. So A ∼ C and the
relation is transitive. Hence ∼ is an equivalence.
(d) (A∪A)\(A∩A) = ∅ ⊆ T , so A ∼ A and the relation is reflexive. If A ∼ B, then (A∪B)\(A∩B) ⊆ T , but since
∪ and ∩ are symmetric, A ∪ B = B ∪ A and A ∩ B = B ∩ A, so (B ∪ A) \ (B ∩ A) ⊆ T . So B ∼ A and the relation
is symmetric. Assume A ∼ B and B ∼ C. It it easy to prove that e is an element of S = (A ∪ B) \ (A ∩ B) if
and only if it is in exactly one of A and B. (If it is in exactly one, then it is in A ∪ B but not in A ∩ B and
hence is preserved by the set subtraction. If it is in neither, then it is not in A ∪ B and hence not in S, and if
it is in both then it is removed from S by subtracting A ∩ B.) So A ∼ B implies that every such element is in
T . Similarly B ∼ C implies that every element in exactly one of B and C is in T . Now consider an element e
in exactly one of A and C. Assume it is in A, hence not in C. If it is also in B, then it satisfies the condition
to be an element of (B ∪ C) \ (B ∩ C) and hence is in T . If e is not in B, then it satisfies the condition to be in
(A ∪ B) \ (A ∩ B) and hence is in T . An analogous line of reasoning applies to show that if e is in C but not
in A then it is in T . So A ∼ C and the relation is transitive. Hence ∼ is an equivalence.
Exercise 3 (20 points). Let A be a set. Given a relation R on A, define a relation S by xSy ⇔ (xRy and yRx),
/
and a relation T by xT y ⇔ (xRy and y Rx).
(a) Show that S is symmetric and T antisymmetric.
(b) Prove that xRy ⇔ (xSy or xT y).
(c) Show that if R is transitive, then S and T are also transitive, but that the reverse does not hold.

Solution
(a) Assume xSy, i.e. xRy and yRx. But this is the same as saying yRx and xRy, so ySx. So S is symmetric.
Now assume xT y and yT x. The first relation implies xRy and y Rx / and the second implies yRx and xRy. /
It is impossible for xRy and xRy / to hold simultaneously, and in particular it is impossible when x 6= y. So
x 6= y implies either xT/ y or y T/ x (or both). This proves (by taking the contrapositive) that T is antisymmetric.
(Note that this is an instance of the general rule that if the premise of an implication is impossible, then the
implication holds regardless of its conclusion — this is exactly analogous to saying that any statement about
the members of an empty set is true (lecture notes, Section 1.3)).
/ then xT y by definition. So xRy ⇒
(b) Assume xRy. Then if yRx, we have xSy by definition, and if y Rx,
(xSy or xT y).
Now assume xSy or xT y. In either case, xRy by definition. So (xSy or xT y) ⇒ xRy.
Putting the two implications together, we have xRy ⇔ (xSy or xT y).
(c) Assume R is transitive. Let xSy and ySz. Then xRy, yRx, yRz and zRy. Since R is transitive, the first and
third relations imply xRz, and the second and fourth imply zRx. Hence xSz, so S is transitive.
/ yRz and z Ry.
Now let xT y and yT z. We have xRy, y Rx, / By transitivity of R, the first and third relations
/
imply xRz as before. We will show z Rx by contradiction. Assume the claim is false, i.e. zRx. Since xRy and
/
R is transitive, we have zRy. But this contradicts one of our relations, hence it must be that z Rx. So xT z
and T is transitive.
To show that the reverse does not hold, we must construct some non-transitive relation R for which both S
and T are transitive. A little experimentation shows that we can take the ground set A to be {x, y, z} and
the relation R to be {(x, x), (x, y), (y, x), (y, y), (y, z)}, which is non-transitive because xRy and yRz but xRz./
Then S = {(x, x), (x, y), (y, x), (x, x)}, which can be verified to be transitive, and T = {(y, z)}, which is trivially
transitive (as long as y 6= z, there are no two ordered pairs of the form (a, b), (b, c), so the premise for the
transitivity implication never holds).

2
Exercise 4 (20 points). Powers of relations:
(a) Prove that if R is a relation on a finite set A, there exist distinct n, m ∈ N+ , such that Rn = Rm .
(b) Prove that the claim in (a) need not hold if the set A is infinite.

Solution
(a) By Definition 7.2.1, every relation on A is a subset of A × A. Since A has finite size n, the size of A × A is
n2 . (For each candidate for the first position in the ordered pair, we may pick any element of A for the second
position. It is easy to show that the pairs formed in this way are distinct.) So the number of possible relations
2
on A is |2A×A | = 2|A×A| = 2n . Now if Rn 6= Rm for every pair of distinct n, m ∈ N+ , then the sequence
R, R2 , R3 , . . . gives us an infinite number of distinct relations on A (prove by showing that f (n) = Rn is a
bijection), which contradicts our result that the number of possible relations on A is finite. Hence there must
exist at least one such pair n, m such that Rn = Rm .
(b) Consider the following relation on the infinite set N: aRb ⇔ b−a = 1. Evidently, aRk b ⇔ b−a = k (Fun exercise:
prove this). If there was a pair n, m ∈ N+ such that Rn = Rm , then for all a, b ∈ N, b − a = n ⇔ b − a = m.
This is obviously untrue unless n = m, so there are no distinct n, m that satisfy Rn = Rm .
Exercise 5 (20 points). For each of the following pairs of sets, define a bijection between the two. You can choose
which set is the domain and which is the codomain. You should state a precise rule that maps each member of the
domain to a member of the codomain. (A little drawing is not a precise rule.) Provide a brief justification why your
function is a bijection, but there is no need for a formal proof.
(a) N and Z \ N.
(b) N and Z.
(c) N and F , where F = {a ∈ Z : a ≡5 0}.
(d) N+ and Q+ , where Q+ = { ab : a, b ∈ N+ }. (For the purposes of this question, two elements a/b and c/d in Q+
are considered the same only if a = c and b = d. Thus 2/3 and 4/6 are regarded as distinct.)
For general education: An infinite set is said to be countable if it has the same cardinality as N. The solution to
the last question above can be easily extended to show that Q is countable. The set R, on the other hand, is not
countable.

Solution
(a) For n ∈ N, z ∈ (Z \ N), z = −n − 1. This maps 0 to −1, 1 to −2, etc. Both sets are infinite sequences of
integers, one starting at 0 and increasing, and the other starting at -1 and decreasing, so this function will
cover all elements of both sets. It is one-one because −n1 − 1 = −n2 − 1 implies n1 = n2 .
(b) For n ∈ N, z ∈ Z, z = −1n × d n2 e. Here dxe, known as the ceiling function, denotes the smallest integer that is
greater that or equal to x. Thus 0 is mapped to 0, 1 to −1, 2 to 1, etc. As n increases along the number line,
the values of z it maps to start at 0 and extend one step at a time in both directions along the number line, so
the function will cover all integers, each exactly once.
(c) For n ∈ N, z ∈ F , z = −1n × 5 × d n2 e. This works exactly like part (b) except moving in steps of 5 instead of
1, so it will cover all integers divisible by 5.
2
(d) For ab ∈ Q+ , set c = a + b − 1. Then the mapping from Q+ to N+ is n = c 2+c + 1 − a. Visually, this takes
the 2 × 2 grid of all a, b ∈ N+ and works across the diagonals. An example of the ordering is below (the rows
correspond to values of a, the columns correspond to b, the entries in the grid correspond to n, and the cth
diagonal has c elements):
1 2 3 4 ...
1 1 2 4 7
2 3 5 8
3 6 9
4 10
..
.

3
2
The first diagonal has 1 element, the second 2, and so on. Thus the c 2+c term is the total number of elements in
the first c diagonals, and the other parts of the mapping ensure that they are ordered along the diagonal. The
function is a bijection because all positive integers appear in the grid, each exactly once, as we wind through
the diagonals one after the other.

You might also like