You are on page 1of 121

DISCRETE MATHEMATICAL STRUCTURES

by
Dr. RAJENDRA KUMAR KONA

MATHEMATICAL LOGIC
Module -1
Couse outcomes
1. Write English sentences for logical expressions and vice-
versa. Use standard notations of propositional logic.
2. Complete and use truth tables for expressions involving the
following logical connectives: negation, conjunction,
disjunction, conditional, and biconditional.
3. Define and use the terms: proposition (statement), converse,
inverse, contrapositive, tautology, and contradiction.
4. Apply standard logical equivalences. Be able to prove that
two logical expressions are or are not logically equivalent.
5. Determine if a logical argument is valid or invalid. Apply
standard rules of inference including (but not limited to)
Modus Ponens, Modus Tollens, Transitivity, and Elimination.
Recognize fallacies such as the Converse Error and the
Inverse Error.
October 15, 2020 Dr. KRK 2
• What is logic
• Applications of Logic

October 15, 2020 Dr. KRK 3


Introduction to logic
• Logic is the basis of all mathematical reasoning, and
of all automated reasoning.
• Logic provides rules which are used to distinguish
between valid and invalid mathematical arguments.
• Logic is used in computer science to verify the
correctness of the program.
• It has practical applications to the design of
computing machines, to the specification of
systems, to artificial intelligence, to computer
programming, to programming languages, and to
other areas of computer science.
October 15, 2020 Dr. KRK 4
Propositions
• In the development of any theory, assertions
are made in the form of sentences.
• Such verbal or written assertions, called
statements or propositions.
• The statements (or propositions) are the
declarative sentences which are either true
or false, but not both

October 15, 2020 Dr. KRK 5


Proposition
• A proposition is a declarative sentence (that is, a
sentence that declares a fact) that is either true or
false, but not both.
• Ex: 1 + 1 = 2.
• 2 + 2 = 3.
• Kolkata is a country.
• Ex: not propositions
• How beautiful are you?
• What time is it?
• Read this carefully.

October 15, 2020 Dr. KRK 6


Logical operators
(Basic connectives)
• Negation operator (┐ or ~)
• Conjunction (and ^)
• Exclusive Or
• Disjunction (or v )
• Conditional statement →
• Bi-conditional statement →

October 15, 2020 Dr. KRK 7


Compound Propositions
• Negation (not) p
• Conjunction (and) pq
• Disjunction (or) p ꓦq
• Exclusive or pq
• Implication p→q
• Biconditional pq
• The order of precedence of these connectives
is ˥, ꓥ, ꓦ, →, ↔.
October 15, 2020 Dr. KRK 8
Truth Tables

• Negation: Let p be a proposition. The negation


of p, denoted by˥p (also denoted by p), is the
statement “It is not the case that p.”
• The proposition ˥p is read “not p.” The truth
value of the negation of p, ˥p, is the opposite of
the truth value of p.
• Truth Table for negation
p ┐p
T F
F T
October 15, 2020 Dr. KRK 9
Example
• What is the negation of each of these
propositions?
• a) Raj has a virtual video player.
• b) There is pollution in New Delhi.
• c) 2 + 1 = 3.
• Ans: a) Raj does not have virtual video player.
• b) It is not the case that there is pollution in
New Delhi.
• c) It is not true that 2+1=3
October 15, 2020 Dr. KRK 10
Observation
• If there is only one variable (say P), there are only two( 21) possibilities,
they are True(T) or False(F).
• For two variables(p&q)there are 4( 2 ) possibilities, they are T T, T F, F
T, F F.
2
• For three variables p,q,r,there are 8(23) possibilities, they are T T T,
T T F, T F T, T F F, F T T, F T F, F F T, F F F.
• Example: How many rows appear in a truth table for each of these
• compound propositions?
• a) p →¬ p
• b) (p ∨¬ r) ∧ (q ∨¬ s)
• c) q ∨ p ∨¬ s ∨¬ r ∨¬ t ∨ u
• d) (p ∧ r ∧ t) ↔(q ∧ t)
• Ans: A truth table will need 2 n rows if there are n variables.
• a) 21 = 2 b) 2 4 = 16 c) 2 6 = 64 d) 2 4 = 16

October 15, 2020 Dr. KRK 11


conjuction
• The conjunction of p and q, denoted by p ∧ q,
is the proposition “p and q.” The conjunction
p ∧ q is true when both p and q are true and
is false otherwise.

P Q P^Q
T T T
T F F
F T F
F F F
October 15, 2020 Dr. KRK 12
Example
• Let p and q be the propositions
• p : It is below freezing. q : It is snowing.
• Write these propositions using p and q and
logical connectives (including negations).
• a) It is below freezing and snowing.
• b) It is below freezing but not snowing.
• c) It is not below freezing and it is not
snowing.
• Ans: a ) p ꓥ q. b) pꓥ ┐q. c) ┐pꓥ ┐q.
• P: Jack went up the hill Q: Jill went up the hill
October 15, 2020 Dr. KRK 13
disjunction
• The disjunction of p and q, denoted by p ∨ q,
is the proposition “p or q.” The disjunction
p ∨ q is false when both p and q are false and is
true otherwise.
P Q PꓦQ

T T T
T F T
F T T
F F F
October 15, 2020 Dr. KRK 14
Example
• P: The earth is flat
• Q: 3+5=8
• P ∨ Q: The earth is flat or 3+5=8.
• The connective “∨” is not always the same as
the word “or” because it can be
• 1) Inclusive OR
Example: (P: buy a car, Q: buy a computer)
• 2) Exclusive OR
• Example: P: cse in engg. Q: Mech in engg.
• In logic we use Inclusive OR
October 15, 2020 Dr. KRK 15
exclusive OR
• The exclusive or of p and q, denoted by
(p ⊕ q), is the proposition that is true when
exactly one of p and q is true and is false otherwise.
p q p⊕ q

T T F

T F T

F T T

F F F

October 15, 2020 Dr. KRK 16


Conditional Statements
• The conditional statement p → q is the
proposition “ if p, then q.” The conditional
statement p → q is false when p is true and q
is false, and true otherwise.

• In the conditional statement p → q,


p is called the hypothesis (or antecedent or
premise) and q is called the conclusion (or
consequence).
October 15, 2020 Dr. KRK 17
Conditional Statements
P Q P→Q
T T T
Truth table :
T F F
F T T
F F T

• The following ways to express this conditional statement:


• “if p, then q” “p implies q”
• “if p, q” “p only if q”
• “p is sufficient for q” “a sufficient condition for q is p”
• “q if p” “q whenever p”
• “q when p” “q is necessary for p”
• “a necessary condition for p is q” “q follows from p”
• “q unless ¬p”

October 15, 2020 Dr. KRK 18


Examples: Write the following sentences in symbolic form

• P: There is flood
• Q: crop will be destroyed
• P → Q : If there is flood then the crop will be
destroyed.
• P: Rajesh will pass the exam
• Q: Rajesh works hard
• Q → P : If rajesh works hard then he will
pass the exam.

October 15, 2020 Dr. KRK 19


Example
• Let p, q, and r be the propositions
• p : You have the flu.
• q : You miss the final examination.
• r : You pass the course.
• Express each of these propositions as an
English sentence.
• a) p → q b) ¬q → r c) q →¬r d) p ∨ q ∨ r
• e) (p →¬r) ∨ (q →¬r) f ) (p ∧ q) ∨ (¬q ∧ r)

October 15, 2020 Dr. KRK 20


Example : Answers
• a) If you have flu then you will miss final
examination.
• b) If you don’t miss the final exam then you
will pass the course.
• c) If you miss the final exam then you have
not passed the course.
• e) If you have flu then you have not pass the
course (or) if you miss the final exam then
you have not pass the course.

October 15, 2020 Dr. KRK 21


CONVERSE, INVERSE AND CONTRAPOSITIVE,
• We can form some new conditional statements
starting with a conditional statement p → q.
• The proposition q → p is called the converse of
p → q.
• The proposition ˥ p → ˥ q is called the inverse of
p → q.
• The contrapositive of p → q is the proposition
• ˥q → ˥p.

• The contrapositive always has the same truth


value as p → q.

October 15, 2020 Dr. KRK 22


