Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MCD4440

Discrete Mathematics For Computer Sciences

Trimester 1 2021

Sample Exam

1.  Consider the following truth table in which A, B, and C are three sentences involving the variables p, q, and r.

p q r

A B C

T T T

T T F

T F T

T F F

F T T

F T F

F   F T

F F F

T T T

T F T

F T T

F T T

F T T

F F   F

F   T F

F   T F

(a) What is A?

A.  A p.

B.  A p ^ q.

C. A p__q.

D. A 三 p ! q.

(b) What is B?

A.  B 三 q.

B.  B 三 q ^ r.

C.  B q _r.

D.  B q ! r.

(c) What is C?

A.  C p ^ q ^ r.

B.  C 三 p__q _r.

C.  C p__ (q ^ r).

D.  C 三 (p__q) ^ r.

(d) What is A _ B _ C logically equivalent to?

A. T.

B.  :q.

C. p__ :q _r.

D.  :p ^ q ^ :r.

[1+1+1+1 = 4 marks]

2.  Let A = fp 2 Z : p is primeg and B = fn 2 Z : n is a squareg.

Deine the function f : A ! B, where f(p) is the largest element of B that is less than or equal to 5p.

(a) What is f(13)?

(b) Is f one-to-one?

(c) Is f onto?

[1+1+1 = 3 marks]

3.  Let S = f0, 1, 2, 3, 4, 5, 6, 7g.

Deine a binary relationship R on S by aRb if and only if a + b is even.

Deine an equivalence relationship E on S by aEb if and only if a2  = b2    (mod 8).

(a) Is R relexive?

(b) Is R symmetric?

(c) Is R antisymmetric?

(d) Is R transitive?

(e)  How many equivalence classes does E have?

(f)  How many numbers are in the largest equivalence class of E?

[1+1+1+1+1+1 = 6 marks]

4.  The dials on a padlock can be set to form a three digit code number, ranging from 000 to 999.

(a)  How many possible code numbers are there?

(b)  How many of the code numbers consist of 3 diferent digits?

(c) How many of the code numbers contain the digit 0?

(d)  How many of the code numbers are divisible by 2 or 5?

[1+1+2+2 = 6 marks]

5. The probability distribution of a discrete random variable X is given by the table below

x

-1

0

2

3

Pr(X = x)

p

3p

2p

0:4

(a) What is the value of p?

(b) What is E[X]?

(c) What is Var[X]?

[1+1+1 = 3 marks]

6.  On average,a drop of water leaks from a water tank 5 times every minute. The probability that at least 3 and at most 8 drops leak from the tank in one minute is given by

(a) What is the value of a?

(b) What is the value of b?

(c) What is the value of λ?

(d) You start watching the water tank. Which of the following distributions would best model how many minutes pass before the next drop?

A. Uniform distribution.

B. Bernoulli distribution.

C. Binomial distribution.

D.  Geometric distribution.

E. Poisson distribution.

(e) You watch the tank for three minutes.  After each minute, you write down ‘YES’ when you saw at least one drop, and ‘NO’ otherwise. Which of the following distri- butions would best model the probability that you wrote down ‘YES’ twice?

A. Uniform distribution.

B. Bernoulli distribution.

C. Binomial distribution.

D.  Geometric distribution.

E. Poisson distribution.

[1+1+1+1+1 = 5 marks]

7. A fair six-sided die is rolled twice. Let A be the event that at least one 5 was rolled. Let B be the event that the sum of the two numbers rolled is even.

(a) What is Pr(A)?

(b) What is Pr(B)?

(c) What is Pr(A \ B)?

(d) What is Pr(AjB)?

(e) What is Pr(BjA)?

(f) Which one of the following is true?

A. A and B are independent because Pr(A) Pr(B) = Pr(A \ B). B. A and B are independent because Pr(AjB) Pr(A).

C. A and B are independent because Pr(AjB) = Pr(BjA).

D. A and B are NOT independent because Pr(A) Pr(B) = Pr(A \ B). E. A and B are NOT independent because Pr(BjA) Pr(A).

F. A and B are NOT independent because Pr(BjA) Pr(B).

[1+1+1+1+1+1 = 6 marks]

8. A multigraph with three vertices has the adjacency matrix

where the vertices V1 ,  V2 , and V3   correspond to the irst, second, and third columns, respectively.

(a)  How many walks of length 1 are there from V2  to V3 ?

(b)  How many walks of length 1 are there from V1  to V1 ?

(c)  How many walks of length 2 are there from V1  to V2 ?

(d)  How many walks of length 3 are there from V2  to V2 ?

(e) Which of the following is an (unlabelled) diagram of the multigraph?

9.  Consider the following graph

(a)  How many vertices of the graph have an odd degree?

(b) What is the smallest number of edges that need to be added to the graph in order for it to have an Eulerian trail?

(c)  How many edges are in the tree that would result from a depth irst search of the graph?

(d) Which of the following trees would result from a breadth irst search of the graph, starting at the vertex A, and using an alphabetical ordering of the vertices?

[1+1+1+2 = 5 marks]

10.  Consider the ininite sequence deined recursively by

Find a non-recursive formula for an  for all n ≥ 0, and prove your formula is correct by using strong induction.

[7 marks]