Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Cs210: Foundations of Computer Science Dept of Computer SC and Engg, IIT Madras Answer All Questions Time: 2 Hours Full Marks 40

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

CS210 : FOUNDATIONS OF COMPUTER SCIENCE

Dept of Computer Sc and Engg, IIT Madras


Answer All Questions Time: 2 hours
Full Marks 40

1. Prove the equivalence of the propositions defined in (a) and (b):


(a) ( p ⇒ q ) ∨ (¬p ⇒ q)
(b) (¬p ⇔ ¬q) ⇔ ( p ⇔ q)
What are such kinds of propositions called?
(3+1=4 marks)

2. Consider the following 99 statements:


S1: At least 1 of the statements are false
S2: At least 2 of the statements are false

S99: At least 99 of the statements are false

What conclusion can you draw from the above statements. Explain your
answer briefly.
(4 marks)
3. (a) Write the following statement so that the negation appears only within the
predicates, i,e. no negation is outside a quantifier: ¬∀x∀yP( x, y )
(b) Prove or disprove the following equivalence:
∀xP( x) ∧ ∀xQ( x) ⇔ ∀x∃y ( P( x) ∨ Q( y ))
(2 x 2 = 4 marks)

4. Prove that it is impossible to cover completely with dominos (1 × 2 pieces) the


8 × 8 chess-board with two squares at the opposite corners of the board removed.
Hint: Adjacent squares of a chess-board have two colors, white and black.
(4 marks)

5. Suppose that five ones and four zeros are arranged around a circle. Between
any two equal bits you insert a 0 and between any two unequal bits you insert 1
and form nine new bits. Then erase the nine original bits. Show that when you
iterate in this fashion, you can never reach nine zeros.
(4 marks)

6. Determine the number of ways to cover a 2 by n board with dominos (1 × 2


pieces). What is the order of your answer?
(4 marks)

7. (a) Suppose that R1 and R2 are equivalence relations on set S. State with
brief reasons which of the following are also equivalence relations:
(a) R1 ∩ R2
(b) R1 ∪ R2
(2 marks)

(b) Prove or disprove that the relation R on the set of integers defined as:
R={(a,b)|a>b} is an equivalence relation.
(1 mark)
(c) Comment on: “The Data Acyclic Graph of an equivalence relation is
complete”.
(1 mark)

8. Let A={1,2,3,4} and let R and S be the relations on set A:

R={(1,4),(3,2),(4,3)} and S={(1,1),(1,2),(2,2),(3,3),(4,2),(4,4)}.

Using Warshall’s algorithm compute the transitive closure of R ∪ S.


(4 marks)

9. Consider the following program:


SUBROUTINE COMP(X,Y;Z)
1. Z=X
2. W=Y
3. while(W>0)
a. Z=Z+Y
b. W=W-1
4. return
END OF SUBROUTINE

Show by mathematical induction that the given algorithm, correctly used,


maintains the following loop invariant and produces the following output.

LOOP INVARIANT: (Y × W) + Z =X + Y2
OUTPUT : Z = X + Y2
(4 marks)

10. The Halting problem discussed in the class states: “Given a description of a
program and a finite input, decide whether the program finishes running or will
run forever, given that input”. The problem was shown to be unsolvable. However
we have also seen in the class that we can prove that a specific instance of a
program with specific inputs terminate. Is there is an apparent contradiction
between the two? Explain in not more than two statements.
(4 marks)

You might also like