Mat2612 TL 202 1 2018 B
Mat2612 TL 202 1 2018 B
Mat2612 TL 202 1 2018 B
Semester 1
BARCODE
university
Define tomorrow. of south africa
ONLY FOR SEMESTER 1 STUDENTS
ASSIGNMENT 02
Unique Nr.: 810493
Chapters 5 and 6
Fixed closing date: 4 April 2018
Solution:
(a) Since we don’t have (x, y) and (x, z) in R for y 6= z, R is a function from A to A. Informally,
no element of the domain maps to more than one element of the range.
(b) Since, for each x ∈ A there exists a y ∈ A such that (x, y) ∈ R, R is everywhere defined.
Informally, every element of A maps to something.
(c) R is not onto since there is no x ∈ A such that (x, e) ∈ R. Informally, not every element
of A is reached.
(d) Since we have (a, a) and (d, a) in R and a 6= d, the function is not−to−one. Informally,
different elements of the domain map to the same element of the range.
2
MAT2612/202/1/2018
Solution:
Now
f (x, y) = f (x0 , y 0 )
⇒ (x + y, x − y) = (x0 + y 0 , x0 − y 0 )
⇒ x+y = x0 + y 0 (1)
and x − y = x0 − y 0 (2)
2y = 2y 0 , i.e. y = y 0 .
⇔ 2x =a+b
and 2y =a−b
⇔ x = a+b
2
and y = a−b2
a+b a−b
Hence (x, y) = f −1 (a, b) = , .
2 2
Thus f −1 can be defined by
−1 x+y x−y
f (x, y) = , (changing variables)
2 2
3
Thus
(f −1 ◦ f ) (x, y) = f −1 (f (x, y))
= f −1 (x + y, x − y)
x + y + (x − y) x + y − (x − y)
= ,
2 2
2x 2y
= ,
2 2
= (x, y) .
(a) How many everywhere defined functions are there from A to B? (3)
(b) How many everywhere defined onto functions are there from A to B? (3)
(c) How many everywhere defined functions are there from B to A? (3)
(d) How many everywhere defined onto functions are there from B to A? (3)
Solution:
Let A = {a1 , a2 , a3 , a4 } and B = {b1 , b2 , b3 } .
The same holds for f (a2 ) , f (a3 ) and f (a4 ) . Hence by the product rule there are
3 × 3 × 3 × 3, i.e. 34
4
MAT2612/202/1/2018
twice you must arrange 4 objects of which 2 are of the same type and the other 2 different.
We can arrange these 4 objects in
4!
ways.
2!
See Theorem 5 and Example 10 in Section 3.2 of KBR. Hence in total there are
4!
3· different words,
2!
4!
i.e 3. everywhere defined onto functions.
2!
(c) Using reasoning similar to that in (a) it follows that there are
4 × 4 × 4 = 43
different everywhere defined functions from B to A.
(d) Suppose f is an everywhere defined onto function from B to A.
Since the number of elements of B is less than the number of elements of A and f is onto, it
follows that one of the elements of B must map onto two elements in A. Hence f cannot be
a function, which is a contradiction. Thus there are no everywhere defined onto functions
from B to A.
Solution:
5
5. Let A = {1, 2, 3, 4, 5, 6, 7, 8} . Compute the product (composition)
(3)
Solution:
(1, 4, 8) ◦ (2, 3, 5, 8) ◦ (1, 7)
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
= ◦ ◦
4 2 3 8 5 6 7 1 1 3 5 4 8 6 7 2 7 2 3 4 5 6 1 8
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
= ◦
4 2 3 8 5 6 7 1 7 3 5 4 8 6 1 2
1 2 3 4 5 6 7 8
= .
7 3 5 8 1 6 4 2
1 → 7 → 7 → 7; hence 1 → 7.
Thus we have
2 → 2 → 3 → 3; hence 2→3
3 → 3 → 5 → 5; hence 3→5
4 → 4 → 4 → 8; hence 4→8
5 → 5 → 8 → 1; hence 5→1
6 → 6 → 6 → 6; hence 6→6
7 → 1 → 1 → 4; hence 7→4
8 → 8 → 2 → 2; hence 8→2
6. Let
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
p= and q = .
6 1 4 3 5 8 2 7 4 3 2 1 8 7 6 5
6
MAT2612/202/1/2018
(3)
(h) Find a permutation h such that
1 2 3 4 5 6 7 8
p◦h= .
7 3 4 6 5 8 1 2
(4)
Solution:
(a) p (1) =6
p (2) =1
p (3) =4
p (4) =3
p (5) =5
p (6) =8
p (7) =2
p (8) =7
(b) We start at 1. It goes to 6 which goes to 8 which goes to 7 which goes to 2 which goes back to
1. So we have the cycle (1, 6, 8, 7, 2) . We then consider 3. It goes to 4 which goes back to 3.
Thus we have the cycle (3, 4) . Finally 5 maps onto itself. Thus
(c) We have
p = (1, 2) ◦ (1, 7) ◦ (1, 8) ◦ (1, 6) ◦ (3, 4) .
Note the order of the “decompostion” and the fact that (5) is not a transposition.
7
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
(e) p ◦ p = ◦
6 1 4 3 5 8 2 7 6 1 4 3 5 8 2 7
1 2 3 4 5 6 7 8
= .
8 6 3 4 5 7 1 2
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
p◦q = ◦
6 1 4 3 5 8 2 7 4 3 2 1 8 7 6 5
1 2 3 4 5 6 7 8
= .
3 4 1 6 7 2 8 5
(f) Since
p = {(1, 6) , (2, 1) , (3, 4) , (4, 3) , (5, 5) , (6, 8) , (7, 2) , (8, 7)}
we have
p−1 = {(6, 1) , (1, 2) , (4, 3) , (3, 4) , (5, 5) , (8, 6) , (2, 7) , (7, 8)}
= {(1, 2) , (2, 7) , (3, 4) , (4, 3) , (5, 5) , (6, 1) , (7, 8) , (8, 6)} .
Hence
−1 1 2 3 4 5 6 7 8
p = .
2 7 4 3 5 1 8 6
(g) We have
p = (1, 6, 8, 7, 2) ◦ (3, 4) ◦ (5) .
We note that each element in the cycle (1, 6, 8, 7, 2) maps to itself every 5 steps, e.g. 1 − 6 − 8 −
7 − 2 − 1. Also each element in (3, 4) maps to itself every 2 steps. Hence every element in
(h) Let p ◦ h = r. We want h, so we compose both sides on the left with p−1 as follows:
p−1 ◦ (p ◦ h) = p−1 ◦ r
p−1 ◦ p ◦ h = p−1 ◦ r
i.e.
i.e. h = p−1 ◦ r since p−1 ◦ p = Id .
Thus
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
h = ◦
2 7 4 3 5 1 8 6 7 3 4 6 5 8 1 2
1 2 3 4 5 6 7 8
= .
8 4 3 1 5 6 2 7
8
MAT2612/202/1/2018
7. (a) Let A = {a, b, c, d, e, f, g} . Write the following permutation as the product of disjoint
cycles.
a b c d e f g
g d b a c f e
(2)
(b) Determine whether the following permutation is even or odd.
1 2 3 4 5 6 7 8
4 2 1 6 5 8 7 3
(4)
Solution:
(a) We start at a. It goes to g which goes to e which goes to c which go b which goes to d
which goes back to a. Thus we have the cycle (a, g, e, c, b, d). Finally f maps onto itself.
Thus the permutation is equal to (a, g, e, c, b, d) ◦ (f ).
(b)
1 2 3 4 5 6 7 8
p =
4 2 1 6 5 8 7 3
Solution:
See Example 3 of Section 6.3 and the section on Hasse Diagrams in Section 6.1 of KBR.
9
(b) For divisibility a ∨ b is the least number into which both a and b divide, i.e. the Least
Common Multiple of a and b (LCM (a, b)) .
For divisibility a ∧ b is the largest number that divides into both a and b, i.e. the Greatest
Common Divisor of a and b (GCD (a, b)) .
(c) To be a complemented lattice, all elements must have complements (some may have more
than one complement).
But here not all elements have complements. Recall the definition of a complement: x
has y as complement if
x ∧ y = 1 is y = 1 or y = 7.
9. Draw the Hasse diagram of the poset represented by the following matrix. (Call the elements
a, b, c, d, e.)
1 1 1 1 1
0 1 1 1 0
0 0 1 0 1 .
0 0 0 1 0
0 0 0 0 1
(4)
Solution:
It is not surprising if you were unable to do this question using the matrix above which was
given in Tutorial Letter 101, since the matrix above does not represent a poset. Why is this
so? The matrix above does not represent a transitive relation. Suppose MR denotes the
matrix in the question. Then
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 1 0 0 1 1 1 0 0 1 1 1 1
MR2 = MR MR = 0 0 1 0 1 0 0 1 0 1 = 0 0 1 0 1 .
0 0 0 1 0 0 0 0 1 0 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
Then MR2 has a one in the 2nd row 5th column which is not in MR . Hence R is not transitive.
10
MAT2612/202/1/2018
R = {(a, a) , (a, b) , (a, c) , (a, d) , (a, e) , (b, b) , (b, c) , (b, d) , (b, e) , (c, c) , (c, e) , (d, d) , (e, e)} .
10. Draw the Hasse diagram of a partially ordered set (poset) satisfying the following:
(a) The poset contains 3 elements a, b, c and {a, b} has a least upper bound but no greatest
lower bound. (3)
(b) The poset contains 4 elements a, b, c, d and {a, b} has exactly two lower bounds but no
greatest lower bound. (3)
(c) The poset contains 4 elements a, b, c, d and {a, b} has exactly two upper bounds and a least
upper bound. (3)
Solution:
(a)
(b)
11
(c)
(a) Give each of the following. If any do not exist, explain why.
(i) All minimal elements of H. (2)
(ii) The least element of H. (1)
(iii) All maximal elements of H. (2)
(iv) The greatest element of H. (1)
(v) All upper bounds of {f, g}. (2)
(vi) The least upper bound of {f, g}. (1)
(vii) All lower bounds of {a, b}. (2)
(viii) The greatest lower bound of {a, b}. (1)
(ix) All lower bounds of {c, d, e} . (2)
(x) The greatest lower bound of {c, d, e} . (1)
(xi) Any two elements which are complements of each other. (2)
(b) Give complete reasons for answers to the following:
(i) Is H a lattice? (3)
(ii) Is H a Boolean algebra? (3)
Solution:
(a) (i) A minimal element is one that has no path downwards. The minimal element is h.
12
MAT2612/202/1/2018
(ii) The least element, if it exist, is the element with paths upwards to all others. In
this case the least element is h.
(iii) A maximal element is one that has no path upwards. The maximal elements are
a and b.
(iv) The greatest element, if it exists, is the element with paths downwards to all others.
In this case there is no greatest element. Note a and b are not comparable.
(v) Upper bounds of {f, g} are those elements (including f and g) which have paths down-
wards to both f and g. In this case they are e, b and a.
(vi) The least upper bound of {f, g} if it exists, is the upper bound of {f, g} which is less
than all other upper bounds. In this case it is e.
(vii) Lower bounds of {a, b} are those elements (including a and b) which have paths upwards
to both a and b. In this case they are d, e, f, g and h.
(viii) The greatest lower bound of {a, b} if it exists, is the lower bound of {a, b} which is
greater than the other lower bounds. In this case it does not exist because d and e
are not comparable.
(ix) Lower bounds of {c, d, e} are those elements (including c, d and e) which have paths
upwards to c, d and e. In this case they are f and h.
(x) The greatest lower bound of {c, d, e} if it exists, is the lower bound of {c, d, e} which
is greater than the other lower bounds. In this case it is f.
(xi) A complement of an element is defined for a poset only if the poset is a bounded lattice.
Thus, since the poset H is not a lattice (see (b)(i) below) the question does not make
sense.
(b)(i) H is not a lattice since not all pairs of elements have a LUB and GLB. For example,
{a, b} has no LUB.
(Also, according to Theorem 5 of Section 6.3 of KBR a finite lattice is bounded. Since
H has no greatest element, H cannot be a lattice.)
(ii) H is not a Boolean algebra because it is not a lattice.
12. Chapter dependencies of textbooks is a familiar partial ordering of the chapters in a text-
book. Define A < B if chapter A is a prerequisite for chapter B. Let C be the set of
chapters and let the prerequisites be given by
Chapter Prerequisites
Chapter 1 None
Chapter 2 Chapter 1
Chapter 3 Chapter 2
Chapter 4 Chapter 2
Chapter 5 Chapter 3
Chapter 6 Chapter 4
Chapter 7 Chapter 3,6
(a) Draw the Hasse diagram for the partial ordering of the chapters. (4)
(b) Give all the minimal and maximal elements of C. (3)
13
(c) Does C have a least element or a greatest element? If so give them. (2)
(d) Suppose you want to read the entire book, one chapter a month.
(i) Which choice or choices do you have for your first and your last chapter? (3)
(ii) You want to read chapter 6 as soon as possible. After how many months can you
begin chapter 6? (2)
(iii) Do you need to read all the other chapters before you can read chapter 7? If not,
which chapter(s) can you leave out? (2)
(iv) You want to read chapters 1, 2, 3 in order and chapter 7 last. Find all possible ways
that you could read the book. (4)
Solution:
(a)
1, 2, 3, 5, 4, 6, 7
1, 2, 3, 4, 5, 6, 7
1, 2, 3, 4, 6, 5, 7
14
MAT2612/202/1/2018
13. (a) Construct the truth table for the following Boolean function:
f (x, y, z) = (x ∧ y ∧ z) ∨ (x ∧ y 0 ∧ z) ∨ (x0 ∧ y ∧ z) .
Solution:
See 8, 9 and 12 of the properties given after Example 6 in Section 6.4 of KBR.
x y z x∧y∧z x ∧ y0 ∧ z x0 ∧ y ∧ z f (x, y, z)
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 1 0 0 0 0 0
1 0 0 0 0 0 0
0 1 1 0 0 1 1
1 0 1 0 1 0 1
1 1 0 0 0 0 0
1 1 1 1 0 0 1
Example. Consider the fifth row of the table, where
x = 0, y = 1 and z = 1. Then
x∧y∧z = 0∧1∧1 = 0∧1=0
x ∧ y0 ∧ z = 0 ∧ 0 ∧ 1 = 0 ∧ 0 = 0
and x0 ∧ y ∧ z = 1 ∧ 1 ∧ 1 = 1 ∧ 1 = 1.
Then
(x ∧ y ∧ z) ∨ (x ∧ y 0 ∧ z) ∨ (x0 ∧ y ∧ z) = 0 ∨ 0 ∨ 1 = 1.
15
(b)
f (x, y, z) = (x ∧ z) ∨ (y ∧ z) .
16