0% found this document useful (0 votes)
73 views10 pages

cs1231s Exam21s1 Qns

This document provides instructions for a discrete structures assessment with 24 multiple choice and multiple response questions worth a total of 100 marks. The assessment is divided into 3 parts: Part A contains 12 multiple choice questions worth 2 marks each; Part B contains 7 multiple response questions worth 3 marks each; Part C contains 5 questions worth between 4-20 marks each. The assessment is open book and calculators are allowed. Students must write their answers on the provided answer sheets and are given 2 hours to complete the assessment.

Uploaded by

mig foo
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)
73 views10 pages

cs1231s Exam21s1 Qns

This document provides instructions for a discrete structures assessment with 24 multiple choice and multiple response questions worth a total of 100 marks. The assessment is divided into 3 parts: Part A contains 12 multiple choice questions worth 2 marks each; Part B contains 7 multiple response questions worth 3 marks each; Part C contains 5 questions worth between 4-20 marks each. The assessment is open book and calculators are allowed. Students must write their answers on the provided answer sheets and are given 2 hours to complete the assessment.

Uploaded by

mig foo
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/ 10

CS1231S

NATIONAL UNIVERSITY OF SINGAPORE

CS1231S – DISCRETE STRUCTURES


(Semester 1: AY2021/22)

Time Allowed: 2 Hours

INSTRUCTIONS
1. This assessment paper contains TWENTY FOUR (24) questions in THREE (3) parts and comprises
TEN (10) printed pages.
2. This is an OPEN BOOK assessment.
3. Printed/written materials are allowed. Apart from calculators, electronic devices are not
allowed.
4. Answer ALL questions and write your answers only on the ANSWER SHEETS provided.
5. Do not write your name on the ANSWER SHEETS.
6. The maximum mark of this assessment is 100.

Question Max. mark


Part A: Q1 – 12 24
Part B: Q13 – 19 21
Part C: Q20 4
Part C: Q21 4
Part C: Q22 7
Part C: Q23 20
Part C: Q24 20
Total 100

——— END OF INSTRUCTIONS ———


CS1231S
Part A: Multiple Choice Questions [Total: 12×2 = 24 marks]
Each multiple choice question (MCQ) is worth TWO marks and has exactly one correct answer.

1. Which of the following statements is true about the Monty Hall game that was shown in class?
A. There is a better chance of winning the car if the player sticks to her original guess.
B. There is a better chance of winning the car if the player changes her mind.
C. There is no difference whether the player sticks to her original guess or changes her mind.
D. None of (A), (B), (C) is true.

2. Which of the following is not a method of proof?


A. Recursion.
B. Strong Mathematical Induction.
C. Structural Induction.
D. None of the above.

3. Which of the following is/are true?


(i) To prove that ∀𝑛 ∈ ℤ⩾1 𝑃(𝑛) is true, where each 𝑃(𝑛) is a proposition, it suffices to
• show that 𝑃(1) is true; and
• show that ∀𝑘 ∈ ℤ⩾1 (𝑃(𝑘) ⇒ 𝑃(2𝑘) ∧ 𝑃(2𝑘 + 1)) is true.
(ii) To prove that ∀𝑛 ∈ ℤ⩾1 𝑃(𝑛) is true, where each 𝑃(𝑛) is a proposition, it suffices to
• show that 𝑃(1) is true; and
• show that ∀𝑘 ∈ ℤ⩾1 (𝑃(𝑘) ⇒ 𝑃(2𝑘) ∧ 𝑃(𝑘 + 3)) is true.
A. (i) and (ii) are both true.
B. (i) is true but (ii) is not.
C. (ii) is true but (i) is not.
D. (i) and (ii) are both not true.

- 2 of 10 -
CS1231S
4. It is a fact that 𝑛 ⩽ 𝑛3 for all 𝑛 ∈ ℤ+ . From this fact, one can derive that
∀𝑛 ∈ ℤ+ ∃𝑚 ∈ ℤ+ (𝑚 − 1)3 < 𝑛 ⩽ 𝑚3 .
Which of the following enables one to do this easily?
A. The Pigeonhole Principle.
B. The Well-Ordering Principle.
C. The Inclusion–Exclusion Principle.
D. A diagonalization proof.
E. None of the above.

