100% found this document useful (1 vote)
192 views11 pages

CS1231 Mockmidterm Complete

This document is the instructions for a mock midterm test for the course CS1231 Discrete Structures at the National University of Singapore. It contains 19 multiple choice questions testing concepts like logic, proofs by mathematical induction, number bases, and solving linear equations. Students have 2 hours to complete the open book, non-graded assessment. They are allowed to use approved calculators and do not need to submit their answers.

Uploaded by

Robert Fisher
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
100% found this document useful (1 vote)
192 views11 pages

CS1231 Mockmidterm Complete

This document is the instructions for a mock midterm test for the course CS1231 Discrete Structures at the National University of Singapore. It contains 19 multiple choice questions testing concepts like logic, proofs by mathematical induction, number bases, and solving linear equations. Students have 2 hours to complete the open book, non-graded assessment. They are allowed to use approved calculators and do not need to submit their answers.

Uploaded by

Robert Fisher
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/ 11

NATIONAL UNIVERSITY OF SINGAPORE

CS1231 - DISCRETE STRUCTURES

(Semester 1: AY2018/19)

Mock Midterm Test

Time Allowed: 2 Hours

INSTRUCTIONS TO CANDIDATES

1. This assessment paper contains NINETEEN (19) questions in TWO (2) parts and
comprises ELEVEN (11) printed pages, including this page.
2. Answer ALL questions.
3. This is an OPEN BOOK, NON-GRADED, MOCK assessment.
4. You are allowed to use NUS APPROVED CALCULATORS.
5. You do not need to submit anything. You may keep this question paper.
CS1231 Discrete Structures Mock Midterm Test - Page 2 of 11 29/9/2018

CS1231 Discrete Structures Name:


AY2018/2019 Semester 1
Mock Midterm Test
29/9/2018
Time Limit: 2 Hours
Total score: 50 marks

Part I
(30 marks) Multiple choice questions.
Q1. (2 marks) On the fabled Island of Knights and Knaves, you meet three persons Aiken, Dueet, and Kenyu.
Knights always tell the truth, and knaves always lie. Given the following conversation, can you determine for
sure who are knights and who are knaves?
Aiken: Dueet is a knave.
Dueet: Between Kenyu and myself, exactly one is a knave.
Kenyu: Between Aiken and myself, exactly one is a knight.
A. Aiken is a knave, Dueet is a knight, Kenyu is a knave.
B. Aiken is a knight, Dueet is a knave, Kenyu is a knave.
C. Aiken is a knight, Dueet is a knave, Kenyu is a knight.
D. It is not possible to determine for sure.
E. None of the above.
Q2. (2 marks) Which of the following is the contrapositive of the statement:
“If a and b are both even, then a + b is even.”?
A. If a or b is odd, then a + b is even.
B. If a + b is odd, then a and b are both odd.
C. If a + b is odd, then a or b is odd.
D. If a + b is even, then a and b are both even.
E. None of the above.

Q3. (2 marks) Which of the following statements is false?


A. (x → y) → x ≡ x.
B. (x → y) ∧ (x → z) ≡ x → (y ∧ z).
C. x ∨ (y ∧ z) ≡ (x ∨ z) ∧ y.
D. (x ∧ y) → (x ∨ z) ≡ true.
E. None of the above.
CS1231 Discrete Structures Mock Midterm Test - Page 3 of 11 29/9/2018

Q4. (2 marks) Consider the following argument:


If Alec Fraser-Brunner is British, then the Merlion is in the United Kingdom.
Alec Fraser-Brunner is British.
Therefore, the Merlion is in the United Kingdom (by Modus Ponens).
How can this argument be reconciled with the fact that the Merlion is in Singapore?
A. The conclusion is nonsensical because the argument is neither valid nor sound.
B. The conclusion is nonsensical because the argument is sound, but not valid.
C. The conclusion is nonsensical because the argument is valid, but not sound.
D. The Merlion is actually not in Singapore, but is in the United Kingdom, as this argument shows.
E. None of the above.
Q5. (2 marks) Consider the domain of discourse to be the non-empty set of all fruits, and define the following
predicates:
Yellow(x) means “x is yellow.”
Banana(x) means “x is a banana.”
African(x) means “x is native to Africa.”
Which of the following English statements is correctly written in terms of logical statements?
A. No fruits are yellow.
∀x, Yellow(x) → ∼x.
B. Some yellow fruits are not bananas.
∃x such that Yellow(x) → ∼Banana(x).
C. No bananas are native to Africa.
∀x, African(x) ∨ ∼Banana(x).
D. All fruits native to Africa are either yellow or bananas.
∀x, African(x) ↔ (Yellow(x) ∨ Banana(x)).
E. None of the above.
Q6. (2 marks) Which of the following statements are true for all sets G and predicates P on G?
I. ∀x ∈ G, P (x) ∧ ∼P (x).
II. ∀x ∈ G, P (x) ∨ ∼P (x).
III. (∃x ∈ G such that P (x)) ∧ (∃x ∈ G such that ∼P (x)).
IV. (∃x ∈ G such that P (x)) ∨ (∃x ∈ G such that ∼P (x)).
A. II only.
B. IV only.
C. I and IV only.
D. II and IV only.
E. None of the above.
CS1231 Discrete Structures Mock Midterm Test - Page 4 of 11 29/9/2018

