You are on page 1of 5

CONFIDENTIAL CS/APR 2006/ITC430/CSC510

UNIVERSITI TEKNOLOGI MARA


FINAL EXAMINATION

COURSE DISCRETE STRUCTURES

COURSE CODE ITC430/CSC510

EXAMINATION APRIL 2006

TIME 3 HOURS

INSTRUCTIONS TO CANDIDATES

1. This question paper consists of six (6) questions.

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:

i) the Question Paper


ii) an Answer Booklet - provided by the Faculty

DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO


This examination paper consists of 5 printed pages
© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL
CONFIDENTIAL CS/APR 2006/ITC430/CSC510

Answer ALL questions.

QUESTION 1

A universe of discourse consists of pupils in a school.

a. Express each of the following statements separately in predicate calculus.

i. Everybody speaks either Malay or English


ii. Only the girls stay in hostel
III. Some boys wear slacks
iv. Nobody drives a car
v. AN knows everyone in school, but not everyone knows AN
(5 marks)
b. Generate a model each for the expressions in a(iii) and a(v) above.
(2 marks)

QUESTION 2

Let the prepositional variables p, Q and R represent three distinct statements as follows:

P: The engine is running properly


Q: There is water in the radiator
R: There is fuel in the tank

a. Write the following logical argument in words.

-iP -> -iQ v -iR

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)

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL CS/APR 2006/ITC430/CSC510

QUESTION 3

A s e t B = { x | x < 6 , x e N } where N is a set of natural numbers. A relation R is


defined on B such that xRy only if R = { ( x , y ) | (x + y) is odd}. Another relation T
is defined on B such that xTy only if T = { ( x , y ) | x + y = 4 } .

a. State explicitly the members of R.


(2 marks)
b. Find the reflexive closures of R.
(2 marks)
c. Find the symmetric closures of R.
(2 marks)
d. Determine whether T is a partial order relation, and state your reason.
(2 marks)
e. Determine whether T is a function, and state your reason.
(2 marks)

QUESTION 4

a. List the members of each of the following intensionally specified sets.

i. Let A = {x | x is an integer such that x2 = 16}


ii. Let B = {x | x is the square of an integer and x < 25}
iii. Let C = {x I x is a positive integer less than 10}
(3 marks)
b. Based on your answers to a(i) - a(iii), determine the members of the following
combined sets.

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)

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL CS/APR 2006/ITC430/CSC510

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)

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


CONFIDENTIAL 5 CS/APR2006/ITC430/CSC510

QUESTION 6

a. Construct a non-deterministic finite state automaton that recognizes the language


generated by the regular grammar defined by a tuple G = (V, T, s, P), where v
represents the set of symbols that constitute the vocabulary of the language, T
represents the set of terminal symbols, s is a distinguished element of v that acts
as the starting symbol, and p represents the set of production rules.

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)

b. The BNF for production in a grammar is given as follows:

<assign> ::= <id> = <expr>


<id> ::= A | B | C
<expr> ::= <expr> + <term> | <term>
<term> ::= <term> * <factor> | <factor>
<factor> ::= (<expr>) | <id>

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)

c. Check if the following program is correct or not. Show your work.

{ x = Vx and y = Vy }
temp = x;
x = y;
y = temp;
{ x = Vy and y = Vx }

(5 marks)

END OF QUESTION PAPER

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL

You might also like