5. Let 𝑓: ℚ → ℚ satisfying 𝑓(𝑥) = 𝑥 2 for all 𝑥 ∈ ℚ. Which of the following statements is/are true?
(i) 𝑓(𝑋1 ∩ 𝑋2 ) = 𝑓(𝑋1 ) ∩ 𝑓(𝑋2 ) for all 𝑋1 , 𝑋2 ⊆ ℚ.
(ii) 𝑓 −1 (𝑌1 ∩ 𝑌2 ) = 𝑓 −1 (𝑌1 ) ∩ 𝑓 −1 (𝑌2 ) for all 𝑌1 , 𝑌2 ⊆ ℚ.
A. (i) and (ii) are both true.
B. (i) is true but (ii) is not.
C. (ii) is true but (i) is not.
D. (i) and (ii) are both not true.

6. Recall from Tutorial 5 Question 3 that the graph of a function 𝑓: 𝐴 → 𝐴 is defined to be


{(𝑥, 𝑓(𝑥)) ∶ 𝑥 ∈ 𝐴}.
Here is an arrow diagram for the graph of a function 𝑓: 𝐴 → 𝐴, viewed as a relation on 𝐴.

Which of the following statements is true?


A. 𝑓 is surjective and injective.
B. 𝑓 is surjective but not injective.
C. 𝑓 is injective but not surjective.
D. 𝑓 is not surjective and not injective.

7. Recall the definition of the graph of a function from Question 6. Here is an arrow diagram for the
graph of a function 𝑔: 𝐴 → 𝐴, viewed as a relation on 𝐴.

Which of the following statements is true?


A. 𝑔 is surjective and injective.
B. 𝑔 is surjective but not injective.
C. 𝑔 is injective but not surjective.
D. 𝑔 is not surjective and not injective.

- 3 of 10 -
CS1231S

8. A bijection 𝑓: 𝐴 → 𝐴 is said to have finite order if there is 𝑘 ∈ ℤ+ such that


𝑓 ∘ 𝑓 ∘ ⋯ ∘ 𝑓 = id𝐴 .

𝑘‐many 𝑓’s

Which of the following statements is/are true?


(i) For all sets 𝐴, if 𝑓: 𝐴 → 𝐴 that has finite order, then 𝑓 −1 also has finite order.
(ii) For all sets 𝐴, if 𝑓, 𝑔: 𝐴 → 𝐴 that have finite order, then 𝑔 ∘ 𝑓 also has finite order.
A. (i) and (ii) are both true.
B. (i) is true but (ii) is not.
C. (ii) is true but (i) is not.
D. (i) and (ii) are both not true.

9. Which of the following statements is/are true?


(i) For all finite sets 𝐴 and 𝐵, if there is an injection 𝐴 → 𝐵 that is not surjective, then |𝐴| < |𝐵|.
(ii) For all finite sets 𝐴 and 𝐵, if there is a surjection 𝐴 → 𝐵 that is not injective, then |𝐴| > |𝐵|.
A. (i) and (ii) are both true.
B. (i) is true but (ii) is not.
C. (ii) is true but (i) is not.
D. (i) and (ii) are both not true.

10. Which of the following statements is/are true?


(i) Two infinite sets 𝐴 and 𝐵 have the same cardinality if and only if the set of all bijections 𝐴 →
𝐵 is nonempty.
(ii) Two infinite sets 𝐴 and 𝐵 have the same cardinality if and only if the set of all bijections 𝐴 →
𝐵 is uncountable.
A. (i) and (ii) are both true.
B. (i) is true but (ii) is not.
C. (ii) is true but (i) is not.
D. (i) and (ii) are both not true.

11. There are 2 enemies in a group of 15 people. In how many ways can this group be seated around
a circular conference table so that the enemies are never seated together? Note that the seats
are not numbered.
A. (13
2
)
B. (14
2
)
15!
C.
2
D. 14!
E. 12 × 13!

- 4 of 10 -
CS1231S

12. Which of the following statements is true about the complement graph of a bipartite graph?
A. The complement graph of a bipartite graph is also a bipartite graph.
B. The complement graph of a bipartite graph is a connected graph.
C. The complement graph of a bipartite graph contains two connected components.
D. The complement graph of a bipartite graph always contains a cycle.
E. None of the above.

Part B: Multiple Response Questions [Total: 7×3 = 21 marks]


Each multiple response question (MRQ) is worth THREE marks and may have one answer or multiple
answers. Write out all correct answers. For example, if you think that A, B, C are the correct answers,
write A, B, C.
Only if you get all the answers correct will you be awarded three marks. No partial credit will be given
for partially correct answers.