Example
• P: It is -6 degrees
• Q: It is cold
• P → Q: If it is -6 degrees then it is cold
• Converse: Q →P: If it is cold then it is -6
degrees
• Inverse: ˥ P → ˥ Q: If it is not -6 degrees then
it is not cold.
• Contrapositive : ˥Q → ˥P: If it is not cold then
it is not -6 degrees
October 15, 2020 Dr. KRK 23
Practice
• The converse of the inverse of p → q is -------- of
p→q.
• The converse of the inverse of p → q is --------
of q → p .
• The inverse of the converse of p → q is the ------- of
p→q.
• The inverse of the converse of p → q is the ------- of
q→p.
• The inverse of the contrapositive of p → q is the ----
------ of p → q .

October 15, 2020 Dr. KRK 24


Anwswers

• Ans: Contrapositive
• The inverse of (p → q ) is (˥ p → ˥ q ) .
• Therefore the converse of (˥ p → ˥ q ) is
(˥q → ˥p), which is contrapositive of (p → q )
.
Answers: Inverse
Contrapositive
Inverse
Converse
October 15, 2020 Dr. KRK 25
BICONDITIONALS
• The bi-conditional statement p ↔ q is the
proposition “p if and only if q.”
• The bi-conditional statement p ↔ q is true
when p and q have the same truth values,
and is false otherwise.
• Truth table P Q P↔Q
T T T
T F F
F T F
F F T
October 15, 2020 Dr. KRK 26
Biconditional
• Bi-conditional statements are also called
bi-implications.
• the bi-conditional statement p ↔ q uses the
abbreviation “iff” for “if and only if.”
• Note that p ↔ q has exactly the same truth value
as (p → q) ∧ (q → p).
• That is p ↔ q ⇔ (p → q) ∧ (q → p).
• Example: P : You can take the flight.
• Q : You buy a ticket.
• Then P ↔ Q is the statement.
• “You can take the flight iff you buy a ticket”.
October 15, 2020 Dr. KRK 27
Construct the truth tables
• Construct a truth table for each of these
compound propositions.
• a) (p ∧ ˥ p) b) (p ∨ ˥ p) c) (p ∨ ˥ q) → q
• d) (p ∨ q) → (p ∧ q) p ˥p p∧˥p
• e) (p → q) ↔ (˥ q → ˥ p)
T F F
• f ) (p → q) → (q → p).
F T F

• Ans: a) F F b) T T c) T F T F d) T F F T
• e) T T T T f) T T F T
October 15, 2020 Dr. KRK 28
Truthtables
• Construct truth tables for (P→Q), (˥Pꓦ Q)

• 1)Sol: P Q ˥P P→Q ˥Pꓦ Q

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

P Q R Q→R P→(Q → R)
• 2) P→(Q → R) T T T T T
T T F F F
• Sol: T F T T T
T F F T T
F T T T T
F T F F T
F F T T T
F F F T T
October 15, 2020 Dr. KRK 29
Construct a truth table for each of these compound
propositions.
• 1) p → (˥ q ∨ r)
p q r ˥q ˥q ∨ r p → (˥q ∨ r)

T T T F T T
T T F F F F
T F T T T T
T F F T T T
F T T F T T
F T F F F T
F F T T T T
F F F T T T
October 15, 2020 Dr. KRK 30
2) ˥ p → (q → r)
p q r ˥p q → r ˥p → ( q →r)
T T T F T T
T T F F F T
T F T F T T
T F F F T T
F T T T T T
F T F T F F
F F T T T T
F F F T T T
October 15, 2020 Dr. KRK 31
practice
• Construct truth tables for:
• 1) (pꓦq) ꓦ ˥ p
• 2) ˥(˥ p ꓦ ˥ q) 3) ˥(˥ p ꓥ ˥ q)
• 4) (p ꓥ q)ꓦ(q ꓥ r)ꓦ(r ꓥ p)
• 5) (p→q) ꓥ (┐p→q) 6) p→(┐q ꓦ r)
• 7) [(pꓦ q) ꓥ (┐r)]↔ (q→ r)

• Ans: 1) TTTT 2) TFFF 3) TTTF


• 4) TTTFTFFF 5) TFTF 6) TFTTTTTT
• 7) FFFTFFFF
October 15, 2020 Dr. KRK 32
Construct truth tables for(contd..)
• 1) (pꓦq) ꓦ ˥ p
• Sol:
p q ˥p (pꓦq) (pꓦq) ꓦ ˥
p
T T F T T

T F F T T

F T T T T

F F T F T
October 15, 2020 Dr. KRK 33
7. [(pꓦ q) ꓥ (┐r)]↔ (q→ r)=A
P q r ┐r (pꓦ q) [(pꓦ q) ꓥ (q→ r) A
(┐r)]
T T T F T F T F
T T F T T T F F
T F T F T F T F
T F F T T T T T
F T T F T F T F
F T F T T T F F
F F T F F F T F
F F F T F F T F
October 15, 2020 Dr. KRK 34
Construct the truth table for
(p ꓥ q)ꓦ(q ꓥ r)ꓦ(r ꓥ p)
P q r pꓥq qꓥ rꓥ (p ꓥ q)ꓦ(q ꓥ (p ꓥ q)ꓦ(q ꓥ r)ꓦ(r ꓥ p)
r p r)

T T T T T T T T
T T F T F F T T
T F T F F T F T
T F F F F F F F
F T T F T F T T
F T F F F F F F
F F T F F F F F
F F F F F F F F
October 15, 2020 Dr. KRK 35
Tautology and contradiction
• Tautology: A statement formula which is true
regardless of the truth values of the statements
which replace the variables in it is called a
universally valid formula or a Tautology.
Example: (p ꓦ ˥ p) .

p ˥p pꓦ˥p

T F T
F T T
October 15, 2020 Dr. KRK 36
Tautology and contradiction(contd..)

• Contradiction: A statement formula which is false


regardless of the truth values of the statements
which replace the variables in it is called a
Contradiction.
p ˥p pꓥ˥
Example: (p ꓥ ˥ p) .
p
T F F
F T F
• Contingency : A statement formula which is neither
a tautology nor a contradiction is called a
contingency.
October 15, 2020 Dr. KRK 37
Practice
• Check whether the following are tautology,
contradiction or contingent.
• 1) (P→Q)↔(˥Pꓦ Q)
• 2) ((P → R)ꓥ(Q→ R))→((PꓦQ)→R)
• 3) ((p ꓦ q) → r)↔(˥ r→ ˥(p ꓦ q))
P Q ˥P P→Q ˥Pꓦ Q (P→Q)↔(˥Pꓦ Q)
• Ans: 1) Tautology
• 2) Tautology
T T F T T T
• 3) Contingent
T F F F F T
F T T T T T
F F T T T T

October 15, 2020 Dr. KRK 38


Determine whether each of the following form is a
tautology or a contradiction or neither
• 1) (p ꓥ q) → (p ꓦ q)
• Sol: p q (p ꓥ q) (p ꓦ q) (p ꓥ q) → (p ꓦ q)

T T T T T
T F F T T
F T F T T
F F F F T
• Therefore (p ꓥ q) → (p ꓦ q) is a Tautology.
• 2) (p ꓦ q) ꓥ(˥ p ∧ ˥ q)
• Sol: p q ˥p ˥q (p ꓦ q) (˥ p ∧ ˥ q) (p ꓦ q) ꓥ(˥ p ∧ ˥ q)
T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T F
October 15, 2020 Dr. KRK 39
Determine whether each of the following form is a
tautology or a contradiction or neither :
• 3) ˥P →(P →Q)
• Sol : P Q ˥P P →Q ˥P →(P →Q)

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

• Therefore ˥P →(P →Q) is a tautology.


October 15, 2020 Dr. KRK 40
Equivalence of formulas
• Def: Two formulas A and B are said to be
equivalent to each other if and only if
A↔B(A bi-conditional B) is a tautology.
• The symbol ⇔ is sometimes used instead of ≡ to denote logical
equivalence.

• Ex: (P→Q) ⇔ (˥ P ꓦ Q).


• Sol: P Q ˥P P→Q ˥Pꓦ Q (P→Q) ↔(˥ P ꓦ Q)

T T F T T T
T F F F F T
F T T T T T
F F T T T T
October 15, 2020 Dr. KRK 41
p ↔ q ⇔ (p → q) ∧ (q → p)

