TEAM 14
EX:-2.1
(QNO:-14) At the start of a program the integer variable n is assigned the value 7. Determine the value of n after each of the following successive statements is encountered during the execution of this program.[Here the value of n following the execution of the statement in part(a) becomes the value of n for the statement in part(b),and so on,through the statement in part(d).For positive integer a,b[a/b] returns the integer part of the quotient-for example,[6/2]=3,[2/5]=0,and[8/3]=2.]
a) if n>5 then n:= n + 2
b) if((n+2=8) or (n-3=6)) then n:= 2 * n + 1
c) if((n-3=16) and ([n/6]= 1)) then n:= n + 3
d) if((n≠21) and (n-7= 15)) then n:= n – 4
Solution:-
a) n > 5 and n=7 (given)
so n = n + 2
= 7 + 2
= 9
b) n + 2 = 9 + 2 =11 ≠ 8 (false)
Or
n – 3 = 9 – 3 = 6 = 6 (true)
so n = 2 * n + 1
= 2 * 9 + 1
= 18 + 1
= 19
c) n-3=16 (given)
19-3=16 (true)
And
[n/6] = 1 (given)
[19/6]= 3 ≠ 1 (false)
Hence n = 19
d) (n≠21) given
n =19 ≠ 21 (true)
And
n-7 = 15 (given)
19 – 7 =12 ≠ 15 (false)
Hence n = 19
EX:-2.2
(QNO.14) For primitive statement p,q
a) Verify that p→[q→(p۸q)] is a tautology.
b) Verify that (p۷q)→[q→q] is a tautology by using the result from part (a) along with the substitution rules and the law of logic.
c) Is (p۷q)→[q→(p۸q)] a tautology?
Solution:-
p | q | p۸q | q→(p۸q) | p→[q→(p۸q)] |
1 | 1 | 1 | 1 | 1 |
1 | 0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 | 1 |
0 | 0 | 0 | 1 | 1 |
a)
Hence the given compound statement is a tautology.
b) Taking the compound statement from part (a)
p→[q→(p۸q)]
= q→[q→(q۸q)] (by substitution rule)
= q→[q→q] (by idempotent law)
Take the compound statement from part (b)
And let this statement is a tautology then
(p۷q)→[q→q]
= (q۷q)→[q→q] (by substitution rule)
= q→[q→q] (by idempotent law)
Hence both are logically equivalence
So assumption is true.
Thus (p۷q)→[q→q] is a tautology.
c)
p | q | (p۸q) | q→(p۸q) | (p۷q) | (p۷q)→[q→(p۸q)] |
1 | 1 | 1 | 1 | 1 | 1 |
1 | 0 | 0 | 1 | 1 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
0 | 0 | 0 | 1 | 0 | 1 |
Hence the given compound statement is not a tautology.
EX:-2.4
(QNO:-7) For the universe of all integer,let p(x),q(x),r(x),s(x),and t(x) be the following open statements.
P(x): x > 0
q(x): x is even
r(x): x is a perfect square
s(x): x is (exactly) divisible by 4
t(x): x is (exactly) divisible by 5
a) Write the following statements in symbolic form.
(1) At least one integer is even.
(2) There exists a positive integer that is even.
(3) If x is even, then x is not divisible by 5.
(4) No even integer is divisible by 5.
(5) There exists an even integer divisible by 5.
(6) If x is even and x is a perfect square, then x is divisible by 4.
b) Determine whether each of the six statements in part (a) is true or false. For each false statement, provide a counterexample.
c) Express each of the following symbolic representations in words.
1) For All x [r(x)→p(x)] (2) For All x [s(x)→q(x)]
3) For All x [s(x)→ ¬t(x)] (4) For All x [s(x)۸ ¬r(x)]
d) Provide a counterexample for each false statement in part (c)
Solution:-
a) (1) For Some x q(x)
(2) For Some x [p(x)۸q(x)]
(3) For All x [q(x)→ ¬t(x)]
(4) For All x [q(x)→ ¬t(x)]
(5) For Some x [q(x)۸t(x)]
(6) For All x [q(x)۸r(x)→s(x)].
b) (1) True
(2) True
(3) False (ex:- 10,20,30)
(4) False (ex:- 10,20,30)
(5) True
(6) True
c) (1) If x is a perfect square, then x > 0.
(2) If x is divisible by 4 then x is a even no.
. (3) If x is divisible by 4 then x is not divisible by 5.
(4) There exists an integer divisible by 4 but it is not a perfect square)
d) (1) False (ex:-0)
(2) True
(3) False (ex:- 20,60)
(4) True
.
EX:-3.1
(QNO:-14) Give an example of three sets w,x,y such that w belongs to x and x belongs to y but w belongs to y.
Solution:-
If w belongs to x
means all the elements of w will be in x.
. If x belongs to y
means all the elements of x will be in y.
hence all the elements of w will be in y . .
. Therefore x belongs to y
So, there is no such example.
SUBMITTED BY:- GROUP 14
Casino, Hotel & Racing - JamBase
ReplyDeleteFeaturing a 5-star hotel & racing track, the Casino, Hotel & Racing 하남 출장마사지 Casino features restaurants, 용인 출장마사지 bars, an outdoor swimming pool, 사천 출장마사지 free 여수 출장안마 WiFi, 문경 출장마사지 and a