Tuesday, November 16, 2010

                                                                     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
     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


                
 TEAM 13

1)      If statement q has the truth value 1, determine all truth value assignments for the primitive statements p,r and s for which the truth value of the statement
           (q -> [ (~p V r) ^ ~s ] )  ^  [ ~s -> ( ~r ^ q ) ]    is 1
P
r
s
~p
~pVr
~s
(~pvr)^~s
q-> [(~pvr)^~s]
~r
~r^q
~s-> (~r^q)
[q->((~pvr)^~s)]-> [~s->(~r^q)]
1
1
1
0
   1
0
0
       0
0
   0
          1
            0
1
1
0
0
   1
1
1
       1
0
   0
          0
            0
1
0
1
0
   0
0
         0
       0
1
   1
          1
            0
1
0
0
0
   0
1
         0
       0
1
   1
          1
            0
0
1
1
1
   1
0
         0
       0
0
   0
          1
            0
0
1
0
1
   1
1
         1
       1
0
   0
          0
            0
0
0
1
1
   1
0
         0
       0
1
   1
          1
            0
0
0
0
1
   1
1
         1
       1
1
   1
          1
            1






From  the  above  truth  table ,
P=0,  r=0 and s=0
                               
 

2) Verify that       [ (p<->q) ^ (q<->r) ^ (r<->p) ] ó [ (p->q) ^ (q->r) ^ (r->p) ]

p
Q
r
P<->q
q<->r
r<->p
(p<->q)^(q<->) ^(r<->p)
p->q
q->r
r->p
(p->q)^(q->r)^(r->p)
1
1
1
    1
   1
   1
        1
   1
  1
1
1
1
1
0
    1
   0
   0
        0
   1
  0
1
0
1
0
1
    0
   0
   1
        0
   0
  1
1
0
1
0
0
    0
   1
   0
        0
   0
  1
1
0
0
1
1
    0
   1
   0
        0
   1
  1
0
0
0
1
0
    0
   0
   1
        0
   1
  0
1
0
0
0
1
    1
   0
   0
        0
   1
  1
0
0
0
0
0
    1
   1
   1
        1
   1
  1
1
1

By comparing column no 7 and 11, we can say that
[ (p<->q) ^ (q<->r) ^ (r<->p) ]  ó  [ (p->q) ^ (q->r) ^ (r->p) ]

3) let p (x,y) , q (x,y) denote the following open statement,
p (x,y) :  x² ≥ y
q (x,y) : x+2 < y
if the universe for each of x , y consists of all real numbers , determine the truth value for each of the following statements.
è
Given : p (x,y) :  x² ≥ y
             q (x,y) : x+2 < y
where   x , y €  R.

A)  p (2,4)
è  2² ≥ 4 
       i.e  4 = 4
       .’. P (x,y) IS TRUE.

B) q(1,Π )
è 1+2 < Π
      i.e  3<Π
 .’. q (1,Π ) IS TRUE .            [ ‘.’ Π=3.142]

C)  p (-3 ,8 ) ^ q (1 ,3)
è  ((-3)² ≥ 8) ^ (1+2 < 3)
       (9≥8)  ^   (3<3)
       TRUE   ^   FALSE
  .’. FALSE

D) p (1/2 ,1/3)  V  ~q (-2 ,-3)
è  (1/4 ≥ 1/3)  V  (~ ( -2 + 2 < -3))
       FALSE     V     ~ ( FALSE )
       FALSE    V   TRUE
   .’.  TRUE.

E) p ( 2,2 )àq ( 1,1 )
è  (4 ≥ 2)à (3 < 1)
       TRUEàFALSE
    .’. FALSE.

F) p (1 ,2)ßà (~ q(1 ,2))
è  (1 ≥ 2)ßà(~ ( 3 < 2 ))
       FALSE ßà (~( FALSE))
       FALSE ßà TRUE
   .’. FALSE








4)
a) how many sub sets of {1,2,3,……11} contains at least one even integer.

b) how many sub sets of {1,2,3,……12} contains at least one even integer.

c) generalize the results of part (a) and (b)

è
We know that ,
Number of sub sets of a set X is given by 2ⁿ.
Where ‘n’ is the number of elements in X.  i.e  n = |X|.

 a)  let A={1,2,3,…….11}
      here |A| = 11,
     ,’. Total Sub sets of A = 2¹¹
                                                     = 2048.

Now considering only odd integers in A,
  |A|(odd)=6
 .’. Sub sets of odd integers of A = 64

.’. sub sets containing at least one even integer is given by
   A(even) = total sub sets of A – sub sets with only odd integers
                     = 2048 – 64
                     = 1984.
                 
b)  let B={1,2,3,…….12}
      here |B| = 12,
     ,’. Total Sub sets of B = 2¹²
                                                     = 4096.

Now considering only odd integers in B,
  |B|(odd)=6
 .’. Sub sets of odd integers of B = 64

.’. sub sets containing at least one even integer is given by
   B(even) = total sub sets of B – sub sets with only odd integers
                     = 4096 – 64
                     = 4032.
                 


c) In general let the number of even integers in the given set be n then,
If n is even, then
   total number of  sub sets contains at least one even integer.=[2n-2n/2]
If n is odd, then
   total number of  sub sets contains at least one even integer.=[2n-2(n+1)/2]