p q (p → q) (q → p) (p → q) ∧ (q → p) p↔q (p ↔ q ) ↔
p → q) ∧ (q → p)

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

October 15, 2020 Dr. KRK 42


1) (P ꓥ ˥ P ) ꓦ Q ⇔ Q

P Q ˥P Pꓥ˥ (P ꓥ ˥ P ) ꓦ Q (P ꓥ ˥ P ) ꓦ Q ↔Q
• Sol: P

T T F F T T

T F F F F T

F T T F T T

F F T F F T

October 15, 2020 Dr. KRK 43


Demorgans Laws: 1) ˥(p ∧ q) ⇔ ˥ p ∨ ˥ q
2) ˥(p ∨ q) ⇔ ˥ p ∧ ˥ q
• 1) Sol:

P Q ˥P ˥Q P∧Q ˥(P ∧ Q) ˥ P∨¬Q ˥(P∧ Q) ↔˥ P ∨¬ Q

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

October 15, 2020 Dr. KRK 44


Equivalence of formulas(practice)
1.Prove that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) Are
Logically Equivalent.
2. Show that p ↔ q and (p → q) ∧ (q → p) are
logically equivalent.
3. Prove ¬(p ꓦ (¬p ꓥ q)) ⇔ ¬p ꓥ ¬q.
4. Prove (p ꓥ q) → (p ꓦ q) ⇔ T.
5. Prove (p →q) ꓥ (p → r) ⇔ p → (q ꓥ r).

October 15, 2020 Dr. KRK 45


5.Prove (p →q) ꓥ (p → r) ⇔ p → (q ꓥ r) =A

P q r (p →q) (p → r) (p →q) ꓥ (p → r) (q ꓥ p → (q ꓥ r) A
r)

T T T T T T T T T
T T F T F F F F T
T F T F T F F F T
T F F F F F F F T
F T T T T T T T T
F T F T T T F T T
F F T T T T F T T
F F F T T T F T T
October 15, 2020 Dr. KRK 46
Logical Equivalences
Equivalence Name
p∧T⇔ p Identity laws
p∨F⇔ p
p∨T⇔T Domination laws
p∧F⇔F
p∨p⇔p Idempotent laws
p∧p⇔p
˥( ˥p) ⇔ p Double negation law
p∨q⇔q∨p Commutative laws
p ∧ q ⇔q ∧ p
(p ∨ q) ∨ r ⇔ p ∨ (q ∨ r) Associative laws
(p ∧ q) ∧ r ⇔ p ∧ (q ∧ r)
p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r) Distributive aws
p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r)

October 15, 2020 Dr. KRK 47


Logical Equivalences (contd)
Equivalence Name

(pꓦq)ꓥ(rꓦs) ⇔(p ꓥ r) ꓦ (p ꓥ s) Extended distributive law


ꓦ (q ꓥ r) ꓦ (q ꓥ s)

˥(p ∧ q) ⇔ ˥p ∨˥q De Morgan’s laws


˥(p ∨ q) ⇔ ˥p ∧˥q

p ∨ (p ∧ q) ⇔ p Absorption laws
p ∧ (p ∨ q) ⇔ p

p∨ ˥p⇔T Negation laws


p∧˥p⇔F
October 15, 2020 Dr. KRK 48
Logical Equivalences
Involving Conditional Statements.
p → q ⇔ ˥p ∨ q
p → q ⇔ ˥q →˥p
p ∨ q ⇔ ˥p → q
p ∧ q ⇔˥ (p →˥q)
˥(p → q) ⇔ p ∧˥q
(p → q) ∧ (p → r) ⇔ p → (q ∧ r)
(p → r) ∧ (q → r) ⇔ (p ∨ q) → r
(p → q) ∨ (p → r) ⇔ p → (q ∨ r)
(p → r) ∨ (q → r) ⇔(p ∧ q) → r
October 15, 2020 Dr. KRK 49
Logical Equivalences Involving Bi-conditional
Statements.

p ↔ q ⇔ (p → q) ∧ (q → p)
p ↔ q ⇔ ˥p ↔˥q
p ↔ q ⇔ (p ∧ q) ∨ (˥p ∧˥q)
˥(p ↔ q) ⇔ p ↔˥q
October 15, 2020 Dr. KRK 50
Substitution Instance
• A formula A is called a substitution instance of another
formula B if A can be obtained form B by substituting
formulas for some variables of B, with the condition that the
same formula is substituted for the same variable each time
it occurs.
• Example: Let B : P → (J ∧ P ).
• Substitute R↔S for P in B, we get
• : (R ↔ S) → (J ∧ (R ↔ S))
• Then A is a substitution instance of B.
• Note that (R ↔ S) → (J ∧P) is not a substitution instance of
B because the variables
• P in J ∧ P was not replaced by R ↔ S.

October 15, 2020 Dr. KRK 51


• Replacement process:
Consider the formula A: P → (Q → R).
The formula (Q → R) is a part of the formula A.
If we replace (Q → R) by an equivalent formula
(˥Q ∨ R) in A,
we get another formula B: P→ (˥Q ∨ R) .
(These two formulas A and B are equivalent to
each other)
This process of obtaining B from A is known as
the replacement process.
October 15, 2020 Dr. KRK 52
Prove that without using truth table
P → (Q → R) ⇔ P→ (˥Q ∨ R) ⇔(P ∧Q) → R
• Proof: We know that (Q → R) ⇔ (˥Q ∨ R) .
• Therefore P → (Q → R) ⇔ P→ (˥Q ∨ R)
(By replacing by an equivalent formula) and
• P→ (˥Q ∨ R) ⇔ ˥P ∨ (˥Q ∨ R)
⇔ (˥P ∨ ˥Q ) ∨ R (Associativelaw)
⇔ ˥(P ∧Q) ∨ R (Demorgans laws)
⇔(P ∧Q) → R

October 15, 2020 Dr. KRK 53


Without using truth table
• Prove that (˥P ∧(˥Q) ∧R) ∨(Q ∧R) ∨(P ∧R) ⇔ R
• Sol:
• (˥P ∧(˥Q) ∧R) ∨(Q ∧R) ∨(P ∧R)
• ⇔ ((˥P ∧˥Q) ∧R) ∨ ((Q ∨P) ∧R)(Assoc. and Dist.laws)
• ⇔ (˥(P ∨ Q) ∧R) ∨ ((Q ∨P) ∧R)(Demorgan’s laws)
• ⇔ (˥(P ∨ Q) ∨ (Q ∨P)) ∧R)(Distributive law)
• ⇔ (˥(P ∨ Q) ∨ (P ∨Q)) ∧R)(Distributive law)
• ⇔ T∧R (Since P ∨ ˥P is always a tautology)
• ⇔ R since T R T∧R
T T T
T F F
October 15, 2020 Dr. KRK 54
Without using truth table
• P↔Q ⇔(˥P ∨Q ) ∧(P ∨ ˥ Q) ⇔ (P ∧Q) ∨ (˥ P ∧ ˥ Q)
• Sol:
• P↔Q ⇔ (P → Q) ∧ (Q → P)
• (Since P → Q ⇔ ˥P ∨ Q)
• ⇔(˥P ∨Q ) ∧(P ∨ ˥Q) ----(1st result)
• ⇔(˥P ∧P) ∨ (˥P ∧ ˥Q) ∨(Q ∧P) ∨(Q ∧ ˥Q)
• (By Extended distributive law)
• ⇔F ∨ (˥P ∧ ˥Q) ∨(Q ∧P) ∨F
• ⇔ (˥P ∧ ˥Q) ∨(P∧Q) ----(2nd result)
• These two formulas are often used in normal forms.
October 15, 2020 Dr. KRK 55
Show that ˥(P↔Q ) ⇔ (P ∨Q ) ∧ ˥(P ∧Q)
• ˥(P↔Q )
• ⇔ ˥[(P → Q) ∧ (Q → P)]
• ⇔ ˥[(˥P ∨ Q) ∧ (˥Q ∨ P)]
• ⇔ ˥[(˥P∧˥Q) ∨ (˥P ∧ P) ∨(Q ∧˥Q) ∨ (Q ∧ P) ]
• ⇔ ˥[(˥P∧˥Q) ∨ F ∨ F ∨ (Q ∧ P) ]
• ⇔ ˥[˥(P ∨ Q) ∨ (P ∧ Q) ]
• ⇔ (P ∨ Q) ∧ ˥(P ∧ Q) ]

