MATH1064A Semester 2 Main, 2019
The University of Sydney
School of Mathematics and Statistics
MATH1064
Discrete Mathematics for Computation
November 2019
Lecturer: Jonathan Spreer
Time Allowed: Writing - two hours; Reading - 10 minutes
Exam Conditions: This is a closed-book examination — no material permitted. Writing
is not permitted at all during reading time.
Family Name: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SID: . . . . . . . . . . . . . . . . . . . . . . . . . . .
Other Names: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Seat Number: . . . . . . . . . . . . . . . . .
Please check that your examination paper is complete (26 pages) and indicate by signing below.
I have checked the examination paper and affirm it is complete.
Signature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Date: . . . . . . . . . . . . . . . . . . . . . . . . .
Marker’s use
only
This examination has two sections: Multiple Choice and Extended Answer.
The Multiple Choice Section is worth 50% of the total examination.
There are 20 questions. The questions are of equal value.
All questions may be attempted.
Answers to the Multiple Choice questions must be entered on
the Multiple Choice Answer Sheet before the end of the examination.
The Extended Answer Section is worth 50% of the total examination.
There are 5 questions. The questions are of equal value.
All questions may be attempted. Working must be shown.
University-approved calculators may be used.
THE QUESTION PAPER MUST NOT BE REMOVED FROM THE
EXAMINATION ROOM.
Page 1 of 26
MATH1064A Semester 2 Main, 2019
Page 2 of 26
Multiple Choice Section
In each question, choose at most one option.
Your answers must be entered on the Multiple Choice Answer Sheet.
1. Let A = {1, a, b, x, y, z} and B = {1, 2, a, x, y}. Then the number of elements in A ∩ B
is
(a) 1.
(b) 2.
(c) 3.
(d) 4.
(e) 5.
(f) 6.
2. Let f : P({1, 2, 3, 4, 5, 6, 7, 8}) → N be a function defined by f (A) = |A|. Then f is
(a) surjective but not injective.
(b) neither surjective nor injective.
(c) bijective.
(d) injective but not surjective.
3. Let A = {a, {b}, {c, b}, a} be a set and let P(A) be its power set. Which one of the
following statements is true?
(a) |A| = 4
(b) b ∈ A
(d) A ⊂ {a}
(e) |A| = |P(A)|
(c) {b, c} ⊂ A
(f) P(A) ∪ {a} = P(A)
4. Let X = {1, 2, ..., 2n}. Then the cardinality of the power set |P(X)| is equal to
(a) 2n .
(b) 4n .
(c) 6n .
(d) 8n .
5. Given |A| = 10, |B| = 20, |C| = 30, |A ∩ B| = 5, |A ∩ C| = 5, |B ∩ C| = 10 and
|A ∩ B ∩ C| = 3, then |A ∪ B ∪ C| is
(a) 20.
(b) 40.
(c) 43.
(d) 57.
(e) 60.
(f) impossible to determine.
MATH1064A Semester 2 Main, 2019
Page 3 of 26
Blank page for working; it will not be marked
MATH1064A Semester 2 Main, 2019
Page 4 of 26
6. Which of the sets listed below is given by the shaded region in the following Venn
diagram?
(a) A ∪ B ∪ C
(b) (A ∪ B) ∩ C
(d) A ∪ (B ∩ C)
(c) (A ∩ B) ∪ C
(e) A ∩ (B ∪ C)
(f) A ∩ B ∩ C
7. A large jar is full of blue, red, white and black balls. You grab five of them. How many
possible outcomes are there?
� �
8
(a)
3
� �
7
(b)
2
� �
8
(d)
4
� �
7
(c)
4
(e) None of the above
8. The number of permutations of {1, 2, 3, 4, 5} is
(a) 24.
(b) 48.
(c) 72.
(d) 96.
(e) 120.
(f) none of the above.
9. An expression of parenthesis is correctly matched, if every initial segment of the expression has at least as many opening parentheses than closing parenthesis (eg. “(())()” or
“(()())” for n = 3).
What is the number of expressions containing 4 pairs of parentheses which are correctly
matched?
(a) 4
(b) 14
(c) 21
(d) 24
(e) 31
10. How many rearrangements are there of the word WOOLLOONGABBA?
� �
8
(a)
2
13!
(b)
4! · 23
� �
13
(c)
7
(d) 7! · 2!
(e) 13
7
� �
13
(f) 7! ·
2
MATH1064A Semester 2 Main, 2019
Page 5 of 26
Blank page for working; it will not be marked
MATH1064A Semester 2 Main, 2019
Page 6 of 26
11. The remainder when dividing 765432 by 9 is
(a) 0.
(b) 1.
(c) 3.
(d) 5.
(e) 7.
(f) 8.
12. Let p, q ∈ N be prime numbers, let n = pq, and let a > 1, a | n. Then we may conclude
that
(a) a � p and a � q.
(c) a | p or a | q.
(b) a | p and a | q.
(d) a � p and a | q.
13. Which one of the following functions f : Z → Z is injective?
(a) f (n) = n3 − n
(c) f (n) = 1
(b) f (n) = 2n + 8
(d) f (n) = n2 − 2
14. Which one of the following statements is not correct?
(a) 2n ∈ O(3n )
√
(c) 3n + n ∈ O(n)
(b) 7 log(n) ∈ O(1)
(d) n log(n) ∈ Ω(n)
15. Let f : N → N be defined by f (n) = n2 + 5n + 7. Which one of the following statements
is not correct.
(a) f (n) ∈ O(n3 )
(c) f (n) ∈ Ω(1)
(b) f (n) ∈ Θ(n2 )
(d) f (n) ∈ Ω(n3 )
MATH1064A Semester 2 Main, 2019
Page 7 of 26
Blank page for working; it will not be marked
MATH1064A Semester 2 Main, 2019
Page 8 of 26
16. Which one of the following propositions is a contradiction?
(a) p ∨ (q ∧ r)
(d) (p ∧ q) ∧ (¬ p ∨ ¬ q)
(b) (p → q) ∨ (¬ q ∧ q)
(e) (p ↔ r) ∨ (p ∨ ¬ q)
(c) (p → q) ∨ q
(f) p ∨ r
17. Identify the correct negation of the following quantifier statement.
∀x ∈ D : (P (x) ∧ ¬Q(x))
(a) ∃x ∈ D : (P (x) → Q(x))
(c) ∀x ∈ D, (¬P (x) ∨ ¬Q(x))
(b) ∀x ∈ D, (P (x) ∧ ¬Q(x))
(d) ∃x ∈ D : (P (x) ∨ ¬Q(x))
18. What is the expected number of times a “3” appears when a fair die is rolled 12 times?
(a) 1
(b) 2
(c) 3
(d) 4
(e) 5
(f) 6
19. What is the expected number that appears on a die biased such that 5 and 6 come up
twice as often as every other number?
(a) 1
(b) 2
(c) 3
(d) 4
(e) 5
20. The binary number (1110)2 is equal to
(a) (111)3 .
(b) (14)10 .
(c) (10)8 .
(d) all of the above.
(f) 6
MATH1064A Semester 2 Main, 2019
Page 9 of 26
Blank page for working; it will not be marked
End of Multiple Choice Section
Make sure that your answers are entered on the Multiple Choice Answer Sheet
The Extended Answer Section begins on the next page
MATH1064A Semester 2 Main, 2019
Page 10 of 26
Extended Answer Section
There are five questions in this section, some with a number of parts. Write your answers
in the space provided below each part. You must show your working and give reasons for
your answers. If you need more space there are extra pages at the end of the examination
paper.
1. (a) Write down the statement of the binomial theorem.
(b) In the expansion of (x + 1)7 , what is the coefficient of x3 ?
(Do not evaluate formulas involving exponents, factorials, binomial coefficients, etc.)
Question 1(b) continues on the next page
MATH1064A Semester 2 Main, 2019
Page 11 of 26
Question 1(b) continued
(c) How many arrangements are there of the letters of DISCM AT H containing the
word HAT ?
(Do not evaluate formulas involving exponents, factorials, binomial coefficients, etc.)
MATH1064A Semester 2 Main, 2019
Page 12 of 26
2. (a) Write down the statement of the quotient remainder theorem.
(b) Using the Euclidean algorithm, find gcd(154, 40). Show all working.
MATH1064A Semester 2 Main, 2019
Page 13 of 26
(c) Let a, b ∈ Z be two integers, a, b �= 0. Show that if a | b and b | a, then a = b or
a = −b.
MATH1064A Semester 2 Main, 2019
Page 14 of 26
3. (a) Let G = (V, T, S, P ) be the grammar with vocabulary V = {a, b, S, A, B}, start
symbol S, terminal symbols T = {a, b}, and production rules
P = {S → aA, A → aA, A → B, B → b, B → bB}.
(i )
Determine the language L(G) generated by the grammar G.
Question 3 continues on the next page
MATH1064A Semester 2 Main, 2019
Page 15 of 26
Question 3 continued
(b) Determine a context-free grammar G� that generates the language
and show that L� = L(G� ).
L� = {abn a | n ≥ 2},
MATH1064A Semester 2 Main, 2019
Page 16 of 26
4. (a) Consider the relation R on {1, 2, 3, 4}, given by
R = {(1, 1), (2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4), (4, 4)}.
For each of the following statements, determine whether the statement is true or
false. If it is true, give a brief reason (you do not need to give a formal proof). If it
is false, give a counterexample.
i)R is reflexive.
ii)R is symmetric.
iii)R is transitive.
iv)R is anti-symmetric.
Question 4 continues on the next page
MATH1064A Semester 2 Main, 2019
Page 17 of 26
Question 4 continued
(b) Which of the following graphs contain an Eulerian circuit?
(i)
(ii)
(iii)
You do not need to show your working.
(c) Let G be a graph with six vertices and with degrees 1, 2, 3, 3, 3, 4. How many edges
has G? Explain your answer.
Question 4 continues on the next page
MATH1064A Semester 2 Main, 2019
Page 18 of 26
Question 4 continued
(d) Prove that every simple graph with exactly 4 vertices and at least 4 edges must be
connected.
MATH1064A Semester 2 Main, 2019
Page 19 of 26
5. (a) Suppose that (an )n≥1 is a sequence defined by
a1 = 0 and ak = ak−1 + 2k for all k ≥ 2.
Prove that for all n ≥ 1, we have
an = n2 + n − 2.
Question 5 continues on the next page
MATH1064A Semester 2 Main, 2019
Page 20 of 26
Question 5 continued
(b) Show that it is possible to arrange the numbers 1, 2, . . . , 2k in a row such that for
any two of these numbers, their average never appears between them.
In other words, show that there exists an arrangement a1 , a2 , . . . , a2k of the numbers
1, 2, . . . , 2k such that for all pairs of numbers ai and aj , i < j, we have ak �= (ai +aj )/2
for all i < k < j. (Hint: Use induction.)
MATH1064A Semester 2 Main, 2019
Page 21 of 26
You may use the next pages for your answers
MATH1064A Semester 2 Main, 2019
Page 22 of 26
This page may be used if you need more space for your answers
MATH1064A Semester 2 Main, 2019
Page 23 of 26
This page may be used if you need more space for your answers
MATH1064A Semester 2 Main, 2019
Page 24 of 26
This page may be used if you need more space for your answers
MATH1064A Semester 2 Main, 2019
Page 25 of 26
This page may be used if you need more space for your answers
End of Extended Answer Section
MATH1064A Semester 2 Main, 2019
Page 26 of 26
Formula Page
Logic
Commutative laws:
Associative laws:
Distributive laws:
Identity laws:
p∧q ≡q∧p
p∨q ≡q∨p
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (tautology) ≡ p
p ∨ (contradiction) ≡ p
Universal bound laws: p ∨ (tautology) ≡ (tautology)
p ∧ (contradiction) ≡ (contradiction)
Negation laws:
Double negative law:
Idempotent laws:
De Morgan’s laws:
Absorption laws:
Negations:
Conditional:
p ∨ ¬p ≡ (tautology)
p ∧ ¬p ≡ (contradiction)
¬(¬p) ≡ p
p∧p≡p
p∨p≡p
¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q
p ∨ (p ∧ q) ≡ p
p ∧ (p ∨ q) ≡ p
¬(tautology) is a contradiction
¬(contradiction) is a tautology
p → q ≡ ¬p ∨ q
Grammars: Restrictions on Productions w1 → w2
Context-sensitive (type 1): w1 = lAr and w2 = lwr, where A ∈ N, l, r, w ∈ (N ∪T )�
and w �= λ; or w1 = S and w2 = λ as long as S is not
on the right-hand side of another production
Context-free (type 2):
w1 = A, where A is a nonterminal symbol
Regular (type 3):
w1 = A and w2 = aB or w2 = a, where A ∈ N, B ∈ N,
and a ∈ T ; or w1 = S and w2 = λ
Properties of logarithms
logb (xy) = logb (x) + logb (y),
logb (xa ) = a logb (x),
logc (x) =
logb (x)
logb (c)
Discrete Probability
A random variable X : S → N − {0} has geometric distribution with parameter p ∈ [0, 1] if
1−p
1
p(X = k) = (1 − p)k−1 p for each k ∈ N − {0}. In this case E(X) = and V (X) =
.
p
p2
Bayes’ theorem: p(F | E) =
p(F )
· p(E | F )
p(E | F ) · p(F ) + p(E | F ) · p(F )
End of Examination
MATH1064B Semester 2 Main, 2019
Multiple Choice Answer Sheet
Write your
SID here −→
The University of Sydney
School of Mathematics and
Statistics
MATH1064 Discrete
Mathematics for Computation
Code your
SID into
the columns
below each
digit, by
filling in the
appropriate
oval.
0
1
2
3
4
5
6
7
8
9
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁✂ ✁
0
1
2
3
4
5
6
7
8
9
Family Name: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Other Names: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Seat Number: . . . . . . . . . . . . . . . . .
Answers −→
Q1
Q2
Q3
Attempt every question.
You will not be awarded
negative marks for
incorrect answers.
Q4
Q5
Q6
Q7
Fill in exactly one oval per
question.
If you make a mistake,
draw a cross (X) through
any mistakenly filled in
oval(s) and then fill in your
intended oval.
Q8
Q9
Q10
a b c d
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
An answer which contains
two or more filled in (and
uncrossed) ovals will be
awarded no marks.
This is the first and last page of this answer sheet
Q11
Q12
Q13
Q14
Q15
Q16
Q17
Q18
Q19
Q20
a b c d
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁
✄ �✄ �✄ �✄ �
✂ ✁✂ ✁✂ ✁✂ ✁