You are on page 1of 5

CONFIDENTIAL

CS/JAN 2013/CSC510/ITC430

UNIVERSITI TEKNOLOGI MARA FINAL EXAMINATION

COURSE COURSE CODE EXAMINATION TIME

DISCRETE STRUCTURES CSC510/ITC430 JANUARY 2013 3 HOURS

INSTRUCTIONS TO CANDIDATES 1. 2. 3. This question paper consists of six (6) questions. Answer ALL questions in the Answer Booklet. Start each answer on a new page. Do not bring any material into the examination room unless permission is given by the invigilator. Please check to make sure that this examination pack consists of: i) ii) the Question Paper 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/JAN 2013/CSC510/ITC430

QUESTION 1 a) Suppose x is a real number. Consider the following statement: "If x2 = 4, then x = 2". Construct the converse, the inverse, and the contrapositive. (6 marks) b) What is the value of x after each of these statements is encountered in a computer program, if x = 5 before the statement is reached? i. lf2 + 2 = 3thenx = x + 5. ii. If(1 + 2 = 3) OR ( 2+3 = 6) then x = x + 2. iii. lf(x<2)XOR(x>2)thenx = x - 1 . iv. If(x =5) AND (x + 1 =5) then x = x -3. (4 marks) c) Let P -> Q be the conditional statement. Show that the inverse and the converse of a conditional statement are logically equivalent. (5 marks)

QUESTION 2 a) Write the negation of the following statements: i) Hana is not home or Sofea is at the Library, ii) If Mikail buys pizza, then Zakwan buys popcorn. (4 marks) b) Convert the following expression which in Conjunctive Normal Form to Disjunction Normal Form using De Morgan rules. i. ii. It is not true that the Discrete Structure book is boring and the magazine is interesting, It is not true that Sofea take Discrete Structure and Prolog Programming. (4 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

CS/JAN 2013/CSC510/ITC430

c)

Express each of these mathematical statements using predicates, quantifiers, logical connectives and mathematical operators. (Assume that the domain for ail variables is a real number): i. The difference of a real number and itself is zero. ii. The average of two positive real numbers is a positive real number. iii. A negative real number does not have a square root that is a real number. (6 marks)

d) Determine the truth value of these statements if the domain consists of all integers: i. 3x(2x = x3).
ii. Bx(x = -x). iii. Vx(x 3 >-x 2 ). iv. Vx(x 2 >x).

(4 marks)

QUESTION 3 a) Show that the premises: A student in Discrete Structure class has not complete the tutorials. Everyone in Discrete Structure class has passed the first exam. Imply the conclusion: Someone who passed the first exam has not read the book. Let A(x) "x is in Discrete Structure class". B(x) "x completed the tutorials", P(x) "x passed the first exam". (8 marks) b) Prove that the difference of two rational numbers is rational. (5 marks) c) Suppose n e Z. If n is both odd and even, then n = n + n (3 marks)

QUESTION 4 a) Let S = {1,2,3} and T = (x | 1 <= x < 10,where x is an odd number). Find solution for the following statements: Vx(xeS)->(xeT). P ( V x ( x e S ) ^ (xeT)). |P(Vx(x6S)->(xeT))|. iv. S x ( V x ( x e S ) ^ (xeT)). (8 marks) CONFIDENTIAL

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CS/JAN 2013/CSC510/ITC430

b) State whether the following set is injective or NOT. i. ii. iii. iv. f(x) f(x) f(x) f(x) = x + 5 from the set of real numbers R to R. = x2 from the set of real numbers R to R. = x2 from the set of natural numbers N to N. = x2 + 1 from the set of integers Z to Z. (4 marks) c) Consider the following diagram:

What are the relation properties and its corresponding elements? (6 marks)

QUESTION 5 a) Write a context-free grammar for the Language, L = {anb2ncn: n > 1}. (5 marks) b) Construct a finite state machine (FSM) with three (3) states with input (x, y, z). The FSM should be able to accept input string xz , xyxz, yxz, xyxyz and reject xyyz and xyz. (5 marks) c) Determine the type of following grammar G which consists of the productions. Give your explanation: i. ii. iii. S->aA, A - * a B , B->bB, B a S ^ A B C , AB-bB, B ->b, A ->aB, A -a S -AB, A -> Aa, B -* Bb, B * A (6 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

CS/JAN 2013/CSC510/ITC430

QUESTION 6 a) Proof the correctness of the following statement: i. { n is even and n < 100 and n < 99 } n := n + 2 { n is even and n < 100} ii. { y = 2 } x : = y + 1 {2*x + y < 11 } (6 marks) b) Consider the following statement:

{ P } i f x > 0 then y := x e l s e y := -x { y > 5 }


What is the weakest pre-condition P? (3 marks) c) Prove that this program segment calculates summation of even number from 0 to n:

p r o d u c t =0; f o r ( i n t n = 0;n < 99; n++)


{

p r o d u c t = product * 2;
} (8 marks)

END OF QUESTION PAPER

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

You might also like