October 15, 2020 Dr. KRK 56


Tautological Implication
• Def: A statement A is said to tautologically
imply a statement B, iff A→B is a tautology.
We shall denote it by A ⇒B (read as A
implies B).
• Tautological implication can be checked by 3
methods:
• 1) By truth Table
• 2)By assigning truth value T to the
antecedent of the corresponding conditional
leads to the truth value T to the consequent.

October 15, 2020 Dr. KRK 57


Tautological Implication
• 3) Assume that the consequent B has the
value F then we show that this assumption
leads to A’s having the value F. Then A→B
must have the value T.
• Ex.
• 1) P.T. (P→Q) ⇒(˥Q→˥P)
• 2) P.T. ˥Q ꓥ(P→Q) ⇒ ˥P
• 3) Show that ˥(P→Q ) ⇒ P.

October 15, 2020 Dr. KRK 58


Solution
Method -1 1) Prove that (P→Q) ⇒(˥Q→ ˥P)

P Q ˥P ˥Q (P→Q) (˥Q→˥P) (P→Q) →(˥Q→˥P)

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

Method -2 : Prove that ˥Q ꓥ(P→Q) ⇒ ˥P


Assume that the antecedent ˥Q ꓥ (P→Q), has the truth
value T,
then both ˥Q and (P→Q) have the truth value T,
which means that Q has the value F.
But (P→Q) has the truth value T,
hence P must have the value F. Therefore ˥P is true.
October 15, 2020 Dr. KRK 59
Method -3
3) Show that ˥(P→Q ) ⇒ P.

• Assume that P is false(F), when P is false


(P→Q ) has T, then ˥(P→Q ) has F
• ˥(P→Q ) → P has T. P Q (P→Q)

• Therefore ˥(P→Q ) ⇒ P. T T T
T F F

F T T
F F T

October 15, 2020 Dr. KRK 60


NAND and NOR

• So far, we have defined the connectives


˥, ꓥ, ꓦ, →, ↔.
• Now we introduce two more connectives
NAND and NOR which have useful
applications in the design of computers.
• The word NAND is a combination of NOT and
AND
• The word NOR is a combination of NOT and
OR
October 15, 2020 Dr. KRK 61
NAND and NOR cond..
• Def: The connective NAND is denoted by the
symbol  , and is defined as for two variables
P and Q P  Q   ( P  Q) .
• Def: The connective NOR is denoted by the
symbol  , and is defined as for two variables
P and Q P  Q   ( P  Q) .
PQ P Q
P Q (P ∧Q) (P ∨Q)
T T T T F F
T F F T T F
F T F T T F
F F F F T T
October 15, 2020 Dr. KRK 62
Functionally complete sets of connectives
• Def: A set of connectives is said to be functionally
• complete sets of connectives if every formula can
• be expressed in terms of an equivalent formula
• containing the only from the set {˥, ꓥ, ꓦ}.
• Note: The set { ꓥ, ꓦ} is not functionally complete, as the
formula ˥P, is not possible to obtain an equivalent formula
containing only from the set {ꓥ,ꓦ}.
• Result: Prove that { }, {  } are functionally complete.
• Proof:
P  P  ( P  P )  P  P  P
( P  Q)  ( P  Q)   ( P  Q)  (( P  Q))  ( P  Q)
( P  P )  (Q  Q)  P  Q   (P  Q))  ( P  Q)
October 15, 2020 Dr. KRK 63
• P ↓ P ⇔ ¬(P ∨ P ) ⇔ ¬P ∧ ¬P ⇔ ¬P .
• (P ↓ Q) ↓ (P ↓ Q) ⇔ ¬(P ↓ Q)
• ⇔ ¬(¬(P ∨ Q)) ⇔ P ∨ Q.
• (P ↓ P ) ↓ (Q ↓ Q) ⇔ ¬P ↓ ¬Q
• ⇔ ¬(¬P ∨ ¬Q) ⇔ P ∧ Q.
• Therefore {↑}, {↓} are functionally
complete.

October 15, 2020 Dr. KRK 64


Duality Law

• Two formulas A and A∗ are said to be duals of


each other if either one can be obtained from
the other by replacing ∧ by ∨ and ∨ by ∧. The
connectives ∨ and ∧ are called duals of each
other. If the formula A contains the special
variable T or F , then A∗, its dual is obtained
by replacing T by F and F by T in addition to
the above mentioned interchanges.

October 15, 2020 Dr. KRK 65


• Example: Write the dual of the following formulas:
• (i). (P ∨ Q) ∧ R (ii). (P ∧ Q) ∨ T
• (iii). (P ∧ Q) ∨ (P ∨ ¬(Q ∧ ¬S))
• Solution: The duals of the formulas may be written
as (i). (P ∧ Q) ∨ R
• (ii). (P ∨ Q) ∧ F
• (iii). (P ∨ Q) ∧ (P ∧ ¬(Q ∨ ¬S))
• Result 1: The negation of the formula is equivalent
to its dual in which every variable is replaced by its
negation.
• We can prove
• ¬A(P1, P2, ..., Pn) ⇔ A∗(¬P1, ¬P2, ..., ¬Pn)
October 15, 2020 Dr. KRK 66
Normal Forms
• Satisfiable: Let A(p1,p2,… pn) be a statement
• formula where p1,p2,… Pn are the primitive
• variables. If A has the truth value T for at least one
• combination of truth value assigned to p1,p2,… pn
• then A is said to be satisfiable.
• Decision Problem: The problem of determining in a
• finite number of steps, whether a given statement
• formula is a tautology or a contradiction or at least
• satisfiable is known as decision problem.
• In this section we will denote the word “product” in
• place of conjunction and “sum” in place of disjunction.

October 15, 2020 Dr. KRK 67


Elementary product & Elementary sum
• Elementary product:
• A product of (statement) variables and their
• negations is called an Elementary product.
• Ex. P, ˥P, ˥PꓥQ, ˥Pꓥ˥Q , Pꓥ˥Q ꓥR are some
examples.
• Elementary sum:
• A sum of the variables and their negations is
• called an Elementary sum.
• Ex. P, ˥P, ˥P ꓦ Q, ˥P ꓦ ˥Q, ˥P ꓦ ˥Q ꓦR are
some examples.
October 15, 2020 Dr. KRK 68
Normal Forms
• Disjunctive Normal form(DNF): A formula which is equivalent to a given
• formula and which consists of a sum of elementary products is called a
• disjunctive normal form of the given formula.

• 1) Obtain a d.n.f. Pꓥ (P →Q)


• Ans: Pꓥ (P →Q) ⇔ P ꓥ (˥P ꓦ Q) ⇔ (P ꓥ ˥P) ꓦ (P ꓥ Q) which is a dnf.

• Conjunctive Normal form(CNF): A formula which is equivalent to a given


• formula and which consists of a product of elementary sums is called a
• conjunctive normal form of the given formula.

• 1) Obtain a c.n.f. Pꓥ (P →Q)


• Ans: Pꓥ (P →Q) ⇔ P ꓥ (˥P ꓦ Q) which is a cnf.

• Note: These two normal forms are not unique.


October 15, 2020 Dr. KRK 69
Normal Forms DNF and CNF procedures

October 15, 2020 Dr. KRK 70


