Discrete Maths Notes Part A and B
Discrete Maths Notes Part A and B
PART – A
1. Get the contra positive of the statement “If it is raining then I get wet”
Ans: Let p: it is raining and q: I get wet
Given p → q. Its contra positive is given by q → p
That is “If I don‟t get wet then it is not raining”
2. Is it true that the negation of a conditional statement is also a conditional statement?
Ans: No, because ( p → q) ≡ ( p q) ≡ p q
3. Find a counter example,if possible, to these universally quantified statements, whose the universe of
discourse for all variables consists of all integers. [November 2014]
(a) x y ( x 2 y
2
x y).
(b) x y ( xy x ) .
Ans: (a) 𝑥 = 2, 𝑦 = −2 and (b) 𝑥 = 17, 𝑦 = −1
4. Show that the propositions p q and p q are logically equivalent.
Ans:
P q p pq pq
T T F T T
T F F F F
F T T T T
F F T T T
5. Show that p q r p q r without using truth tables.
Ans: p q r p q r p q r p q r p q r
6. Show that p p q is a tautology.
Ans: p p q p p q p p q T q T
7. Write the truth table for the formula p q p q [November 2012]
Ans:
P q p q pq pq
p q p q
T T F F T F T
T F F T F F F
F T T F F F F
F F T T F T T
p q p p q q p q
p q p q
13. Rewrite the following using quantifiers “Every student in the class studied calculus”.
Ans: Let 𝑃(𝑥): 𝑥 is a student and 𝑄(𝑥): 𝑥 studied calculus
Symbolic form x P ( x ) Q ( x )
14. Check whether p q r p is a tautology.
Ans:
p q r p p q r p p q r p p q r p
r p p r p q T r p q r p q
The given statement is not a tautology
15. Write the statement in symbolic form “Some real numbers are rational”.
Ans: Let 𝑅(𝑥): 𝑥 is a real number and 𝑄(𝑥): 𝑥 is rational
Symbolic form: x R x Q x .
16. Show that (p q) (q r) and ( p q ) r are logically equivalent. [November 2014]
Ans:For ( p q ) ( q r ) to be false, one of the two implications must be false, which happens exactly
when r is false and at least one of p and q is true, but these are precisely the cases in which p q is true
and r is false. Which is precisely when ( p q ) r is false. Since the two propositions are false in
exactly the same situations they are logically equivalent.
18. Write the statement in symbolic form “Some integers are not square of any integers”.
Ans: Let 𝐼(𝑥): x is an integer and S(x): x is a square of any integer Symbolic
form: x I ( x ) S ( x ) .
19. Define Contradiction.
Ans: A propositional formula which is always false irrespective of the truth values of the individual
variables is a contradiction.
20. Define Universal quantification and Existential quantification.
Ans: The Universal quantification of a predicate formula P(x) is the proposition, denoted by xP ( x ) that
is true if P (a) is true for all subject a.
The Existential quantification of a predicate formula P(x) is the proposition, denoted by xP ( x ) that is true
if P(a) is true for some subject a.
PART – B
1(a) What is meant by Tautology? Without using truth table, show that
(( P Q ) ( P ( Q R ))) ( P Q ) ( P R ) is a tautology.
Solution: A Statement formula which is true always irrespective of the truth values of the individual
variables is called a tautology.
Consider ( P ( Q R ) ( P (Q R ) P (Q R ) ( P Q ) ( P R ) (1)
Consider ( P Q ) ( P R ) ( P Q ) ( P R ) (( P Q ) ( P R )) (2 )
Using (1) and (2)
(( P Q ) ( P Q ) ( P R )) (( P Q ) ( P R ))
[( P Q ) ( P R )] [( P Q ) ( P R )] T
1(b) Prove the following equivalences by proving the equivalences of the dual
(( P Q ) ( P Q )) ( P Q ) P
Solution: It‟s dual is
(( P Q ) ( P Q )) ( P Q ) P
Consider,
(( P Q ) ( P Q )) ( P Q ) P Reasons
((P Q) ( P Q))(P Q ) (Demorgan‟s law)
((Q P) ( Q P))(P Q)
(Commutative law)
(Distributive law)
((Q Q) P) (PQ )
(PP T)
( T P)(PQ )
( P T P)
P( PQ )
(Absorption law)
P
2(a) Prove that ( P Q ) ( R Q ) ( P R ) Q .
Solution:
(P Q)(R Q) Reasons
Demorgan‟s law
(P R)Q
since P Q PQ
P R Q
2(b) Obtain DNF of Q ( P R ) (( P R ) Q ) .
Solution:
Q ( P R ) (( P R ) Q )
( Q ( P R )) ( (( P R ) Q ) ( D e m o rg a n la w )
( Q ( P R )) (( P R ) Q ) ( D e m o rg a n la w )
( Q ( P R )) ( Q Q ) (( P R ) P R ) (( P R ) Q )
( E x te n d e d d is trib u te d la w )
( P Q R ) F ( F R R ) ( P Q R ) ( N e g a t io n la w )
( P Q R ) ( P Q R ) ( N e g a t io n la w )
3(a) Obtain Pcnf and Pdnf of the formula ( P Q ) ( P Q)
Solution:
Let S = ( P Q ) ( P Q )
P Q P Q P Q P Q S Minterm Maxterm
T T F F F F T P Q
T F F T T T T P Q
F T T F T T T P Q
F F T T T F F P Q
P P Q P ~ P ( P (~ Q P ))
~ P (P ~ Q) ( P P)
(~ P T ) ( P ~ Q ) ( P P )
(~ P ( Q ~ Q ) ( P ~ Q )) ( P ( Q ~ Q ))
(~ P Q ) (~ P ~ Q ) ( P ~ Q ) ( P Q ) ( P ~ Q )
(~ P Q ) (~ P ~ Q ) ( P ~ Q ) ( P Q )
4(a) Without constructing the truth table obtain the product-of-sums canonical form of the formula
( P R ) ( Q P ). Hence find the sum-of products canonical form.
Solution:
Let
S (P R) (Q P)
( ( P ) R ) (( Q P ) ( P Q ))
(P R)(Q P)(P Q )
[( P R ) F ] [( Q P ) F ] [( P Q ) F ]
[( P R ) ( Q Q ) [( Q P ) ( R R )] [( P Q ) ( R R )]
( P R Q ) ( P R Q ) ( Q P R ) ( Q P R )
(P Q R)(P Q R )
S ( P R Q ) ( P R Q ) ( P Q R ) ( P Q R ) ( P Q R ) (Pcnf)
S The remaining maxterms of P,Q and R.
S (PQR) ( P Q R ) ( P Q R ).
( S ) Apply duality principle to S
S (PQ R) (PQ R) (PQ R) (PDNF)
4(b) Obtain the PDNF and PCNF of P ( P (Q ( Q R ))).
Solution:
P ( P ( Q ( Q R )))
(P Q R)
S (PQ R )
S (( P Q R ) ( P Q R ) ( P Q R )
( P Q R ) ( P Q R ) ( P Q R ) ( P Q R ))
1) p ( q r) Rule P
2) p Rule P
3) ( q r) Rule T, 1,2
4) p s Rule AP
5) s Rule T,4
6) s ~r Rule P
7) ~r Rule T, 5, 6
8) q Rule T3,7
9) q ~p Rule P
10) ~P Rule T, 8, 9
11) p ~p Rule T, 2,10
12) F Rule T, 11
5(b) Prove that the premises a ( b c ), d ( b c ), an d ( a d ) are inconsistent.
Solution:
{1} a d Rule P
{1} a,d Rule T
{3} a (b c ) Rule P
{1,3} b c Rule T
{1,3} bc Rule T
{6} d (b c ) Rule P
{6} (b c ) d Rule T
{6} (bc) d Rule T
{1,3,6} d Rule T
{1,3,6} d d Rule T
This is a false value. Hence the set of a premises are inconsistent
6(a) Use the indirect method to prove that the conclusion z Q ( z ) follows from the premises
x ( P ( x ) Q ( x )) and yP ( y)
Solution:
1 z Q ( z ) P(assumed)
2 z Q (z ) T, (1)
3 y P ( y) P
4 P (a ) ES, (3)
5 Q ( a) US, (2)
6 P ( a) Q ( a) T, (4),(5)
7 ( P (a) Q (a)) T, (6)
8 x ( P ( x ) Q (x )) P
9 P (a) Q (a) US, (8)
10 P (a) Q (a) ( P (a) Q (a)) T,(7),(9) contradiction
Hence the proof.
6(b) Show that R S can be derived from the premises P (Q S ), R P & Q
Solution:
R Assumed premises
R P Rule P
R P Rule T
P Rule T
P (Q S ) Rule P
Q S Rule P
Q Rule P
S Rule T
R S Rule CP
1) E S Rule P
2) S H Rule P
3) E H Rule T, 1,2
4) A ~ H Rule P
5) H ~A Rule T,4
6) E ~A Rule T,3,5
7) ~ E ~ A Rule T,6
8) ~(E A) Rule T,7
9) E A Rule P
10) (E A) ~ (E A) Rule T,8,9
Which is nothing but false
Therefore given set of premises are inconsistent
9(a) Show that the hypotheses,”It is not sunny this afternoon and it is colder than yesterday,” ” We will
go swimming only if it is sunny,” “If we do not go swimming then we will take a canoe trip,” and “If
we take a canoe trip, then we will be home by sunset “lead to the conclusion “we will be home by
sunset”.
Solution:
p – It is sunny this afternoon.
q- It is colder than yesterday
r- we will go swimming
s- we will take a canoe trip
t- we will be home by sunset
The given premises are p q , r p , r s & s t
Step Reason
p q Hypothesis
p step 1
r p Hypothesis
r moduus tollens step 2 &3
r s Hypothesis
s modus ponens step 4 &5
s t Hypothesis
t modus ponens step 6&7
Let P: 2 is irrational.
Assume ~P is true, then 2 is rational, which leads to a contradiction.
a
By our assumption is 2 , where a and b have no common factors ---------------(1)
b
2
2 a 2b
2
a
2
a2 is even. a = 2c
2
b
2b
2
4c
2
b
2
2c
2
b
2
is even b is even as well.
a and b have common factor 2 (since a and b are even)
But it contradicts (1)
This is a contradiction.
Hence ~P is false.
Thus P: 2 is irrational is true.
10(a) Let p, q, r be the following statements:
p: I will study discrete mathematics
q: I will watch T.V.
r: I am in a good mood.
Write the following statements in terms of p, q, r and logical connectives.
(1) If I do not study and I watch T.V., then I am in good mood.
(2) If I am in good mood, then I will study or I will watch T.V.
(3) If I am not in good mood, then I will not watch T.V. or I will study.
(4) I will watch T.V. and I will not study if and only if I am in good mood.
Solution:
(1) ( p q ) r
(2)r (p q)
(3) r (q p)
(4)(qp) r
10(b) Give a direct proof of the statement.”The square of an odd integer is an odd integer”.
Solution:
Given: The square of an odd integer is an odd integer”.
P: n is an odd integer.
Q:n2 is an odd integer
Hypothesis: Assume that P is true
Analysis : n=2k+1 where k is some integer.
n2=(2k+1)2=2(2k2+2k)+1
Conclusion: n2 is not divisible by 2.Therefore n2 is an odd integer.
P Q is true.
UNIT II COMBINATORICS
PART – A
1. State pigeon hole principle.
Ans: If (n+1) pigeons occupies n holes then at least one hole has more than 1 pigeon.
2. State the generalized pigeon hole principle.
m 1
Ans: If m pigeons occupies n holes (m>n), then at least one hole has more than 1 pigeons.
n
3. Show that, among 100 people, at least 9 of them were born in the same month.
Ans: Here no.of pigeon =m= no. of people =100
No. of holes = n= no. of month =12
1001
Then by generalized pigeon hole principle, 19 were born in the same month.
12
4. In how many ways can 6 persons occupy 3 vacant seats?
Ans: Total no of ways = 6 c3 = 20 ways.
5. How many permutations of the letters in ABCDEFGH contain the string ABC .
Ans: Because the letters ABC must occur as block, we can find the answer by finding no of permutation of
six objects, namely the block ABC and individual letters D,E,F,G and H . Therefore, there are 6! =720
permutations of the letters in ABCDEFGH which contains the string ABC.
6. How many different bit strings are there of length 7?
Ans: By product rule, 27=128 ways
7. How many ways are there to form a committee, if the committee consists of 3 educationalists and 4
socialist, if there are 9 educationalists and 11 socialist?
Ans: The 3 educationalist can be chosen from 9 educationalists in 9 c3 ways.
The 4 socialist can be chosen from 11 socialist in 11C 4 ways.
By product rule, the no of ways to select, the committee is = 9C 3.11C4 = 27720 ways.
8. There are 5 questions in a question paper in how many ways can a boy solve one or more questions?
Ans: The boy can dispose of each question in two ways .He may either solve it or leave it.
Thus the no. of ways of disposing all the questions= 2 5 .
But this includes the case in which he has left all the questions unsolved.
The total no of ways of solving the paper = 2 5 1 = 31.
9. If the sequence a n 3 .2 n , n 1 , then find the corresponding recurrence relation.
n
2 an
Ans: For n ≥ 1 an 3 . 2
n
, a n 1 3 .2
n1
3. a n 1 2 a n 1 an
2 2
a
n
2a
n 1
, for n≥1, with a0 3.
10. If seven colours are used to paint 50 bicycles, then show that at least 8 bicycles will be the same
colour.
Ans: Here, No. of Pigeon = 𝑚 = No. of bicycle=50
No. of Holes = 𝑛 = No. of colours = 7
5 0 1
By generalized pigeon hole principle, we have 1 8
7
11. Find the recurrence relation whose solution is S ( k ) 5 .2 k
5
S(k
k k1 k k
Ans: Given S ( k ) 5 .2 1) 5 .2 = .2 2 S ( k 1) 5 .2 S (k)
2
2 S ( k 1) S ( k ) 0 , w ith S ( 0 ) 5 is the required recurrence relation.
12. Find the associated homogeneous solution for na 3a 2n.
n 1
13. Solve S ( k ) 7 S ( k 1) 1 0 S ( k 2 ) 0
Ans: The associated homogeneous relation is S ( k ) 7 S ( k 1) 1 0 S ( k 2 ) 0
r 7 r 1 0 0 ( r 2 )( r 5 ) 0 r =2,5
2
Its characteristic equation is
The solution of associated homogeneous equation is k S A .2 k B .5 k
14. Define Generating function.
Ans: The generating function for the sequence„s‟ with terms a0 , a , .........a
1
…,of
n
real numbers is the
= anx .
n
n
infinite sum . G(x) = G(s,x) = a0 a x ......... a x .....
1 n
n0
15. Find the generating function for the sequence “S” with terms 1,2,3,4……..
1
( n 1) x
2
= (1 x )
n 2
Ans: G ( x ) G(s,x) =1 2 x 3 x .......... 2
.
n0 (1 x )
16. How many permutations of (a, b, c, d, e, f, g) end with a? [November 2014]
Ans: 6! 1!=720
17. Find the number of arrangements of the letters in MAPPANASSRR.
1 1! 3991680
Ans: Number of arrangements
3 !2 !2 ! 48
18. In how many ways can letters of the word “INDIA” be arranged?
Ans: The word contains 5 letters of which 2 are I‟s.
5!
The number of words possible = 60 .
2!
19. How many students must be in a class to guarantee that atleast two students receive the same score
on the final exam if the exam is graded on a scale from 0 to 100 points.
Ans: There are 101 possible scores as 0, 1, 2, …,100. By Pigeon hole principle, we have among 102
students there must be atleast two students with the same score. The class should contain minimum 102
students.
20 Show that among any group of five (not necessarily consecutive) integers, there are two with same
remainder when divided by 4.
Ans: Take any group of five integers. When these are divided by 4 each have some remainder.
Since there are five integers and four possible remainders when an integer is divided by 4, the
pigeonhole principle implies that given five integers, atleast two have the same remainder.
PART – B
1(a) n
n (n1)(2n1)
Using Mathematical induction prove that i
2
i 1
6
Solution:
n ( n 1) ( 2 n 1)
Let P(n) : 12 + 22 + …..+ n2 =
6
1 (1 1) ( 2 .1 1)
(1) Basic Step: P(1) : 12 = is true
6
k ( k 1) ( 2 k 1)
(2) Assume P(k) : 12 + 22 + …..+k2 = is true, where k is any integer.
6
k ( k 1) ( 2 k 1)
(3) P(k + 1) = 12 + 22 + …..+k2 + (k + 1)2 = ( k 1)
2
( k 1) [ ( k 1) 1] [( 2 ( k 1) 1]
=
6
|B D | |C D | | A B C | | A B D | | A C D|
|B C D || A B C D |
=125+83+50+35-41-25-17-16-11-7+8+5+3+2-1=193
The number of integers between 1 and 250 that is divisible by any of the integers 2, 3, 5 and 7=193
Therefore not divisible by any of the integers 2, 3, 5 and 7=250-193=57.
8(a) Solve the recurrence relation an 2 (a
n 1
a
n2
) where 𝒏 ≥ 𝟐 and a
0
1, a
1
2
a 2(a a )
n n 1 n2
a 2a 2a 0
n n 1 n2
2 4 4 (2) 2 i2
1 i
2 2
1 i ,1 i
n n
Solution is a n A (1 i ) B (1 i )
Where A and B are arbitrary constants
Now, we have
z x iy
r [cos i sin ]
1 y
tan
x
By Demoivre‟s theorem we have,
n n
(1 i ) [ 2 cos i sin ]
4 4
n n n
[ 2 ] cos i sin
4 4
n n n n
and (1 i ) [ 2 ] cos i sin
4 4
Now,
n n n n n n
a n A [[ 2 ] c o s i s in ] B [[ 2 ] c o s i s in ]
4 4 4 4
n n n
[ 2 ] ( A B ) c os i ( A B ) s in
4 4
n n n
an [ 2 ] C 1 c os C 2 s in ] (1)
4 4
Is the required solution. Let C =𝐴
1
+ 𝐵, C =𝑖(𝐴−𝐵)
2
Since 𝑎0 = 1, 𝑎1 = 2
(1) a ( 2 )[ C cos 0 C sin 0 ] 0
0 1 2
1 C
1
1
a 1 [ 2 ] C 1 cos C 2 sin ]
4 4
1 1
2 2 C1 C 2sin ]
2 2
2 C C
1 2
C 1
2
n n n
an [ 2 ] cos sin ]
4 4
2 2
1 5 1 5
f 1 f 1
2 2 1
2 2 2
2 2
(1 5) (1 5)
1 2
1
4 4
(1 5) (1 5) 4
2 2
...( 5 )
1 2
( 4 ) (1 5 )
5 ) (1 5)
2
(1 5) (1 2 (1 5) ...( 6 )
1 2
1 (1 5 ) [ 2 5 ] 2 (1 5)
1
1
5
1
4 ) (1 5) (1 5 ) 2 2
5
1
1 (1 5 ) 2 2
5
1
(1 5 ) 2 2 1
5
1
1
5
5 1
(1 5 ) 2
5
1
2
5
n n
1 1 5 1 1 5
( 3 ) fn
5 2
5 2
[November 2014]
Solution:
The unique Solution to this recurrence relation and the given initial condition is the sequence { a
n
} with
n n
a 1 2 2 .3
n
9(b) A factory makes custom sports cars at an interesting rate. In the first month only one car is made, in
the second month two cars are made and so on, with n cars made in the nth month.
(1) Set up recurrence relation for the number of cars produced in the first n months by this factory.
(2) How many cars are produced in the first year?
Solution:
(i) a n n a n 1 , a o 0 ( a 1 1, a 2 2 a 1 , e tc )
(ii) By recursively a 78
12
a
n0
n1x 2 a
n0
n x 4 n0
x 0
13x
G ( x )
(1 2 x )(1 4 x )
1 1
By Applying Partial fractions we get A , B
2 2
1 n n 1 n n
G ( x)
2
2 x
2
4 x
n0 n0
henceweget
n 1 n 1
an 2 2 ( 4)
10(b) Find the generating function of Fibonacci sequence.
Solution
Fibonacci sequence : fn f n 1 f n 2 , n 2 with f o 0, f 1
1
n n n
f nz f n1z f n2z
n2 n2 n2
2
G ( z ) f 0 f z1 z ( G ( z ) f 0) z ( G ( z ))
n
G(z)
n0
fnz
Where ( i.e ) G ( z ) z G ( z ) z 2 G ( z ) f0 f 1z z f 0
z
G ( z ) 2
1 z z
01.
UNIT III GRAPH THEORY
02.
03.
04.
a b 1 and a c 1
a ba c
Hence b = c.
7(a) Show that in a distributive lattice and complemented lattice a b a * b 0 a b 1 b a
Proof:
a b a * b 0 a b 1 b a
Claim 1: a b a * b 0
Since a b a b b , a * b a
Now a * b (( a * b ) * b ) ( a * b * b ) a * 0 0
Claim 2: a * b 0 a b 1
We have a * b 0
Taking complement on both sides, we have
a * b 0 ab1
Claim 3: a b 1 b a
a b 1 a b * b 1 * b a * b b * b b a * b 0 b
a * b b b a
Claim 4: b a a b
We have b a taking complement we get b a a b
7(b) In a Boolean algebra prove that a b ' a ' b '
Proof:
( a b ) ( a b ) { ( a b ) a } { ( a b ) b }
{ ( a a ) ( b a )} { ( a b ) ( b b )}
{1 ( b a )} { ( a b ) 1}
b b
1
( a b ) ( a b ) { ( a b ) a } { ( a b ) b }
{ a a b } { a b b }
{ 0 b } { a 0}
0
Hence proved.
8(a) In any Boolean algebra, show that ab a b 0 if and only if a = b
Proof:
Let a = b
Now ab a b aa a a 0 0 0
Conversely let ab a b 0
Now
a b a b 0 a b a b a b
and a a .1 a ( b b ) a b a b a b a b a a b 1 .b b
8(b)
Simplify ( i ) a * b a b ( ii ) a * b * c a * b * c a * b * c
Solution:
(i) a * b a b a b a * b
a b a * a b b a * b
(ii ) a * b * c a * b * c a * b * c ( a a ) * (b * c ) b * c
9(a) In a Boolean algebra prove that ( i ) a * a b a ( ii ) a a * b a for all a , b B
Proof:
( i ) a * a b ( a 0 ) * a b
a(0*b )
a (b*0)a 0a
Similarly by duality we have a a * b a
9(b) Show that in any Boolean algebra, a b b c c a a b b c c a
Proof:
a b b c c a a b 0 b c 0 c a 0
a b cc b c a a c a b b
a b c . a b c . b c a . b c a . c a b . c a b
a b cc b c a a c a b b
ab0 bc0 ca 0
a b b c c a
10(a) Show that in any Boolean algebra, a b b c c a a b b c c a .
Solution:
Let (B, +, 0, 1) be any Boolean algebra and a, b, c B.
a b b c c a a b .1 b c .1 c a .1
a b c a b c ab c ab c a bc a bc
( a b c a bc ) ( ab c a b c ) ( ab c a bc )
1. bc 1.ac1. ab
ab bc c a