13. Define a set 𝑆 recursively as follows.


(1) {𝑥 ∈ ℤ ∶ 𝑚 ⩽ 𝑥 ⩽ 𝑛} ∈ 𝑆 for all 𝑚, 𝑛 ∈ ℤ. (base clause)
(2) If 𝑋, 𝑌 ∈ 𝑆, then 𝑋 ∩ 𝑌 ∈ 𝑆 and 𝑋 ∪ 𝑌 ∈ 𝑆 and ℤ ∖ 𝑋 ∈ 𝑆. (recursion clause)
(3) Membership for 𝑆 can always be demonstrated by (finitely many) successive applications of
clauses above. (minimality clause)
Which of the following statements is/are true?
A. {1,2,3} ∈ 𝑆.
B. All finite subsets of ℤ are elements of 𝑆.
C. {2𝑥 ∶ 𝑥 ∈ ℤ} ∈ 𝑆.
D. No infinite subset of ℤ is an element of 𝑆.
E. None of the above.

14. Recall that {s, u}∗ denotes the set of all strings over {s, u}. Define 𝑓: {s, u}∗ → {s, u}∗ by setting
𝑓(𝜎) to be the result of removing all the occurrences of u in 𝜎, for all 𝜎 ∈ {s, u}∗ . Which of the
following statements is/are true?
A. The domain of 𝑓 is equal to the codomain of 𝑓.
B. The range of 𝑓 is equal to the codomain of 𝑓.
C. 𝑓 −1 exists as a function.
D. 𝑓 ∘ 𝑓 = 𝑓.
E. None of the above.

- 5 of 10 -
CS1231S
15. Define Bool = {𝐭𝐫𝐮𝐞, 𝐟𝐚𝐥𝐬𝐞} and 𝑓: Bool3 → Bool by setting, for all 𝑝, 𝑞, 𝑟 ∈ Bool,
𝑓(𝑝, 𝑞, 𝑟) = (𝑝 ∧ 𝑞) ∨ ~𝑟.
Which of the following statements is/are true?
A. The function 𝑓 is surjective.
B. The function 𝑓 is injective.
C. For all 𝑞, 𝑟 ∈ Bool, if 𝑓(𝐟𝐚𝐥𝐬𝐞, 𝑞, 𝑟) = 𝐭𝐫𝐮𝐞, then 𝑓(𝐭𝐫𝐮𝐞, 𝑞, 𝑟) = 𝐭𝐫𝐮𝐞.
D. For all 𝑝, 𝑞 ∈ Bool, if 𝑓(𝑝, 𝑞, 𝐟𝐚𝐥𝐬𝐞) = 𝐭𝐫𝐮𝐞, then 𝑓(𝑝, 𝑞, 𝐭𝐫𝐮𝐞) = 𝐭𝐫𝐮𝐞.
E. None of the above.

16. Define 𝑓: ℤ⩾2 → ℤ⩾2 by setting, for all 𝑚 ∈ ℤ⩾2 ,