1. Obtain a DNF of ˥(P ꓦ Q) ↔(P ꓥ Q)
• ˥(P ꓦ Q) ↔(P ꓥ Q) [Since(P↔Q ⇔(P ∧Q) ∨(˥P∧ ˥Q))]
• [refer slide 54]
• ⇔(˥(P ꓦ Q) ꓥ(P ꓥ Q) ) ꓦ (˥(˥(P ꓦ Q)) ꓥ ˥(P ꓥ Q))
• (Elimination of Bi-conditional)
• ⇔(˥(P ꓦ Q) ꓥ(P ꓥ Q) ) ꓦ ((P ꓦ Q) ꓥ ˥(P ꓥ Q))
• ⇔(˥P ꓥ ˥Q ꓥ P ꓥ Q) ꓦ ((P ꓦ Q) ꓥ(˥P ꓦ ˥Q )
• ⇔(˥P ꓥ ˥Q ꓥ P ꓥ Q) ꓦ ((P ꓥ˥P) ꓦ(P ꓥ˥Q ) ꓦ
(Q ꓥ ˥P) ꓦ (Q ꓥ ˥Q )) (Extd.Distributive law)
Is a DNF. (On further simplification we have)
• ⇔ (P ꓥ ˥Q ) ꓦ (Q ꓥ ˥P)
Which is the required DNF.
October 15, 2020 Dr. KRK 71
2. Obtain a DNF of P →((P →Q) ꓥ ˥(˥Q ꓦ ˥P))

• Sol: P →((P →Q) ꓥ ˥(˥Q ꓦ ˥P))


• ⇔ ˥P ꓦ ((P →Q) ꓥ ˥(˥Q ꓦ ˥P)) (since(P →Q) ⇔ (˥P ꓦ Q)
)

• ⇔ ˥P ꓦ ((˥P ꓦ Q) ꓥ ˥(˥(Q ꓥP))) (Demorgan’s law)


• ⇔ ˥P ꓦ ((˥P ꓦ Q) ꓥ (Q ꓥP)) (Distributive law)
• ⇔ ˥P ꓦ (˥P ꓥ Q ꓥP) ꓦ (Q ꓥ Q ꓥP)
• ⇔ ˥P ꓦ (˥P ꓥP ꓥ Q ) ꓦ ( Q ꓥP)
• ⇔ ˥P ꓦ F ꓦ (P ꓥ Q)
• ⇔ ˥P ꓦ (P ꓥ Q) (Sum of Elementary
products)
• Which is the required Dr. KRK 72
October 15, 2020
DNF.
3. Obtain a dnf of (Q ꓦ(P ꓥ R)) ꓥ ˥((P ꓦ R) ꓥ Q)
• Sol: (Q ꓦ(P ꓥ R)) ꓥ ˥((P ꓦ R) ꓥ Q)
• ⇔ (Q ꓦ(P ꓥ R)) ꓥ (˥(P ꓦ R) ꓦ ˥Q ) (Demorgans law)
• ⇔ (Q ꓦ(P ꓥ R)) ꓥ (˥P ꓥ ˥R) ꓦ ˥Q ) (Demorgans law)
• ⇔ (Q ꓥ (˥P ꓥ ˥R)) ꓦ(Q ꓥ ˥Q ) ꓦ [(P ꓥ R))
• ꓥ(˥P ꓥ ˥R)] ꓦ ((P ꓥ R) ꓥ ˥Q) (Extended dist.law)
• ⇔ (Q ꓥ (˥P ꓥ ˥R)) ꓦ(Q ꓥ ˥Q ) ꓦ [(P ꓥ R) ꓥ(˥Pꓥ ˥R)]
• ꓦ ((P ꓥ R) ꓥ ˥Q)
• ⇔ (˥P ꓥ Q ꓥ ˥R) ꓦF ꓦ F ꓦ (P ꓥ ˥Q ꓥ R)
• ⇔ (˥P ꓥ Q ꓥ ˥R) ꓦ (P ꓥ ˥Q ꓥ R)
• Which is the DNF.
October 15, 2020 Dr. KRK 73
Practice: Obtain the DNF of
1) (Q ꓦ (P ꓥ R)) ꓥ ˥ [(P ꓦ R) ꓥQ] (By truth table method)
2) (˥P ꓦ ˥Q) →(˥P ꓥ R ) (By truth table method)
• Sol:
P Q R Pꓥ R Q ꓦ (P ꓥ R) (P ꓦ R) (P ꓦ R) ꓥQ ˥( (P ꓦ R) ꓥQ) A

T T T T T T T F F

T T F F T T T F F

T F T T T T F T T

T F F F F T F T F

F T T F T T T F F

F T F F T F F T T

F F T F F T F T F

F F F F F F F T F

October 15, 2020 Dr. KRK 74


• Given formula is true in 3rd and 6th rows
• The corresponding truth values of P, Q, R in
• these rows are T F T and F T F.
• Therefore the required DNF is
• (P ꓥ ˥Q ꓥ R) ꓦ(˥ P ꓥ Q ꓥ ˥ R)
• Example: consider P ꓦ(Q ꓥ R)
• P ꓦ(Q ꓥ R) is a DNF
• ⇔ (P ꓦ Q) ꓥ(P ꓦ R) (Distributive law)
• ⇔ (P ꓥ P) ꓦ(P ꓥ R) ꓦ(Q ꓥ P) ꓦ(Q ꓥ R) is also
DNF
October 15, 2020 Dr. KRK 75
1. Obtain a CNF of ˥(P ꓦ Q) ↔(P ꓥ Q)
• ˥(P ꓦ Q) ↔(P ꓥ Q)
• [Since(P↔Q ⇔(˥P ∨Q ) ∧(P ∨ ˥Q)]
• ⇔(˥(˥(P ꓦ Q)) ꓦ(P ꓥ Q) ) ꓥ(˥(P ꓦ Q) ꓦ ˥(P ꓥ Q))
• ⇔((P ꓦ Q) ꓦ(P ꓥ Q)) ꓥ(˥(P ꓦ Q) ꓦ ˥(P ꓥ Q))
• (A ꓦ(B ꓥ C) ⇔(A ꓦ B) ꓥ (A ꓦ C) (Distributive and Demorgan’s laws)
• ⇔((P ꓦ Q ꓦ P) ꓥ (P ꓦ Q ꓦ Q)) ꓥ((˥P ꓥ˥Q) ꓦ (˥P ꓦ
˥Q))
• ⇔((P ꓦ Q ∨P) ꓥ (P ꓦ Q ꓦ Q)) ꓥ[(˥P ꓦ ˥Q) ꓦ(˥P ꓥ˥Q)
)]
• ⇔(P ꓦ Q ∨P) ꓥ (P ꓦ Q ꓦ Q) ꓥ(˥P ꓦ˥Q ꓦ˥P) ꓥ
• (˥P ꓦ˥Qꓦ˥Q)). [since(A ∨ (B ∧ C) ⇔ (A ∨ B) ∧ (A ∨ C) ]
Dr. KRK
Which is the required
October 15, 2020
CNF. 76
2. Obtain a CNF of ((P →Q) ∧ ˥Q) → ˥P
• ((P →Q) ∧ ˥Q) → ˥P ⇔ ˥((P →Q) ∧ ˥Q) ∨ ˥P
• ⇔ ˥((˥ P ∨Q) ∧ ˥Q) ∨ ˥P
• ⇔ ˥(˥ P ∨Q) ∨(˥(˥ Q)) ∨ ˥P (Demorgans law)
• ⇔ (˥(˥ P) ∧ ˥Q) ∨(˥(˥ Q) ) ∨ ˥P
• ⇔ [(P ∧ ˥Q) ∨ Q] ∨ ˥P (Distributive law)
• ⇔ [(Q ∨ P) ∧ (Q ∨ ˥Q)] ∨ ˥P (Distributive law)
• ⇔ (Q ∨ P ∨ ˥P) ∧ (Q ∨ ˥Q ∨ ˥P)
• ⇔ (P ∨ ˥P ∨ Q) ∧ (˥P ∨ Q ∨ ˥Q)
• Which is the required CNF.
October 15, 2020 Dr. KRK 77
Obtain a CNF of [(P ∧ Q) ∨ R] ∧(P → R) =A (truth table method)

P Q R (P ∧ Q) (P ∧ Q) ∨ R (P → R) A
T T T T T T T
T T F T T F F
T F T F T T T
T F F F F F F
F T T F T T T
F T F F F T F
F F T F T T T
F F F F F T F

October 15, 2020 Dr. KRK 78


• Give formula is false in 2nd,4th,6th and8throws,
• the corresponding entries of P, Q, R in these
• rows are T T F, T F F, F T F, F F F.
• Hence the CNF of the given formula is
• (˥ P ∨ ˥ Q ∨R) ∧ (˥ P ∨ Q ∨R) ∧ (P ∨ ˥ Q ∨R)
• ∧ (P ∨ Q ∨R)

October 15, 2020 Dr. KRK 79


Min and Max terms
• Minterm: A minterm consists of conjunctions in which each statement
• variable or its negation , but not both, appears only once.
• Ex: For two variables P and Q, there are 4(2^2) minterms given by
P ꓥ Q, P ꓥ ˥Q, ˥P ꓥ Q, ˥P ꓥ˥Q .
• Maxterm: A maxterm consists of disjunctions in which each statement
• variable or its negation , but not both, appears only once.
• Ex: For two variables P and Q, there are 4(2^2) maxterms given by
P ꓦ Q, P ꓦ ˥ Q, ˥P ꓦ Q, ˥P ꓦ˥Q .
P Q ˥P ˥Q PꓥQ P ꓥ ˥Q ˥P ꓥ Q ˥P ꓥ˥Q

T T F F T F F F
T F F T F T F F
F T T F F F T F
F F T T F F F T
October 15, 2020 Dr. KRK 80
•Principal disjunctive normal form(PDNF):
. An equivalent formula consisting of disjunctions of min terms
. only is known as its principal disjunctive normal form
. (sum-of-products form) or simply PDNF.
• Obtain the PDNF of P→ Q
• Sol: The truth table of P→ Q is
P Q P→ Q Minterm
T T T PꓥQ
T F F P ꓥ ˥Q
F T T ˥P ꓥ Q
F F T ˥P ꓥ˥Q

• The PDNF of P→ Q is (P ꓥ Q) ꓦ(˥P ꓥ Q) ꓦ(˥P ꓥ˥Q)

October 15, 2020 Dr. KRK 81


PDNF procedure with out constructing truth table

October 15, 2020 Dr. KRK 82


1. Obtain the PDNF of P→ Q.(without using
truth table)
Sol: P→ Q ⇔ (˥ P ꓦ Q)
⇔ (˥ P ꓥ T) ꓦ (Q ꓥ T) (Missing factors are obtained by
introducing’ꓥT’)

⇔ [˥P ꓥ (Q ꓦ ˥Q )] ꓦ [Q ꓥ (P ꓦ ˥P)] (Distributive


law)
⇔ ((˥ P ꓥ Q) ꓦ(˥Pꓥ˥Q )) ꓦ ((Q ꓥ P) ꓦ (Q ꓥ˥P ))
⇔ (˥ P ꓥ Q) ꓦ (˥Pꓥ˥Q )) ꓦ (P ꓥ Q) ꓦ (˥P ꓥ Q)
⇔(P ꓥ Q)ꓦ (˥P ꓥ Q) ꓦ (˥P ꓥ˥ Q ) is the PDNF
October 15, 2020 Dr. KRK 83
2. Obtain the PDNF of (P ꓥ Q) ꓦ(˥P ꓥ R) ꓦ(Q ꓥ R)
• (P ꓥ Q) ꓦ(˥P ꓥ R) ꓦ(Q ꓥ R)
• ⇔ [(P ꓥ Q) ꓥ T] ꓦ [(˥P ꓥ R) ꓥ T] ꓦ[(Q ꓥ R) ꓥ
T]
• ⇔ [(P ꓥ Q) ꓥ (R ꓦ ˥R)] ꓦ [(˥P ꓥ R) ꓥ (Qꓦ ˥Q)]
ꓦ[(Q ꓥ R) ꓥ (P ꓦ ˥P)]
• ⇔ ((P ꓥ Q ꓥ R) ꓦ (P ꓥ Q ꓥ ˥R)) ꓦ ((˥P ꓥ R ꓥ
Q)ꓦ
• (˥P ꓥ R ˥Q) ) ꓦ((Q ꓥ R ꓥ P) ꓦ (Q ꓥ R ˥P) )
• ⇔ (P ꓥ Q ꓥ R) ꓦ (P ꓥ Q ꓥ ˥R) ꓦ(˥P ꓥ Q ꓥ R)

