DM SampleExam (Q)

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

AAQS007-4-1-DM Final Exam Page 1 of 7

Section A (Answer All Questions)

QUESTION A1 (Total: 5 Marks)

Suppose that you must study two out of three programming languages namely C++, Java and
Perl.
(a) How many possible options do you have?
(2 marks)
(b) List all the possible options.
(3 marks)

QUESTION A2 (Total: 5 Marks)

A computer password consists of five characters. How many different passwords are possible
if
(a) it can be any lower case letters and digits?
(2 marks)
(b) the first two must be lower case letters and the remaining three can be either digits or
lower case letters?
(3 marks)

QUESTION A3 (Total: 5 Marks)

When tree coins are flipped, what is the probability that there will be
(a) exactly three heads?
(2 marks)
(b) one head and two tails?
(3 marks)

QUESTION A4 (Total: 5 Marks)

(a) State whether each of the following is a proposition, and state the truth values of those
that are propositions.
(i) 2x + 3 = y
(ii) Rectangle has four equal sides.
(3 marks)
(b) Write a negation for the statement below.
Justin fails his driving test today.
(2 marks)

QUESTION A5 (Total: 5 Marks)

Construct a truth table for the compound proposition ( ~ p∧q ) → ~ q , and state whether it is
tautology, contradiction or indeterminant.

Diploma Asia Pacific University of Technology & Innovation YYYYMMDD


AAQS007-4-1-DM Final Exam Page 2 of 7

QUESTION A6 (Total: 5 Marks)

Given a logic circuit as follows:

F
y

(a) Find the Boolean expression that represents the output F of the circuit above.
(2 marks)
(b) Evaluate the expression obtained in part (a) if x = 0, y = 1, and z = 1.
(3 marks)

QUESTION A7 (Total: 5 Marks)

Obtain the simplified Boolean function from the Karnaugh maps below.
(a)
BC
A 00 01 11 10

0 1

1 1 1 1 1

(2 marks)
(b)

CD
AB 00 01 11 10

00 1 1 1

01 1 1 1
1

11 1 1 1
1

10 1 1
(3 marks)

Diploma Asia Pacific University of Technology & Innovation YYYYMMDD


AAQS007-4-1-DM Final Exam Page 3 of 7

QUESTION A8 (Total: 5 Marks)

(a) Draw an undirected graph based on the set of vertices, V and set of edges, E given
below.
V = {a, b, c, d, e}
E = {{a, c}, {a, e}, {b, d}, {b, e}, {c, d}}
(3 marks)
(b) Find a Euler circuit for the graph in part (a).
(2 marks)

QUESTION A9 (Total: 5 Marks)

Given a directed graph as follows:


a b c

e d

(a) Represent the undirected graph above using adjacency list.


(3 marks)
(a) Find a simple path and a simple circuit of length 5 from the graph above.
(2 marks)

QUESTION A10 (Total: 5 Marks)

Draw a simple graph which the degree sequence is (0, 2, 2, 3, 3).

Diploma Asia Pacific University of Technology & Innovation YYYYMMDD


AAQS007-4-1-DM Final Exam Page 4 of 7

Section B (Answer ANY 2 Questions)

QUESTION B1 (Total: 25 Marks)

(a) (i) A particular brand of shirt comes in 8 colours, has a male version and a female
version, and comes in 5 sizes for each sex.
(A) How many different types of this shirt are made?
(2 marks)
(B) How many different types of this shirt are made for blue and red?
(2 marks)
(ii) Which counting principle is used in part (i)?
(1 mark)
(b) A class consists of 16 boys and 17 girls. A committee of four members are to be
selected at random. Determine the probability that
(i) all the committee members are girls
(4 marks)
(ii) three members are boys and one is a girl
(5 marks)
1 2 8
P ( A )= P ( A∩B )= P ( A∪B )=
(c) Let A and B be the events with 3, 9 and 12 . Find
P (B) .
(4 marks)
(d) An urn contains 7 red marbles and 3 white marbles. Three are drawn from the urn one
after the other. Find the probability that the first two are red and the third is white.
(3 marks)
(e) The following table shows sales, in thousands of units, of laptops of brand A, B and C
in year 2013 and 2014.

A B C Total
2013 350 460 220 1030
2014 450 640 380 1470
Total 800 1100 600 2500

If one of the laptop is selected at random, find the probabilities of the following
events:
(i) It is a laptop of brand B sold in year 2013.
(2 marks)
(ii) It is a laptop of brand A, or C.
(2 marks)

Diploma Asia Pacific University of Technology & Innovation YYYYMMDD


AAQS007-4-1-DM Final Exam Page 5 of 7

QUESTION B2 (Total: 25 Marks)

(a) Let p, q and r be propositions defined as follows:


p: I am thirsty.
q: My glass is empty.
r: It is three o’clock.
Express each of the compound propositions below as an English sentence.
(i) r∧ p
(2 marks)
(ii) q↔ p
(2 marks)
(iii) ~ p →~ q
(3 marks)
(b) Evaluate whether each of the following compound propositions is true of false.
(i) Tiger is an animal and ant is an insect.
(1 mark)
(ii) If 1 + 3 = 4 then 6 – 4 > 2.
(1 mark)
(c) Write a negation for the statement below.
Mary is a math major and Ann is not a computer science major.
(3 marks)
(d) Given the truth table of a Boolean Function as follows where x, y and z are the
variables.

x y z F(x, y, z)
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1

(i) State the minterm and maxterm expressions of the outputs given in the table.
(5 marks)
(ii) Simplify the minterm expression in part (i) using Karnaugh Map.
(5 marks)
(iii) Draw the logic circuit of the simplified minterm expression in part (ii).
(3 marks)

Diploma Asia Pacific University of Technology & Innovation YYYYMMDD


AAQS007-4-1-DM Final Exam Page 6 of 7

QUESTION B3 (Total: 25 Marks)

(a) Given a rooted tree as below.


a

b c

d e f g

h i j k

l m

(i) What is the level of vertex j?


(1 mark)
(ii) What are the ancestors of i?
(1 mark)
(iii) Which vertex is the parent of h and i?
(1 mark)
(iv) List all the leaves of graph G.
(2 marks)
(v) Draw the subtree rooted at c.
(2 marks)
(vi) List the order of the vertices of the tree if it follows
(A) preorder traversal
(3 marks)
(B) inorder traversal
(3 marks)
(C) postorder traversal
(3 marks)
(b) Find in-degree of all vertices for the given directed graph as below.
a b

d c
(2 marks)

Diploma Asia Pacific University of Technology & Innovation YYYYMMDD


AAQS007-4-1-DM Final Exam Page 7 of 7

(c) Given an undirected graph as follows:


b

a
c

e
d
(i) Represent the graph using adjacency matrix.
(5 marks)
(ii) Find a Hamilton circuit from the graph given above.
(2 marks)

Diploma Asia Pacific University of Technology & Innovation YYYYMMDD

You might also like