The next two questions (Q7 to Q8) refer to the following scenario.
I.M. Smart tries to prove the statement:
For all integers n ≥ 6, it is always possible to divide a unit square into n smaller squares
(not necessarily of the same size).
Proof (by ?).
1. For all integers n ≥ 6, let P (n) be “There is a way to divide a unit square into n smaller
squares.”
2. Base cases: n = 6, 7.
2.1. By construction, we can divide the unit square into 6 and 7 squares:

2.2. Therefore, P (6) and P (7) are both true.


3. Inductive step: For any integer k ≥ 8:
3.1. Assume P (a) is true for all 6 ≤ a ≤ k.
3.2. Consider the k + 1 case:
3.3. Take any unit square.
3.4. Since k ≥ 8, 6 ≤ k − 2 (by basic algebra).
3.5. Also, k − 2 ≤ k.
3.6. So P (k − 2) is true (by Line 3.1.).
3.7. So we can divide the unit square into k − 2 smaller squares
(by definition of P (k − 2)).
3.8. There is at least one square (since k ≥ 6).
3.9. Thus, we can pick a square and divide it into four smaller squares by drawing one vertical
and one horizontal line intersecting at the center of the square.
3.10. The unit square will now have k − 2 + 4 − 1 = k + 1 squares
(since four new squares are created, but the original square disappears).
3.11. So we found a way to divide the unit square into k + 1 smaller squares.
3.12. So P (k + 1) is true.
4. So by ?, the statement is true. 
CS1231 Discrete Structures Mock Midterm Test - Page 5 of 11 29/9/2018

Q7. (2 marks) Which of the following best fits into both occurrences of the ? above?
A. Assumption
B. Contradiction
C. Mathematical Induction
D. Strong Induction
E. Obviousness
Q8. (2 marks) Which statement below best describes Smart’s proof?
A. The proof is essentially correct.
B. The proof is invalid, because it uses pictures.
C. The proof is invalid, because the base cases are incomplete.
D. The proof is invalid, because it assumes on Line 3.1. that P (a) is true for all 6 ≤ a ≤ k, but we are
only allowed to assume that P (k) is true.
E. The proof is invalid, because it starts by considering a division of k − 2 squares and works up to a
division of k + 1 squares, but we cannot start with a unit square divided into a different number of
squares to prove a statement concerning a unit square divided into a larger number of squares.
Q9. (2 marks) Which of the following statements is true?
A. If p is a prime number, then p2 + 1 is never prime.
B. If n ∈ Z+ has sum of digits equal to 3, then n is never prime.
C. If an odd prime number p is converted from decimal to binary, and the resulting binary number is
read as a decimal number n, then n is always prime.
D. If p1 , p2 , p3 , . . . , pn are consecutive primes with n ∈ Z+ and p1 = 2, then (p1 · p2 · p3 · . . . · pn ) + 1 is
always prime.
E. None of the above.

Q10. (2 marks) Which of the following “extensions” of theorems or propositions discussed in this module so far is
actually true?
A. Theorem 4.3.2 (Well Ordering Principle) on the Rationals.
If a non-empty set S ⊆ Q has a lower bound, then S has a least element.
(Recall that Q is the set of all rational numbers.)
B. Theorem 4.4.1 (Quotient-Remainder Theorem) on Arbitrary Ranges.
Given any integers a, c and any positive integer b, there exist unique integers q and r such that
a = bq + r and c ≤ r < b + c.
C. Proposition 4.5.2 (Existence of gcd) on Zeros.
For any integers a, b, their gcd exists and is unique.
D. Converse of Theorem 4.5.3 (Bézout’s Identity).
Let a, b be integers, both nonzero, and d be an integer such that there exist integers x, y such that:
ax + by = d. Then gcd(a, b) = d.
E. None of the above.
CS1231 Discrete Structures Mock Midterm Test - Page 6 of 11 29/9/2018

Q11. (2 marks) (ABCD)16 + (EDCB)16 =


A. (FFFF)16
B. (17776)16
C. (18887)16
D. (104856)16
E. None of the above.
Q12. (2 marks) What is the value of
1231
X
(39)b
b=10

if (39)b means 39 is interpreted in base b?


A. 2285721
B. 2285742
C. 2285751
D. 2285886
E. None of the above.
Q13. (2 marks) Which of the following equations have solutions in integers x, y?
I. 6x + 15y = 51
II. 44x + 66y = 100
III. 27x + 29y = 1231
IV. 12x + 31y = 2040
A. I and II only.
B. II and IV only.
C. I, II and IV only.
D. I, III and IV only.
E. None of the above.
Q14. (2 marks) Which of the following numbers is divisible by (11)2 ?
A. (1001001001001)2
B. (1010101010101)2
C. (1011011101111)2
D. (1101011001111)2
E. None of the above.
CS1231 Discrete Structures Mock Midterm Test - Page 7 of 11 29/9/2018