October 15, 2020 Dr. KRK 84
3. Obtain a PDNF of P →((P →Q) ꓥ ˥(˥Q ꓦ ˥P))
• Sol: P →((P →Q) ꓥ ˥(˥Q ꓦ ˥P))
• ⇔ ˥P ꓦ ((P →Q) ꓥ ˥(˥Q ꓦ ˥P)) (since(P →Q) ⇔ (˥P ꓦ Q) )
• ⇔ ˥P ꓦ ((˥P ꓦ Q) ꓥ ˥(˥(Q ꓥP))) (Demorgan’s law)
• ⇔ ˥P ꓦ ((˥P ꓦ Q) ꓥ (Q ꓥP)) (Distributive law)
• ⇔ ˥P ꓦ (˥P ꓥ Q ꓥP) ꓦ (Q ꓥ Q ꓥP)
• ⇔ ˥P ꓦ (˥P ꓥP ꓥ Q ) ꓦ ( Q ꓥP)
• ⇔ ˥P ꓦ F ꓦ (P ꓥ Q)
• ⇔ ˥P ꓦ (P ꓥ Q) ⇔ (˥P ꓥ T) ꓦ (P ꓥ Q)
• ⇔ (˥P ꓥ (Q ꓦ ˥ Q)) ꓦ (P ꓥ Q)
• ⇔ (˥P ꓥ Q) ꓦ (˥P ꓥ ˥ Q) ꓦ (P ꓥ Q)
• Which is the required PDNF.
October 15, 2020 Dr. KRK 85
Min and Max terms of 3 variables
P Q R Minterms Maxterms
T T T PꓥQꓥR PꓦQꓦR

T T F P ꓥ Q ꓥ ˥R PꓦQꓦ˥R
T F T P ꓥ ˥Q ꓥ R Pꓦ˥QꓦR
T F F P ꓥ ˥Q ꓥ ˥R Pꓦ˥Qꓦ˥R
F T T ˥P ꓥ Q ꓥ R ˥PꓦQꓦR
F T F ˥P ꓥ Q ꓥ ˥R ˥PꓦQꓦ˥R
F F T ˥P ꓥ ˥Q ꓥ R ˥Pꓦ˥QꓦR
F F F ˥P ꓥ ˥Q ꓥ ˥R ˥Pꓦ˥Qꓦ˥R

October 15, 2020 Dr. KRK 86


Principal conjunctive normal form
• P.C.N.F: An equivalent formula consisting of
• conjunctions of max terms only is known as
• its principal conjunctive normal form
• (product-of-sums form) or simply PCNF.
• *: In obtaining PCNF of a given formula we
• have to introduce “ꓦ F” to obtain the missing
factors.

October 15, 2020 Dr. KRK 87


1. Find the PCNF of (˥P → R) ꓥ(Q ↔ P)
• (˥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] (missing factors)
• ⇔[(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)]
• ⇔(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)
•October 15, 2020 ꓥ (˥ P ꓦ Q ꓦ R) ꓥ(˥ P ꓦ Q ꓦ ˥R) is PCNF.
Dr. KRK 88
Min and Max terms of 3 variables
p Q R Minterms Maxterms
T T T PꓥQꓥR PꓦQꓦR
T T F P ꓥ Q ꓥ ˥R P ꓦQ ꓦ ˥R
T F T P ꓥ ˥Q ꓥ R P ꓦ˥Q ꓦ R
T F F P ꓥ ˥Q ꓥ ˥R P ꓦ ˥Q ꓦ ˥R
F T T ˥P ꓥ Q ꓥ R ˥P ꓦ Q ꓦ R
F T F ˥P ꓥ Q ꓥ ˥R ˥P ꓦ Q ꓦ ˥R
F F T ˥P ꓥ ˥Q ꓥ R ˥P ꓦ ˥Q ꓦ R
F F F ˥P ꓥ ˥Q ꓥ ˥R ˥P ꓦ ˥Q ꓦ ˥R

October 15, 2020 Dr. KRK 89


