FINAL DSP Question

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

DSP5221 DISCRETE STRUCTURES & PROBABILITY TRI 2020

FINAL TERM TEST (60 marks)

1. If you prefer, you can write your answers and then take pictures. Copy/insert the pictures
into MS Word document. (you may save as .pdf file)
2. I’ll only accept .pdf version or Ms. Word (.docx)
3. Save the file as using your id as the file name(example: 192312322.pdf or
192312322.docx)

PART A (10 MARKS)

Answer MCQ part here. There are 10 mcq questions.

https://forms.gle/KTh6HxAwG3vgJwva9

PART B (50 MARKS)

There are 5 questions here. Answer ALL questions

Question 1 (10 marks)

(a) Given X = (x|0<x<6) and Y = (y|0<y<11) here f is the function of 2x.

(i) Draw its diagram and find domain and co-domain. [2m]
(ii) List all the range of function. [1m]
(iii) Determine if it’s injective, surjective and bijective. [1m]
(b) Consider the following function. [2m]

int curve(int y)

if (y == 0)

return 0;

else

return (curve(y – 1) + (y + 3)); }

Show the tracing process to derive the result by this function call: curve (5).

1
DSP5221 DISCRETE STRUCTURES & PROBABILITY TRI 2020

(c) Among a set of 5 black balls and 3 red balls, how many selections of 5 balls can be made
such that at least 3 of them are black balls. [2m]

(d) A random sample of 250 working adults found that 37% access the internet at work, 44%
access the internet at home and 21% access the internet at both work and home. What is the
probability that a person in this sample selected at random accesses the internet at home or
at work? [2m]

Question 2 (10 marks)

Let x denote the number of times a certain numerical control machine will malfunction: 1, 2 or 3
times on any given day. Let y denote the number of times a technician is called on an emergency
call. Their joint probability distribution is given as :

p(x,y) x

1 2 3
y
0.05 0.05 0.10
1
0.05 0.10 0.35
3
0.00 0.20 0.10
5

a) Compute P(X ≤2 and Y ≤ 3). [1m]


b) Compute the marginal probability distribution of X and Y. [3m]
c) What is P(X ≤ 2)? [1m]
d) Compute the expected value of X and Y. [2m]
e) Find cov(X, Y). [2m]
f) Are X and Y independent? Why? [1m]

2
DSP5221 DISCRETE STRUCTURES & PROBABILITY TRI 2020

Question 3 (10 marks)

(a) You are conducting a survey of drivers and their views on the most annoying habits of other
drivers. 61% of the participants view talking on cellphones as the most annoying habit. Let x
represent the number who named talking on cell phones as the most annoying habit. Six people
are randomly selected in the survey.
a) Find the probability :
i. Exactly 2 people will name “talking on the cell phones”. [1m]
ii. At least five people will name “talking on the cell phones”. [1m]
b) Find the mean and standard deviation of the binomial distribution. [2m]

(b) Mei Mei is planning to purchase a new oven. She is considering brands such as Elba, Khind
and Panasonic. She will choose among these 3 brands which is illustrated by the following tree
diagram. For each brand, the probability of its oven being defect after 1 year is given.

0.3321 0.4442
x

Elba Panasonic
Khind
0.33
0.22 0.48 0.67
0.78 0.52

Defect Non-Defect Defect Non-Defect Defect Non-Defect

(i) Based on the tree diagram above, what is the value of x? [1m]
(ii) What is the probability the Mei Mei will have a defective oven after 1 year. [1m]
(iii) What is the probability that Mei Mei buys a Panasonic oven given that the new oven
will be defective after 1 year? [2m]

(c) An author has 6 different books in print. If those 6 books are stacked in a random order, what
is the probability that they are arranged in alphabetical order from top to bottom ? [2m]

3
DSP5221 DISCRETE STRUCTURES & PROBABILITY TRI 2020

Question 4 (10 marks)

(a) Given an Incidence matrix

e1 e2 e3 e4 e5 e6 e7 e8 e9

A 1 1 1 0 0 0 0 0 0
B 0 1 0 0 1 0 1 1 1
C 0 0 1 1 1 1 0 0 0
D 1 0 0 1 0 0 0 0 0
E 0 0 0 0 0 1 1 0 0
F 0 0 0 0 0 0 0 1 1

(i) Draw the graph according to the given matrix. [2.5m]


(ii) Justify whether the graph has an Euler Cycle or Euler Path. If the cycle/path exists,
indicate the cycle/path. [3m]

(b) Refer to the following binary search tree.

125

107 163

94 116 132 171

114

(i) Identify the height of the tree. [0.5m]


(ii) Search the node 114 using Depth Search method. [1m]
(iii) Insert 55, 123, 154 (in this order) into the binary search tree above. Draw the
binary tree to show the insertion. [3m]

4
DSP5221 DISCRETE STRUCTURES & PROBABILITY TRI 2020

Question 5 (10 marks)

(a) Draw the transition diagram of a finite state automaton given the property it accepts strings
over [a,b] that contains abba. (Note: The input is always strings over [a,b]). [3m]

(b) Given a finite state automaton table which consists of (I, S, f, A, S0).
I = {M,N,T}, S = {S0, S1, S2, S3, S4}, A = {S1, S3, S4}

I
M N T
S

S0 S1 S3 S2

S1 S0 S1 S4

S2 S3 S1 S0

S3 SO S2 S4

S4 S2 S3 S1

(i) Draw the transition diagram of the finite state automaton. [5m]

(ii) Determine if the input strings will be accepted by the finite state automaton above.
State yes or no for every input string:
 MNTNTM [1m]
 TTNNTTMNN [1m]

~END~

You might also like