Professional Documents
Culture Documents
TIME 3 HOURS
INSTRUCTIONS TO CANDIDATES
2. Answer ALL questions in the Answer Booklet. Start each answer for the questions on a
new page.
3. Do not bring any material into the examination room unless permission is given by the
invigilator.
4. Please check to make sure that this examination pack consists of:
QUESTION 1
QUESTION 2
Let the prepositional variables p, Q and R represent three distinct statements as follows:
Q A R
(2 marks)
b. Test the argument for validity.
(3 marks)
c. Write the proposition -,p A Q v R -» -,p in disjunctive normal form.
(3 marks)
d. Show that the proposition (P - Q) A ( P A -.Q) is a contradiction.
(2 marks)
QUESTION 3
QUESTION 4
i. B - A C C
(1 mark)
ii. ~B n C
(1 mark)
iii. A x B
(1 mark)
iv. The power set of A
(1 mark)
c. Let F and G be two subsets of the universal set E. Using set identities, prove the
following propositions.
(~A n E) n (~B u 0) = ~ ( A u B)
(1 mark)
F- (FnG) = F - G [Hint: A - B = A n ~B]
(2 marks)
QUESTION 5
a. Find the number of edges, and the number of vertices with degree > 2 in the
undirected graph given below.
(2 marks)
Find a route with the least total airfare that visits each of the cities mentioned in the
graph below. The weight on an edge is the least price (in RM) available for a flight
between the two connecting cities.
250
700
525
(4 marks)
Use Prim's algorithm to find a minimum spanning tree for the weighted graph shown
below.
(4 marks)
QUESTION 6
V = {A, B, C, 0, 1}
T = {0,1}
S = B
P = {A -» OB, A ->• IB, A -> 0, B -> 1A, B -» OC, C -> OC, C -» 1}
(3 marks)
Show a parse tree and a leftmost derivation for each of the following statements.
I. A = ( A + B ) * C
(2 marks)
ii. A = B * ( C * ( A + B ) )
(3 marks)
{ x = Vx and y = Vy }
temp = x;
x = y;
y = temp;
{ x = Vy and y = Vx }
(5 marks)