Professional Documents
Culture Documents
Module I - Discrete Mathematics II CSE
Module I - Discrete Mathematics II CSE
III SEMESTER
CSE
MATHEMATICS
Presented by
Dr.N.Murugavalli
Associate Professor
Department of Mathematics
Sri Eshwar College Of Engineering
Dr.N.Murugavallii, ASP/ MATHEMATICS,
1
SECE
Module 1
Propositional calculus
COURSE OUTCOME:
CO 1: Apply principles and fundamental
concepts of inference theory in proving and
testing the logics
T T F T T T T
T F F F T F F
F T T F T T F
F F T F F T T
E4 : P(QR) (PQ)R
E5 : (PQ) P (Q)
E6 : PQ (PQ)(QP) (BICONDITIONAL AS DISJUNCTION)
T T F F T F F T
T F F T F T T T
F T T F F T T T
F F T T F T T T
T T T T T
T F T T T
F T T T T
F F F F T
¬(P ˅( Q ˄ (P ˅ Q ) ˄ (P ˅ R Given
P Q R Q ˄ R P ˅( Q ˄ R) P˅Q P˅R
R)) ) formula
T T T T T F T T T F
T T F F T F T T T F
T F T F T F T T T F
T F F F T F T T T F
F T T T T F T T T F
F T F F F T T F F F
F F T F F T F T F F
F F F F F T F F F F
Hence, (P ˄ Q) → (P ˅ Q) is a tautology.
SOLUTION:
[¬ P ˄ (¬ Q ˄ R ) ] ˅[( Q ˄ R ) ˅ ( P ˄ R )]
≡ [(¬ P ˄ ¬ Q) ˄ R ] ˅ [ (Q ˅ P) ˄ R )] [BY (1) & (2)]
≡ [ (¬ P ˄ ¬ Q) ˅ ( P ˅ Q) ] ˄ R [BY (2)]
≡ [¬(P ˅ Q) ˅ ( P ˅ Q) ] ˄ R [BY (5)]
≡T˄ R [BY (3)]
≡ R [BY (4)]
Hence, [¬ P ˄ (¬ Q ˄ R ) ] ˅[( Q ˄ R ) ˅ [( P ˄ R )] ≡ R
NOTE: FORMULAE
ASSOCIATIVE LAW
P ˄ (Q ˄ R) ≡ ( P ˄ Q ) ˄ R → (1)
DISTRIBUTIVE LAW
P ˄ (Q ˅ R) ≡ ( P ˄ Q ) ˅( P ˄ R)] → (2)
COMPLEMENT LAW: P ˅ ¬P ≡ T → (3)
IDENTITY LAW: P ˄ T ≡ P → (4)
DE MORGAN’S LAWDr.N.Murugavallii,
: ¬(P ˅ Q) ≡ ¬P˄¬Q
ASP/ MATHEMATICS,
→ (5)
25
SECE
2. Show that P → (Q → R) ≡ P → (¬ Q ˅ R) ≡ (P ˄ Q ) → R
Solution:
TO PROVE: (1) ⇔ (2) ⇔ (3) (OR) (1)≡(2)≡(3)
CLAIM: (1)≡(2)
(1)≡ P → (Q → R) ≡ P → (¬ Q ˅ R) [Since P → Q ≡ ¬ P ˅ Q ]
(1)≡(2)
CLAIM: (2)≡(3)
(2) ≡ P → (¬ Q ˅ R) ≡ ¬P ˅ (¬ Q ˅ R) [Since P → Q ≡¬P ˅ Q]
≡ (¬P ˅ ¬ Q ) ˅ R [AL:P ˅ (Q ˅ R) ≡ (P ˅ Q) ˅ R]
≡ ¬ (P ˄ Q ) ˅ R [DL:¬(P ˄ Q) ≡ ¬P˅¬Q]
≡ (P ˄ Q ) → R [Since P → Q ≡ ¬ P ˅ Q ]
(2)≡(3)
Hence, (1)≡(2)≡(3)
Dr.N.Murugavallii, ASP/ MATHEMATICS,
26
SECE
3. Show that ¬(P ˄ Q ) →[¬P ˅ (¬ P ˅ Q)] ≡ (¬ P ˅ Q)
Solution:
¬(P ˄ Q ) →[¬P ˅ (¬ P ˅ Q)]
≡ ¬(P ˄ Q ) →[(¬P ˅ ¬ P) ˅ Q] [AL:P ˅ (Q ˅ R) ≡ (P ˅ Q) ˅ R]
To prove Equivalence, (p ˅ q ) ˄ (p → r ) ˄ (q → r )
≡ (p ˅ q ) ˄ ((p ˅ q ) → r ) ≡ r.
P˄Q P˅Q
P˄¬Q P˅¬Q
¬P˄Q ¬P˅Q
¬P˄¬Q ¬P˅¬Q
Minterms Maxterms
P˄Q˄R P˅Q˅R
¬P ˄ Q ˄ R ¬P ˅ Q ˅ R
P ˄ ¬Q ˄ R P ˅ ¬Q ˅ R
P ˄ Q ˄ ¬R P ˅ Q ˅ ¬R
¬P ˄ ¬Q ˄ R ¬P ˅ ¬Q ˅ R
P ˄ ¬Q ˄ ¬R P ˅ ¬Q ˅ ¬R
¬P ˄ Q ˄ ¬R ¬P ˅ Q ˅ ¬R
¬P˄¬Q˄¬R ¬P ˅ ¬Q ˅ ¬R
((PQ) F ) ((P R) F )
PF P
(( P Q) F )(( P R) F )
((PQ)(RR)) (( PR)(QQ))
(PP) F
((PQ)(RR)) ((PR)(QQ))
(PQR) (PQ R) (PRQ)
(PRQ) ( PQR) (PQR) Distributive Rule
(PRQ) ( PRQ)
(PQR) (PQ R) (PQR)
Commutative Rule
( PQR) (PQR) (PQR)
6 ≡ (P ˅ Q) ˄ (¬P ˅ ¬ Q ) P ˄P ≡ P
PCNF of S = (P ˅ Q) ˄ (¬P ˅ ¬ Q )
PCNF of ¬ S = Product of remaining max-terms
= (¬P ˅ Q) ˄ (P ˅ ¬ Q )
PDNF S = ¬ (PCNF of Dr.N.Murugavallii,
¬ S )= (PSECE Q ) ˅ (¬ P ˄ Q ).
˄¬ MATHEMATICS,
ASP/
46
Dr.N.Murugavallii, ASP/ MATHEMATICS,
47
SECE
Dr.N.Murugavallii, ASP/ MATHEMATICS,
48
SECE
Dr.N.Murugavallii, ASP/ MATHEMATICS,
49
SECE
Dr.N.Murugavallii, ASP/ MATHEMATICS,
50
SECE
Obtain the PCNF & PDNF of (QP) (PQ)
SOLUTION:
Let S: (QP) (PQ)
Conclusion
A statement which is obtained finally from the given set of
premises is known as conclusion
Inference Theory
It deals with the rules that are applied to reach the conclusion
from the premises.
Methods
Direct method- (P1 ˄ P2 ˄…. ˄ Pn )→ C
Indirect method- [(P1 ˄ P2 ˄…. ˄ Pn )˄ ¬ C] →F
In consistent premises. – (P1 ˄ P2 ˄…. ˄ Pn )→F
Dr.N.Murugavallii, ASP/ MATHEMATICS,
58
SECE
Rules of Inference:
Rule P: A premise may be introduced at any point of
derivation
Rule T: A formula S may be introduced at any point in
a derivation if S is tautologically implied by
any one or more of the preceding formulas
(Tautological rules)
Rule CP: If S can be derived from R and set of premises
then R S can be derived from the set premises
alone [Only for if …. then form. Introduce LHS as
additional premises].
Note: Rule CP means Rule of Conditional Proof
Dr.N.Murugavallii, ASP/ MATHEMATICS,
59
SECE
TYPE 1: Problems on Direct method
1 P→Q P Premises
2 Q→R P Premises
P→R T , (1, 2)
3 (P → Q) , (Q → R) ⇒ P → R
Premises
4 P P
T , (3, 4)
5 R P , (P → Q) ⇒ Q
Dr.N.Murugavallii, ASP/ MATHEMATICS,
60
SECE
2. Show that R ˅ S follows logically from the premises C ˅ D,
(C ˅ D) → ¬ H, ¬ H → (A ˄ ¬ B), (A ˄ ¬ B) → (R ˅ S).
Solution:
S.No Premises RULE Reason
1 (C ˅ D) → ¬ H P Premises
2 C˅D P Premises
3 ¬H T, (1, 2) P , (P → Q) ⇒ Q
¬ H → (A ˄ ¬ B)
4 P Premises
(A ˄ ¬ B)
4 T, (3, 4) P , (P → Q) ⇒ Q
5 (A ˄ ¬ B) → (R ˅ S) P Premises
6 (R ˅ S) T, ( 4, 5) P , (P → Q) ⇒ Q
3 ¬P T, (1, 2) P , (P → Q) ⇒ Q
4 P˅Q P Premises
Q (P ˅ Q) ˄¬ P⇒ Q
5 T, (3, 4)
6 Q→R P Premises
P , (P → Q) ⇒ Q
7 R T, (6, 5)
8 R ˄ (P ˅ Q) T , (4, 7) P, Q ⇒ P ˄Q
Dr.N.Murugavallii, ASP/ MATHEMATICS,
62
SECE
4. Show that S ˅ R is tautologically implied P ˅ Q, P → R, Q → S.
Solution
P Premises RULE Reason
1 P˅Q P Premises
2 ¬P→Q T, (1) ¬P ˅ Q ⇒ P →Q
3 Q→S P Premises
4 ¬P→S T, (2, 3) (P → Q) , (Q → R) ⇒ P → R
¬S→P P → Q ⇒ ¬Q →¬P
5 T, (4)
6 P→R P Premises
7 ¬S→R T, (5, 6) (P → Q) , (Q → R) ⇒ P → R
8 S˅R T , (7) ¬P ˅ Q ⇒ P →Q
1 (A → B) ˄ (A → C) P Premises
3 ¬ (B˄C) P Premises
4 ¬A T, (2, 3) ¬Q , (P → Q) ⇒ ¬P
5 D˅A P Premises
6 D T , (4, 5) (P ˅ Q) ˄¬ P⇒ Q
3 S→¬Q P Premises
4 ¬R → ¬Q T, (2, 3) (P → Q) , (Q → R) ⇒ P → R
5 Q→R T P → Q ⇒ ¬Q →¬P
6 R → ¬Q P Premises
7 Q → ¬Q T , (5, 6) (P → Q) , (Q → R) ⇒ P → R
¬Q ˅ ¬Q ¬P ˅ Q ⇒ P →Q
8 T, (7)
9 ¬Q T, (8) ¬P ˅ ¬P ⇒ ¬P
10 P→ Q P Premises
11 ¬P ¬Q , (P
T, (9, 10) ASP/ MATHEMATICS,
Dr.N.Murugavallii, → Q) ⇒ ¬P 65
SECE
INFERENCE THEORY PROBLEMS ON
PROPOSITION
TYPE 2: BASED ON RULE CP
Rule CP: If S can be derived from R and
set of premises then R→S can be derived
from the set premises alone
[Only for if …. then form. Introduce LHS as
additional premises].
Dr.N.Murugavallii, ASP/ MATHEMATICS,
66
SECE
7. Show that R → S can be derived from , ¬ R ˅ P, P→ (Q → S),
Q using CP rule.
Solution
S.No Premises RULE Reason
1 R AP Additional Premises
2 ¬R˅P P Premises
3 R→P T (2) P → Q ⇒ ¬P ˅ Q
4 P T (1, 3) P , (P → Q) ⇒ Q
5 P→ (Q → S) P Premises
6 Q→S T( 4, 5) P , (P → Q) ⇒ Q
7 Q P Premises
8 S T, (6, 7) P , (P → Q) ⇒ Q
9 R→S CP rule
Dr.N.Murugavallii, ASP/ MATHEMATICS,
67
SECE
Without CP rule
S.No Premises RULE Reason
1 P→ (Q → S) P Premises
2 ¬R˅P P Premises
3 R→P T (2) P → Q ⇒ ¬P ˅ Q
4 R→ (Q → S) T (1, 3) (P → Q) , (Q → R) ⇒ P → R
7 Q→ (R→ S) T, (6) P → Q ⇒ ¬P ˅ Q
8 Q P Premises
9 R→S T, (7, 8) P , (P → Q) ⇒ Q
Dr.N.Murugavallii, ASP/ MATHEMATICS,
68
SECE
8. Show that P→ (Q → S) can be derived from P→ (Q → R),
Q→ (R → S).
Solution
S.No Premises RULE Reason
1 P AP Additional Premises
2 P→ (Q → R) P Premises
3 Q→R T, (1, 2) P , (P → Q) ⇒ Q
4 Q→ (R → S) P Premises
5 ¬Q˅ (¬R˅ S) T, (4) P → Q ⇒ ¬P ˅ Q
6 ¬R˅ (¬Q˅ S) T, (5) P˅ (Q˅ R) ⇒(P˅ Q)˅ R
7 R → (¬Q˅ S) T, (6) P → Q ⇒ ¬P ˅ Q
8 Q→(¬Q˅ S) T, (3, 7) (P → Q) , (Q → R) ⇒ P → R
9 ¬Q˅(¬Q˅ S) T, (8) P → Q ⇒ ¬P ˅ Q
10 ¬Q˅ S T, (9) P˅P⇒P
11 Q→S T, (10) P → Q ⇒ ¬P ˅ Q
12 P→ (Q → S) CP rule
Dr.N.Murugavallii, ASP/ MATHEMATICS,
69
SECE
9. Show that (P ˅ Q) → R ⇒ (P ˄ Q) → R
Solution
1 (P ˄ Q) AP Additional Premises
2 P T, (1) P ˄ Q ⇒ P, Q
3 P˅Q T ( 2) P ⇒ P˅ Q
4 (P ˅ Q) → R P Premises
5 R T, (3, 4) P , (P → Q) ⇒ Q
1 ¬ (¬ P) ¬ Conclusion
2 P T (1) ¬ (¬ P) = P
3 P→ Q P Premises
4 Q T (2, 3) P , (P → Q) ⇒ Q
5 ¬Q P Premises
6 Q ˄ ¬Q T ( 4, 5) P,Q⇒P˄Q
Q ˄ ¬Q⇒F
7 F T (6)
1 ¬ (¬ P) ¬ Conclusion
2 P T (1) ¬ (¬ P) = P
3 P→ Q P Premises
4 Q T (2, 3) P , (P → Q) ⇒ Q
5 ¬Q P Premises
6 Q ˄ ¬Q T ( 4, 5) P,Q⇒P˄Q
Q ˄ ¬Q⇒F
7 F T (6)
5 ¬r → ¬p T, (4) P → Q ⇒ ¬ Q → ¬P
6 s→ ¬p T, (3, 5) P , (P → Q) ⇒ Q
7 q˄s P Premises
8 q T, (7) P ˄ Q ⇒ P, Q
9 s T, (7) P ˄ Q ⇒ P, Q
10 r T, (2, 8) P , (P → Q) ⇒ Q
11 ¬r T, (3, 10) P , (P → Q) ⇒ Q
12 r ˄ ¬r T ( 10, 11) P,Q⇒P˄Q
13 F T (12)ASP/ MATHEMATICS,
Dr.N.Murugavallii, Q ˄ ¬Q⇒F
76
SECE
Aliter :
1 q→ r P Premises
2 s→ ¬r P Premises
3 q˄s P Premises
4 q T, (3) P ˄ Q ⇒ P, Q
5 s T, (3) P ˄ Q ⇒ P, Q
6 r T, (1,4) P , (P → Q) ⇒ Q
7 ¬r T, (2, 5) P , (P → Q) ⇒ Q
8 r ˄ ¬r T ( 6, 7) P,Q⇒P˄Q
9 F T (8) Q ˄ ¬Q⇒F
Solution:
Premises: P → ( Q ˅ R) , Q→ ¬ P, S→ ¬ R
Conclusion : P→ ¬ S
Premises: P → ( Q ˅ R) , Q→ ¬ P, S→ ¬ R
Conclusion : P→ ¬ S
S.No Premises Rule Reason
1 P AP Additional Premises
2 P → ( Q ˅ R) P Premises
3 Q˅R T, (1,2) P, (P → Q) ⇒ Q
4 Q→¬P P Premises
5 P→¬Q T, (4) P → Q ≡ ¬ Q→ ¬ P
6 ¬Q T, (1,5) P, (P → Q) ⇒ Q
7 ¬Q→R T, (3) P→Q≡¬P˅ Q
8 R T, (6, 7) P, (P → Q) ⇒ Q
9 S→ ¬ R P Premises
10 R→ ¬ S T, (8) P → Q ≡ ¬ Q→ ¬ P
11 ¬S T, (8, 10) P, (P → Q) ⇒ Q
12 P→ ¬ S CP rule
4. Show that the hypothesis
“ If you send me an e-mail message, then I will finish writing
the program”. “ If you do not send me an e-mail message, then
I will go to sleep early “and “ If I go to sleep early then I will
wake up feeling refreshed lead to the conclusion ‘ If do not
finish writing the program, then I will wake up feeling
refreshed.”
Solution:
Premises: p → q , ¬ p→ r, r→ s
Conclusion : ¬ q→ s.
Premises: p → q , ¬ p→ r, r→ s
Conclusion : ¬ q→ s.
Premises: A → B , C ˅ ¬ B, D→ ¬ C
Conclusion : A→ ¬ D.
Premises: A → B , C˅ ¬ B, D→ ¬ C
Conclusion : A→ ¬ D.
Premises: ¬ A ˄ B , C → A, ¬ C → D, D → E
Conclusion : E.
Premises: ¬ A ˄ B , C → A, ¬ C → D, D → E
Conclusion : E.
Types of Quantifiers
Try this! (i) (∀x) P(x) → P(y) (ii) (∃y) (P(y)→ (∀x) P(x))
Symbolic Representation of Expressions using Quantifiers
1. Write in symbolic form the statement, "All lions are dangerous”
Solution
P(x): x is dangerous
Q(x): x is a lion
Universe of discourse : Set of all living things
Symbolic form: (x) (Q(x) → P(x)).
2. "Some animals are dangerous". Write in Symbolic form.
Solution
A(x): x is an animal
B(x): x is dangerous
Symbolic form (∃x) (A(x) ˄ B(x))
3. Symbolize the statement
(i) All dogs bark
(ii) All men should be educated.
(iii) All complex numbers composed of real and imaginary
parts.
Solution :
Symbolic form:
(i) P(x): x is a dog
Q(x): x barks
⇒ (∀x)( P(x) → Q(x))
Universe of discourse: Set of animals.
Try this!
PREMISES OR HYPOTHESIS
A statement which is basically assumed as true is known as premises or
hypothesis.
CONCLUSION
A statement which is obtained finally from the given set of premises is
known as conclusion
INFERENCE THEORY
It deals with the rules that are applied to reach the conclusion from the
premises.
METHODS
Direct method - (P1 ˄ P2 ˄…. ˄ Pn) → C
Indirect method - [P1 ˄ P2 ˄…. ˄ Pn ˄ C] → F
In consistent premises. – (P1 ˄ P2 ˄…. ˄ Pn) → F
THE THEORY OF INFERENCE FOR PREDICATE
CALCULUS
1) (x)(P(x)) P(y)
2) (x)(P(x)) P(x) , P(a), P(b)
P(y) (x)(P(x))
(x)(P(x)) P(y)
P(y) (x)(P(x))
LOGICAL EQUIVALENCE AND IMPLICATION
EQUIVALENCE
IMPLICATION
Solution:
Hence, (x)[H(x)M(x)]H(s)M(s).
Problem 4:
Prove that (x) (P(x) S(x)) , (x) (P(x) R(x)) (x) (R(x) S(x))
Solution:
4 P(y) US (3)
T (3),(4) , P , P Q
5 Q(y)
Q
6 (x) Q(x) UG (5)
- Gudder
Thank you