PDNF &PCNF-problem
• 2) Given A=(Pꓥ Q) ꓦ (˥PꓥR) ꓦ (Qꓥ R) find its PDNF and PCNF.
• Sol: The PDNF of A is (refer slide 80)
• ⇔(P ꓥ Q ꓥ R) ꓦ (P ꓥ Q ꓥ ˥R) ꓦ(˥P ꓥ Q ꓥ R) ꓦ (˥P ꓥ ˥Q ꓥ R )
• The PDNF of ˥A is the disjunctions of remaining min terms
• PDNF of ˥A ⇔ (P ꓥ ˥Q ꓥ R) ꓦ (P ꓥ ˥Q ꓥ ˥R) ꓦ (˥P ꓥ Q ꓥ˥R) ꓦ
• (˥P ꓥ ˥Q ꓥ ˥R)
• Since ˥(˥A) ⇔A, therefore
• ⇔˥[(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)
• Which is the PCNF.
•October
Note:
15, 2020 PDNF and PCNF areDr.
unique
KRK normal forms 90
Practice
3.Find the PDNF and PCNF of
S : P  (P → (Q  (Q → R )))

October 15, 2020 Dr. KRK 91


Valid Arguments in Propositional Logic
• Consider the following argument involving propositions
• “If you have a current password, then you can log onto the
• network.”
• “You have a current password.”
• Therefore, “You can log onto the network.”
• Use p to represent “You have a current password” and
• q to represent “You can log onto the network.”
• Then, the argument has the symbolic form
• p→q
• p
• ∴q valid

October 15, 2020 Dr. KRK 92


Theory of Inference
• Inference theory: The main aim of logic is to provide rules of
• inference to infer a conclusion from a set of premises. The
• theory associated with rules of inference is known as
• inference theory.
• Def: An argument in propositional logic is a sequence of
• propositions. All but the final proposition in the argument
• are called premises and the final proposition is called the
• conclusion. An argument is valid if the truth of all its
• premises implies that the conclusion is true.
• Def: If a conclusion is derived from a set of premises by using
• the accepted rules of reasoning then such a process of
• derivation is called a deduction or a formal proof and the
• argument is called valid argument or conclusion is called a
• valid conclusion.
October 15, 2020 Dr. KRK 93
Theory of Inference
• Def: Let A and B be two statement formulas.
• We say that “B logically follows from A” or “B is a
• valid conclusion of the premise A” iff A → B is a
• tautology ie. A ⇒B.
• By extending the above definition we see that the
• argument form with premises p1, p2, . . . , pn and
p
• conclusion q is valid, when 1

p
2

• 3 p

(p1 ∧ p2 ∧ · · · ∧ pn) → q is a tautology,ie p --→(*)
n

−−−
q
October 15, 2020 Dr. KRK 94
Theory of inference using truth table

October 15, 2020 Dr. KRK 95


Rules of inference
Rule of Inference Tautology Name

p (p ∧ (p → q)) → q Modus ponens(law of


p→q detachment)
∴q
¬q (¬q ∧ (p → q))→¬p Modus tollens
p→q
∴ ¬p
p→q ((p → q) ∧ (q → r)) → (p → r) Hypothetical syllogism
q→r
∴p→r
p∨q ((p ∨ q)∧¬p) → q Disjunctive syllogism
¬p
∴q
P p → (p ∨ q) Addition
∴p∨q
p∧q (p ∧ q) → p Simplification
∴p
p∨q ((p ∨ q) ∧ (¬p ∨ r)) → (q ∨ r) Resolution
¬p ∨ r
∴q∨r
October 15, 2020 Dr. KRK 96
problems
• 1) If it is raining, then I will study discrete math. It Is raining.
• Therefore I study discrete math.
• Let p: it is raining
• q: I will study discrete math
• Symbolically : p →q (Modus ponens)
p
• ∴q
• 2) If it is raining, then I will study discrete math. I will not study
• discrete math. Therefore it is not raining.
• Symbolically: p →q (Modus Tollens)
• ˥q
• ∴ ˥p

October 15, 2020 Dr. KRK 97


problems
• 3) State which rule of inference is the basis of the
• following argument:
• “It is below freezing now. Therefore, it is either
• below freezing or raining now.”
• Sol: Let p be the proposition “It is below freezing now”
• And q the proposition “It is raining now.”
• Then this argument is of the form
• Symbolically : p
• ∴p∨q
• This is an argument that uses the addition rule.

October 15, 2020 Dr. KRK 98


• 4) If it rains today, then we will not have a barbecue
• today. If we do not have a barbecue today, then we
• will have a barbecue tomorrow. Therefore, if it rains
• today, then we will have a barbecue tomorrow.
• Sol: Let p be the proposition “It is raining today,”

• let q be the proposition “We will not have a


• barbecue today,” and let r be the proposition “We
• will have a barbecue tomorrow.” Then this
• argument is of the form p → q
q→r
• symbolically: ---- -
 p → r valid
• Hence, this argument is a hypothetical syllogism.
October 15, 2020 Dr. KRK 99
Check the vailidity of the arguments
5) If sachin hits a century, then he gets a free car. Sachin hits a
century. Sachin gets a free car.
• Ans: Let P: sachin hits a century
• Let Q: Sachin gets a free car
• Symbolically: P→ Q
P
∴ Q (Valid)
6) If sachin hits a century, then he gets a free car. Sachin does
not gets car. There fore sachin has not hit a century.
• Symbolically: P→ Q
˥Q
∴˥P (Valid)
October 15, 2020 Dr. KRK 100
7) If 3x+7=16, then 3x=9

. if 3x=9, then x=3.


here p: 3x+7=16 q: 3x=9 r: x=3.
p→q
q→r
∴p→r

• 8) If I study then I do not fail in exam. If I do not fail in exam, my father


• gifts me a two wheeler. Therefore if I study then my father gifts me a two
• wheeler.
• Solution: Let P: I study
• Q: I do not fail in the exam
• R: My father gifts a two wheeler
• Symbolically: P → Q
• Q→R
• ∴ P → R valid
October 15, 2020 Dr. KRK 101
Rules of inference

October 15, 2020 Dr. KRK 102


Rules of inference
• Rule P(premise): A premise may be introduced at
• any point of the derivation.
• Rule T(tautology): A formula S may be introduced in
• a derivation if S is a Tautology implied by any one or
• more of the preceding formulas in the derivation.
• 1) Prove that ˥p is valid from premises ˥q, p→q.
• [1] (1) p→q rule P
• [2] (2) ˥q rule P
• [1,2] (3) ˥p rule T, and I12(modus Tollens).
• Hence ˥p is valid .

October 15, 2020 Dr. KRK 103


Demonstrate that S is a valid inference from
the premises P→ ˥Q, Q ꓦ R, ˥S →P and ˥R.
• Sol:

• [1] (1) ˥R Rule P


• [2] (2) QꓦR Rule P
• [1,2] (3) Q Rule T, (Disjunctive syllogism)
• [4] (4) P→ ˥Q Rule P
• [1,2,4] (5) ˥P Rule T,(Modus Ponens)
• [6] (6) ˥S →P Rule P
• [1,2,4,6] (7) S Rule T, (Modus Ponens)
• Hence S is a valid inference.
October 15, 2020 Dr. KRK 104
Show that (R ꓦ S) follows logically from the premises
(C ꓦ D), (C ꓦ D) → ˥H, ˥H →(A ∧ ˥ B) and (A ∧˥ B) →(R ꓦ S)

• Sol:
• [1] (1) (C ꓦ D) Rule P
• [2] (2) (C ꓦ D) → ˥H Rule P
• [1,2] (3) ˥H Rule T
• [4] (4) ˥H →(A ∧ ˥ B) Rule P
• [1,2,4] (5) (A ∧ ˥ B) Rule T
• [6] (6) (A ∧˥ B) →(R ꓦ S) Rule P
• [1,2,4,6] (7) (R ꓦ S) Rule T
• Hence (R ꓦ S) follows logically from the premises.
October 15, 2020 Dr. KRK 105
Show that (R ꓦ S) follows logically from the premises
(C ꓦ D), (C ꓦ D) → ˥H, ˥H →(A ∧ ˥ B) and (A ∧˥ B) →(R ꓦ S)
• Sol:
• [1] (1) (C ꓦ D) → ˥H Rule P
• [2] (2) ˥H →(A ∧˥B) Rule P
• [1,2] (3) (C ꓦ D) → (A ∧˥B) Rule T,(Syllogism)
• [4] (4) (A ∧˥B) →(R ꓦ S) Rule P
• [1,2,4] (5) (C ꓦ D) → (R ꓦ S) Rule T,(Syllogism)
• [6] (6) (C ꓦ D) Rule P
• [1,2,4,6] (7) (R ꓦ S) Rule
T ,(addition)
• Hence (R ꓦ S) follows logically from the premises.

October 15, 2020 Dr. KRK 106


