You are on page 1of 3

Assignment No.

01
SEMESTER Fall - 2022
CS702 –Advance Algorithm Analysis and Design

Due Date: 5/12/2022 Total Marks 50

Instructions to Solve Assignments

The purpose of assignments is to provide you with hands on practice on Advance Algorithm Analysis
and Design course. It is expected that students will solve the assignments themselves. Following rules
will apply during the evaluation of assignment.

 Cheating from any source will result in zero marks in the assignment.

 Any student found cheating in any two of the assignments submitted will be awarded "F" grade in
the course.

 In case of question No. 03 direct copy and paste from the research paper will be awarded zero
marks.

 No assignment after due date will be accepted.

Problem No. 1 (20 Marks)


Show/Proof following Propositional Logic by truth Tables.

 (q → ¬ p) ↔ (p ↔ q)

p q ¬p q→¬p p↔q (q → ¬ p)↔(p ↔ q)

T T F F T F
T F F F F T
F T T T F F
F F T T T T

 (p ↔ q) ⊕ (¬p ↔ ¬ r)

p q r (p ↔ q) ¬p ¬r (¬p ↔ ¬ r) (p ↔ q)⊕(¬p ↔ ¬ r)

T T T T F F T F
T T F T F T F T
T F T F F F T T
T F F F F T F F
F T T F T F F F
F T F F T T T T
F F T T T F F T
F F F T T T T F

 (p ⊕ q) → (p ⊕ ¬q)

p q (p ⊕ q) ¬q (p ⊕ ¬q) (p ⊕ q) → (p ⊕ ¬q)

T T F F T T
T F T T F F
F T T F F F
F F F T T T

Problem No. 2 (10 Marks)

i. State the value of x after the statement if P (x)then x := 1 is executed, where P (x) is the
statement “x > 1,” if the value of x when this statement is reached is

a) x = 0.
by putting the value in equation “”x > 1””
0 >1 which is not fulfilling. So this condition is False
b) x = 1.
by putting the value in equation “”x > 1””
1 >1 which is not fulfilling. So this condition is False

c) x = 2.
by putting the value in equation “”x > 1””
2 >1 which is right. So this condition is True

ii. Suppose P (x, y) denotes the equation y=x +2, what will the truth values of the Propositions
P (2,5), P (0,1).

P (x, y) denotes the equation y=x +¿ 2,

P (2,5). False
so we have x = 2 and y =5
By putting the value in equation we have
5=2+2
5=4
Both side of the equation are not equal therefore it is a false value

P (0,1). False

FOR P (0,1) so we have x = 0 and y =1


By putting the value in equation we have
1=0+2
1=2

You might also like