Q15. (2 marks) Prof. Aaron was preparing a question for the midterm, when he accidentally spilled coffee onto
the test paper. Now the question looks like:
Find any x ∈ Z+ such that 30303x ≡ 123## (mod 77553).
A # represents a single digit which had coffee spilled on it.
Unfortunately, Prof. Aaron doesn’t remember the two digits which now cannot be read. However, he remembers
that the original question had exactly one solution x that satisfied x ≤ 1200.
With only the given information, which of the following can definitely be concluded about x?
A. 1 ≤ x ≤ 300.
B. 301 ≤ x ≤ 600.
C. 601 ≤ x ≤ 900.
D. 901 ≤ x ≤ 1200.
E. None of the above.
CS1231 Discrete Structures Mock Midterm Test - Page 8 of 11 29/9/2018

Part II
(20 marks) Structured questions.
Q16. (4 marks) Theorem 2.1.1 (Epp) is given below. Given any statement variables p, q, r, the following logical
equivalences hold.

1. Commutative laws: p∧q ≡q∧p p∨q ≡q∨p


2. Associative laws: (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) (p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
3. Distributive laws: p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
4. Identity laws: p ∧ true ≡ p p ∨ false ≡ p
5. Negation laws: p ∨ ∼p ≡ true p ∧ ∼p ≡ false
6. Double negative law: ∼(∼p) ≡ p
7. Idempotent laws: p∧p≡p p∨p≡p
8. Universal bound laws: p ∨ true ≡ true p ∧ false ≡ false
9. De Morgan’s laws: ∼(p ∧ q) ≡ ∼p ∨ ∼q ∼(p ∨ q) ≡ ∼p ∧ ∼q
10. Absorption laws: p ∨ (p ∧ q) ≡ p p ∧ (p ∨ q) ≡ p
11. Negations of true/ false: ∼true ≡ false ∼false ≡ true

In addition to the above, for simplicity, you may use the commutative form of the equivalences whenever
appropriate without citing the commutative law. For example, you may write ∼p ∨ p ≡ true instead of adding
an additional step such as ∼p ∨ p ≡ p ∨ ∼p ≡ true.
Using these rules, derive the simplest statement (in terms of number of instances of statement variables) that
is logically equivalent to

(p ∨ (∼p ∧ q)) ∨ (∼q ∨ (p ∧ ∼r))

Apply only one law for each step of your simplification, and state the law used. Please leave a blank line
between steps. Do not use Truth Tables.
Your solution should not contain more than 10 steps, or full credit will not be given.
CS1231 Discrete Structures Mock Midterm Test - Page 9 of 11 29/9/2018

Q17. (4 marks) Consider the domain of discourse to be the non-empty set of all vegetables, and define the following
predicates:
Vitamin(x) means “x is a good source of vitamin A.”
SameFamily(x, y) means “x and y are in the same vegetable family.”
SameColor(x, y) means “x and y have the same color.”

For simplicity, assume that every vegetable is in exactly one family and has exactly one color.
Write the following English statements in terms of logical statements, using only the predicates defined above.
Do not define any new predicates. You may omit the domain of discourse from your statements.
Of course, you may use x = y and x 6= y to mean “x and y are the same vegetable” and “x and y are different
vegetables”, respectively.
(a) (1 mark) There is at least one vegetable which is a good source of vitamin A.
(b) (1 mark) All vegetables which are good sources of vitamin A are in the same family as Carrot.
(c) (2 marks) There are exactly two different vegetables in any vegetable family which are the same color.
CS1231 Discrete Structures Mock Midterm Test - Page 10 of 11 29/9/2018

Q18. (5 marks) A group of n ≥ 2 badminton players play a round-robin tournament (everyone plays against
everyone else exactly once). Every game ends in one player defeating the other, so ties are impossible.
Show that it is always possible to label all the players p1 , p2 , . . . , pn , such that ∀i ∈ Z+ , if i ≤ n − 1, pi defeated
pi+1 in the game played between them.
CS1231 Discrete Structures Mock Midterm Test - Page 11 of 11 29/9/2018

Q19. (7 marks) Call a positive integer awesome if it has exactly 3 positive divisors.
(a) (2 marks) Find the number of awesome positive integers less than 1231.
(b) (5 marks) Show that, ∀n ∈ Z+ , if the decimal representation of n ends in a 1 or a 7, then n cannot be
expressed as the sum of exactly two awesome positive integers.
For your convenience, you can use, without proving, the following facts:
I. The last digit in the decimal representation of a non-negative integer n is equal to n mod 10.
II. An integer is odd if and only if its decimal representation ends in an odd number (and likewise for
even).
III. ∀a, b ∈ Z and m ∈ Z+ , (a + b) mod m = [(a mod m) + (b mod m)] mod m.

END OF MOCK MIDTERM TEST


Best of luck for your midterm test!

You might also like