Practice
• 2) Prove that r is a valid inference from the
premises p→q, q→r and p.
• 3) Show that ˥s is a valid argument from the
premises p→q, (˥q ꓦ r), (˥r), ˥(˥p ꓥ s).
• 4) Use rules of inference to show that the
hypotheses “Randy works hard,” “If Randy
works hard, then he is a dull boy,” and “If
Randy is a dull boy, then he will not get the
job” imply the conclusion “Randy will not
get the job.”
October 15, 2020 Dr. KRK 107
(Deduction theorem)Rule Conditional proof (ruleCP):
If we can derive ‘S’ from R and a set of premises, then
we can derive R→ S from the set set of premises only.
• Show that R→ S can be derived from the premises
• P →(Q →S), ˥R ꓦ P and Q.
• (Include Antecedent of conclusion as an additional premise)
• [1]
Sol: (1) ˥R ꓦ P Rule P
• [2] (2) R Rule P (Additional premise)
• [1,2] (3) P Rule T, (Disjunctive syllogism)
• [4] (4) P →(Q →S) Rule P [(P → Q)⇔ (˥P ꓦ Q)]
• [1,2,4] (5) (Q →S) Rule T, (Modus Ponens)
• [6] (6) Q Rule P
• [1,2,4,6] (7) S Rule T, (Modus Ponens)
• [1,4,6] (8) R→ S Rule CP
October 15, 2020 Dr. KRK 108
problems

• Show that P→ S can be derived from the premises


• ˥P ꓦ Q, ˥Q ꓦ R, R→ S.
• (Include Antecedent of conclusion as an additional premise)
• Sol: [1] (1) ˥P ꓦ Q Rule P
• [2] (2) P Rule P (Additional premise)
• [1,2] (3) Q Rule T, (Disjunctive syllogism)
• [4] (4) ˥Q ꓦ R Rule P
• [1,2,4] (5) R Rule T, (Disjunctive syllogism)
• [6] (6) R→ S Rule P (P → Q⇔ ˥P ꓦ Q)
• [1,2,4,6] (7) S Rule T, (Modus Ponens)
• [1,4,6] (8) P→ S Rule CP

October 15, 2020 Dr. KRK 109


Consistency of Premises
• A set of formulas H1, H2, · · · , Hm is said to be consistent if
• their conjunction has the truth value T for some assignment
• of the truth values to the atomic variables appearing in
• H1, H2, · · · , Hm.
• If, for every assignment of the truth values to the atomic
• variables, at least one of the formulas H1, H2, · · · , Hm is false,
so that their conjunction is identically false, then the
formulas H1, H2, · · · , Hm are called inconsistent.
• Alternatively, a set of formulas H1, H2, · · · , Hm is inconsistent
if their conjunction implies a contradiction, that is,
• H1 ∧ H2 ∧ · · · ∧ Hm ⇒ R ∧ ¬R
• where R is any formula.

October 15, 2020 Dr. KRK 110


• Example: Show that the following premises are inconsistent:
• (1). If Jack misses many classes through illness, then he fails
high school.
• (2). If Jack fails high school, then he is uneducated.
• (3). If Jack reads a lot of books, then he is not uneducated.
• (4). Jack misses many classes through illness and reads a lot
of books.
• Solution: Let us indicate the statements as follows:
• E: Jack misses many classes through illness.
• S: Jack fails high school.
• A: Jack reads a lot of books.
• H: Jack is uneducated.

October 15, 2020 Dr. KRK 111


• The premises are E → S, S → H, A → ¬H, and E ∧ A.
• {1} (1) E→S Rule P
• {2} (2) S→H Rule P
• {1, 2} (3) E → H Rule T, (1), (2), and I13
• {4} (4) A → ¬H Rule P
• {4} (5) H → ¬A Rule T, (4), and P → Q ⇔ ¬Q → ¬P
• {1, 2, 4} (6) E → ¬A Rule T, (3), (5), and I13
• {1, 2, 4} (7) ¬E ∨ ¬A Rule T, (6) and P → Q ⇔ ¬P ∨ Q
• {1, 2, 4} (8) ¬(E ∧ A) Rule T, (7), and ¬(P ∧ Q) ⇔ ¬P ∨ ¬Q
• {9} (9) E∧A Rule P
• {1, 2, 4, 9} (10) ¬(E ∧ A) ∧ (E ∧ A) Rule T, (8), (9) and I9

October 15, 2020 Dr. KRK 112


Consistency of premises and Indirect method of proof

October 15, 2020 Dr. KRK 113


Prove by indirect method that (˥Q), P → Q, P ꓦ R ⇒ R
• Here R is the conclusion. We will introduce ˥R as an
additional premise. We prove a contradiction.

• Sol: [1] (1) PꓦR Rule P


• [2] (2) ˥R Rule P (Additional premise)
• [1,2] (3) P Rule T,
• [4] (4) P→Q Rule P [(P → Q)⇔ (˥P ꓦ Q)]
• [1,2,4] (5) Q Rule T, (Modus Ponens)
• [6] (6) ˥Q Rule P
• [1,2,4,6] (7) Q ꓥ ˥Q Rule T, (Contradiction)

October 15, 2020 Dr. KRK 114


practice

• 2) using indirect method of proof, derive


• p → ˥s from p →(q ꓦ r), q → ˥p, s → ˥r, p.
• 3) using indirect method of proof, derive
• p →q, q → r, ˥(p ꓥ r), p ꓦ r ⇒ R

October 15, 2020 Dr. KRK 115


Example
• With these 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 jolly trip.”
“If we take a jolly trip, then we will be home by sunset.”

Using the inference rules, construct a valid argument for the
conclusion: “We will be home by sunset.”

• Solution:
Let p: “It is sunny this afternoon.”
q: “It is colder than yesterday.”
r: “We will go swimming.”
s: “We will take a jolly trip.”
t: “We will be home by sunset.”

October 15, 2020 Dr. KRK 116


Example contd….

• Symbolically:
p  q, r → p, r → s, s → t  t
• Sol: [1] (1) ˥Pꓥq Rule P
• [1] (2) ˥p Rule T
• [1] (3) q Rule T,
• [4] (4) r→p Rule P [(P → Q)⇔ (˥P ꓦ Q)]
• [1,4] (5) ˥r Rule T, (Modus Tollens)
• [6] (6) ˥r →s Rule P
• [1,4,6] (7) s Rule T,
• [8] (8) s →t Rule P (Modus Ponens)
• [1,4,6,8] (9) t Rule T.

October 15, 2020 Dr. KRK 117


• Show that the following set of premises is inconsistent:
”If the contract is valid, then John is liable for penalty. If John
is liable for penalty, he will go bankrupt. If the bank will loan
him money, he will not go bankrupt. As a matter of fact, the
contract is valid, and the bank will loan him money.”
• Solution: Let us indicate the statements as follows:
• V : The contract is valid.
• L: John is liable for penalty.
• M: Bank will loan him money.
• B: John will go bankrupt.

October 15, 2020 Dr. KRK 118


• {1} (1) V→L Rule P
• {2} (2) L→B Rule P
• {1, 2} (3) V→B Rule T, (1), (2), and I13
• {4} (4) M → ¬B Rule P
• {4} (5) M → ¬M Rule T, (4), and P → Q ⇔ ¬Q → ¬P
• {1, 2, 4} (6) V → ¬M Rule T, (3), (5), and I13
• {1, 2, 4} (7) ¬V ∨ ¬M Rule T, (6) and P → Q ⇔ ¬P ∨ Q
• {1, 2, 4} (8) ¬(V ∧ M) Rule T, (7), and ¬(P ∧ Q) ⇔ ¬P ∨ ¬Q
• {9} (9) V∧M Rule P
• {1, 2, 4, 9} (10) ¬(V ∧ M) ∧ (V ∧ M) Rule T, (8), (9) and I9
• Thus, the given set of premises leads to a contradiction and hence it is
inconsistent.

October 15, 2020 Dr. KRK 119


October 15, 2020 Dr. KRK 120
• Determine the validity of the following argument.
• My father praises me only if I can be proud of myself.
Either I do well in sports or I can’t be proud of myself.
If I study hard, then I can’t do well in sports.
Therefore, if father praises me, then I do not study
well.

October 15, 2020 Dr. KRK 121

You might also like