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

For Marking Use

The document is the final exam for the Foundations of Computer Science and Discrete Mathematics course at the University of Hong Kong, held on May 27, 2013. It includes various questions covering topics such as logic, graph theory, probability, and inequalities, with a total of 100 points available. Students are required to answer all questions and follow specific instructions regarding the use of calculators and exam procedures.

Uploaded by

peak
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)
4 views10 pages

For Marking Use

The document is the final exam for the Foundations of Computer Science and Discrete Mathematics course at the University of Hong Kong, held on May 27, 2013. It includes various questions covering topics such as logic, graph theory, probability, and inequalities, with a total of 100 points available. Students are required to answer all questions and follow specific instructions regarding the use of calculators and exam procedures.

Uploaded by

peak
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

THE UNIVERSITY OF HONG KONG

FACULTY OF ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE
CSIS1118/COMP2121 Foundations of Computer Science and Discrete Mathematics: Final Exam

Date: 27 May, 2013 Time: 9:30am - 12:30pm


Write Your University Number here and also on every p a g e : - - - - - - - - - - - -
Please read the following before you begin.

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:

2. This is a closed book examination.

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.

For marking use:


Question 1

Question 2

Question 3

Question 4

Question 5

1
UNIVERSITY N U M B E R : - - - - - - - - - - - -

Question 1: The Basics (50 points)


You may give short answers in this question.

1. (2 pt) Suppose your parents set up the following rules:


Rule l: If you finish your homework or clean the apartment, then you are permitted to watch
TV.
Rule 2: If you watch TV, then you must sleep early.
Suppose in the end you were NOT permitted to watch TV. Circle all of the following that
must be true.
A. You did not finish your homework.
B. You did dean the apartment.
C. You did not sleep early.
2. Suppose the domain for the variable x is the set of creatures. Let S(x) denote the statement
that creature x can swim; C(x) denote the statement that creature x can clhnb; P(x) denote
the statement that creature x is a predator. Express the following statements using quantifiers
and logical operators.
(i) (2 pt) There exists a creature that can neither swim nor climb

(ii) (2 pt) Every predator can swim ..

3. (4 pt) True or False


O(n) n(n" + 3n) 8(n")
f(n) = n" + logn False
f(n) = 2n False

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?

(ii) (2 pt) How many relations on A are reflexive?

(iii) (2 pt) How many relations on A are symmetric?

(iv) (4 pt) How many relations on A are both reflexive and symmetric?

5. Consider integer solutions to the equation:


Xl + X2 + X3 + X4 + X5 = 10.
(i) (3 pt) How many non-negative integer solutions are there?

(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: - - - - - - - - - -

Question 2: Inequalities (10 points)


(a) (3 pt) Suppose a::; band c::;d. Prove that (a+b)(c+d)::; 2(ac+bd).

(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: - - - - - - - - - - - -

Question 3: Hunters and Rabbits (10 points)


Suppose there are m different hunters and n different rabbits. Each hunter selects a rabbit uniformly
at random independently as a target. Suppose all the hunters shoot at their chosen targets at the
same time and every hunter hits his target.
(a) (2 pt) Consider a particular Rabbit 1. What is the probability that Rabbit 1 survives?

(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: - - - - - - - - - - - -

Question 4: Euler Circuits (15 points)


We consider undirected multi-graphs with no self-loops.
(a) (4 pt) Give necessary and sufficient conditions for an Euler circuit to exist in a graph.

(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: - - - - - - - - - - - -

Question 5: Picking from [O, 1] Uniformly at Random (15 points)


In this question, we show how to pick a real number from [0, l] uniformly at random by flipping
an infinite but countable number of fair coins independently. Suppose for each positive integer n,
Coin n is flipped and the result is Xn E {O, l}, where 1 represents heads and 0 represents tails.
You may assume that for any positive integer m, it is impossible that for all i :;,: m, Coin i is heads.
You need to give brief justification to your answers in this question.

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy