For Marking Use
For Marking Use
FACULTY OF ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE
CSIS1118/COMP2121 Foundations of Computer Science and Discrete Mathematics: Final Exam
1. Only approved calculators as announced by the Examinations Secretary can be used in this
examination. It is your responsibility to ensure that your calculator operates satisfactorily,
and you must record the name and type of the calculator here:
3. You are advised to spend around 5 minutes to read all the questions before you begin writing.
4. Please write your answer in the designated space. If you run out of space, you can use the
blank side of the previous page. Please indicate clearly when you are doing so.
5. Attempt ALL questions. The full mark for the exam is 100 points.
Question 2
Question 3
Question 4
Question 5
1
UNIVERSITY N U M B E R : - - - - - - - - - - - -
2
UNIVERSITY NUMBER: - - - - - - - - - - - -
4. Let A be a finite set with n elements. Recall that a relation on A can be represented by either
a table with n rows and n columns, or a directed graph with n nodes.
(i) (2pt) How many relations on A are there?
(iv) (4 pt) How many relations on A are both reflexive and symmetric?
(ii) (3 pt) How many non-negative integer solutions are there such that x 1 = x 2 ?
(iii) (4 pt) How many non-negative integer solutions are there such that x 1 > x 2 ?
3
UNIVERSITY NUMBER:
6. (10 pt) Suppose G = (V, E) is a simple undirected graph with no self-loop; moreover, the
graph G has n = \VI 2:: 1 vertices, m =\El edges, k connected components, p odd cycles, q
even cycles and chromatic number X·
True or False
(1) If p + q = 0, then m :':: n - l.
(2) If p + q = 0, then the graph is planar.
(3) If p = 0, then x = 2.
(4) If the graph is planar, the!l x 2:: k.
(5) If x = n, then m = ~.
7. Suppose a lion and a zebra live in a forest. On a sunny day, the lion appears with probability
0.6 and the zebra appears with probability 0.8; on a non-sunny day, the lion appears with
probability 0.2 and the zebra appears with probability 0.4. Suppose the probability that a
day is sunny is 0.6.
(i) (2 pt) What is the probability that the lion appears on a random day?
(ii) (3 pt) Suppose that the lion and the zebra are not aware of each other's activities. Given
that the zebra appears, what is the probability that the lion also appears?
8. Suppose you are one of 10 players in a game, where each player has a chance 0.2 of winning,
independent of other players. The prize money is $100, and if there is more than one winner,
the prize money is shared equally among the winners.
(i) (1 pt) What is the probability that there is at least one winner? (to 5 decimal places)
(ii) (4 pt) What is the expected amount of money that you will win? (to 4 decimal places)
(Hint: the answer is not $20.)
4
UNIVERSITY !'<UMBER: - - - - - - - - - -
(b) (7pt) Suppose that x and y are non-negative real numbers. Prove that for all positive integers
k, (x + y)k ::; zk-l(xk + yk).
5
UNIVERSITY NUMBER: - - - - - - - - - - - -
(b) (2 pt) Suppose m = 7 and n = 5. What is the expected number of surviving rabbits? Compute
the answer up to 6 decimal places.
(c) (6 pt) Suppose m = 7 and n = 5. What is the probability that no rabbit survives? Compute
the answer up to 5 decimal places.
6
UNIVERSITY NUMBER: - - - - - - - - - - - -
(b) (3pt) Suppose a graph is connected and there are exactly 8 vertices with odd degrees. What is
the minimum number of edges that need to be added such that the graph has an Euler circuit?
(c) (3pt) Suppose a graph has 4 connected components and all vertices have even degrees. What
is the minimum. number of edges that need to be added such that the graph has an Euler circuit?
7
UNIVERSITY NUMBER:
(d) (5pt) In general, given a graph, describe a method to add the minimum number of edges
such that the graph has an Euler circuit. Illustrate your method with a graph which has ·10
connected components, and the number of vertices with odd degrees in each component is as
follows: 0,2,2,4,6,8,8,10,10,12. What is the total number of edges added?
8
UNIVERSITY NUMBER: - - - - - - - - - - - -
1. ( 5 pt) What is the sample space 0 associated with this experiment? Explain whether the
sample space is finite, countable, or uncountable.
2. (5pt) Define a random variable Z = Ln2'.l f,\'. What is Pr[Z :S: 0.625]? (Hint: 0.625 = ~+ U
9
UNIVERSITY NUMBER: - - - - - - - - - - -
3. (5pt) In general, for a real number x E [O, l], what is Pr[Z::; x]? Explain your answer.
END OF PAPER
10