5𝑛 + 1, if 𝑚 = 5𝑛+1 where 𝑛 ∈ ℤ⩾0 ;
𝑓(𝑚) = {
𝑚 + 1, if 𝑚 ≠ 5𝑛+1 for any 𝑛 ∈ ℤ⩾0 .
Which of the following statements is/are true?
A. The function 𝑓 is well defined.
B. The function 𝑓 is surjective.
C. The function 𝑓 is injective.
D. For no 𝑘 ∈ ℤ+ does one have 𝑓 ⏟∘ 𝑓 ∘ ⋯ ∘ 𝑓 = idℤ⩾2 .
𝑘‐many 𝑓’s
E. None of the above.

17. For 𝑓, 𝑔: ℤ⩾0 → ℤ⩾0 , we write 𝑓 ⩽∗ 𝑔 for


∃𝑚 ∈ ℤ⩾0 ∀𝑛 ∈ ℤ⩾𝑚 𝑓(𝑛) ⩽ 𝑔(𝑛).
Let us call a set 𝒟 a domset if
(i) all the elements of 𝒟 are functions ℤ⩾0 → ℤ⩾0 ; and
(ii) for every 𝑓: ℤ⩾0 → ℤ⩾0 , there exists 𝑔 ∈ 𝒟 such that 𝑓 ⩽∗ 𝑔.
Which of the following statements is/are true?
A. If 𝑓, 𝑔: ℤ⩾0 → ℤ⩾0 satisfying 𝑓(𝑛) = 2𝑛 and 𝑔(𝑛) = 𝑛! for all 𝑛 ∈ ℤ⩾0 , then 𝑓 ⩽∗ 𝑔.
B. Domsets exist.
C. All domsets are uncountable.
D. Some domsets are countable, and some domsets are uncountable.
E. None of the above.

18. Given two events 𝐴 and 𝐵, such that 𝐴 ⊊ 𝐵 (i.e. 𝐴 is a proper subset of 𝐵); which of the following
statements must be true? (Note: 𝑃(𝐸) denotes the probability of an event 𝐸 occurring.)
A. 𝑃(𝐴) ≤ 𝑃(𝐵)
B. 𝑃(𝐴) ≥ 𝑃(𝐵)
C. 𝑃(𝐴̅) ≤ 𝑃(𝐵̅)
D. 𝑃(𝐴̅) ≥ 𝑃(𝐵̅)
E. None of the above.

- 6 of 10 -
CS1231S

19. Consider the following statements regarding an undirected graph 𝐺.


I. 𝐺 contains an even number of even degree vertices.
II. 𝐺 contains an odd number of even degree vertices.
III. 𝐺 contains an even number of odd degree vertices.
IV. 𝐺 contains an odd number of odd degree vertices.
Which of the following options are true?
A. Statements I, II, III and IV are true for any undirected connected graph 𝐺.
B. Statement IV is false for any undirected graph 𝐺.
C. Statement IV is true only if 𝐺 is disconnected.
D. If statements I and III are true, then 𝐺 contains an Eulerian circuit.
E. If 𝐺 contains an Eulerian circuit, then statement III is true.

Part C: There are 5 questions in this part [Total: 55 marks]


20. Define a sequence 𝑎1 , 𝑎2 , 𝑎3 , … recursively by setting, for each 𝑛 ∈ ℤ⩾1 ,
(𝑛 + 1)(𝑛 + 2)(𝑛 + 3)(𝑛 + 4)
𝑎1 = 1 and 𝑎𝑛+1 = 𝑎𝑛 + .
4!
Prove by induction that, for every 𝑛 ∈ ℤ⩾1 ,
(𝑛 + 4)!
𝑎𝑛 = .
5! (𝑛 − 1)!
[4 marks]

21. Let 𝑓: 𝐴 → 𝐴 such that 𝑋 ⊆ 𝑓(𝑋) for all 𝑋 ⊆ 𝐴. Prove that 𝑓 = id𝐴 , the identity function on 𝐴.
[4 marks]

22. [total 7 marks]


(a) Must |𝐴1 ∪ 𝐴2 | ≠ |𝐵1 ∪ 𝐵2 | if 𝐴1 , 𝐴2 , 𝐵1 are uncountable sets and 𝐵2 is a countable set?
Prove that your answer is correct. [4 marks]
(b) Must |𝐶1 × 𝐶2 | = |𝐷1 × 𝐷2 | if 𝐶1 , 𝐶2 , 𝐷1 and 𝐷2 are all countable sets?
Prove that your answer is correct. [3 marks]

- 7 of 10 -
CS1231S
23. Counting and Probability [Total: 20 marks]
Note that you need not show your working for parts (a) to (d).

(a) You have $50,000 that you can use for investment. You are recommended 4 properties to invest
in. Each investment must be in multiples of $1000.
(i) How many different investment strategies are possible if you invest $50,000 in total?
[2 marks]
(ii) How many different investment strategies are possible if you need not invest the entire
amount of $50,000? [2 marks]

(b) A car manufacturer has 3 factories 𝐴, 𝐵 and 𝐶 producing 25%, 35% and 40% of all cars
respectively. The percentages of defective cars produced by factories 𝐴, 𝐵 and 𝐶 are 5%, 4% and
2% respectively.
(i) What is the probability that a car produced by the manufacturer is defective?
[2 marks]
(ii) You, as a customer, received a defective car. What is the probability that this car was
manufactured in factory 𝐵? [2 marks]
Write your answers in 3 significant figures.

(c) On returning home after today’s exam, you realized that you had lost your student card. The
probability that you left it in the exam hall is 60%, while the probability that you left it at the bus
stop is 20%. Having not found your card in the exam hall, what is the probability of finding it at
the bus stop? You may assume in your calculations that no one moved any lost properties at the
exam hall and at the bus stop. [3 marks]

(d) Each student of CS1231S submitted a 2-page report in Discrete Math. We have observed the
following pattern of errors. The probability of finding an error on the first page is 9%. If we find
errors on page 1, the probability of finding an error on page 2 jumps to 25%; but the probability
of finding an error on page 2 is 5% if page 1 has no errors. On average, how many pages of a report
will have errors?
Write your answer in 3 significant figures. [3 marks]

(e) Let 𝐴 be an event with probability 𝑝. We say that 𝐼 is an indicator variable for the event 𝐴 if
1 𝑖𝑓 𝐴 occurs
𝐼={
0 𝑖𝑓 𝐴̅ occurs
Find 𝐸[𝐼], the expected value of 𝐼. Show your working. [3 marks]

(f) Show that given any 5 distinct non-negative integers, two of them have a difference that is
divisible by 4. Explain your answer clearly. [3 marks]

- 8 of 10 -
CS1231S
24. Graphs and Trees [Total: 20 marks]
(a) Draw all non-isomorphic spanning trees of the following graph. [3 marks]

(b) Aiken defines his own versions of the binary tree traversals. In his versions, one visits the right
subtree before traversing the left subtree. Therefore, his pre-order traversal is root, right subtree,
left subtree, and his post-order traversal is right subtree, left subtree, root. A particular binary
tree has the following pre-order traversal and post-order traversal according to Aiken’s versions:
Pre-order: U C A N D O I T 
Post-order: A D N C T I  O U
Draw (clearly!) one example of such a binary tree. There is more than one solution. You need to
provide only one. No mark will be awarded if you draw more than one binary tree. [3 marks]

(c) A function 𝑓: 𝐴 → 𝐴 can be represented by a directed graph 𝐺(𝐴, 𝐸) where 𝐸 = { (𝑢, 𝑣) ∈


𝐴 × 𝐴 ∶ 𝑓(𝑢) = 𝑣 }.
Let 𝑑𝑒𝑔− (𝑣) and 𝑑𝑒𝑔+ (𝑣) denote the indegree and outdegree of vertex 𝑣 respectively.
(i) Using the notation of indegree and outdegree above, define the following predicates:
𝐼𝑠𝐹𝑢𝑛𝑐𝑡𝑖𝑜𝑛(𝐺): the graph 𝐺 represents a function;
𝐼𝑠𝑆𝑢𝑟𝑗𝑒𝑐𝑡𝑖𝑣𝑒(𝐺): the graph 𝐺 represents a surjective function;
𝐼𝑠𝐼𝑛𝑗𝑒𝑐𝑡𝑖𝑣𝑒(𝐺): the graph 𝐺 represents an injective function.
[3 marks]
(ii) Draw all non-isomorphic loopless directed graphs that represent bijections 𝑓: 𝐴 → 𝐴 where
|𝐴| = 5. A loopless graph is a graph with no loops. [2 marks]

(d) Given the undirected graph below, how many walks of length three are there from vertex 𝑎 to
vertex 𝑑? You do not need to show your working. [3 marks]

𝑎 𝑏 𝑐 𝑑

- 9 of 10 -
CS1231S
24. (continue…)
(e) A set of vertices, 𝐷, in an undirected graph is said to be a dominating set if every vertex not in 𝐷
is adjacent to at least one vertex in 𝐷. A minimal dominating set is a dominating set such that
none of its proper subsets are dominating sets.
(i) Draw two non-isomorphic simple graphs with four vertices that have minimal dominating sets
of size one. Highlight the vertices in the minimal dominating set in your graphs. [2 marks]
(ii) Draw two non-isomorphic simple graphs with four vertices that have minimal dominating sets
of size three. Highlight the vertices in the minimal dominating set in your graphs. [2 marks]
(iii) The graph below shows different villages (vertices) and their connectivity in a certain district.
A telephone company wants to set up cellular towers such that all villages are covered by the
network. Each cellular tower can cover the village in which it is set up, together with all the
villages adjacent to it.
The cost of setting up a tower in the village a is 10 units, in the villages b, c, d, or e is 4 units,
in the village f is 7 units and in the villages g or h is 3 units. Describe one way in which the
company can set up its towers such that the total cost is minimized (that is, list out the villages
and the total cost). [2 marks]

=== END OF PAPER ===

- 10 of 10 -

You might also like