Download as pdf or txt
Download as pdf or txt
You are on page 1of 285

Mathematical Foundations of Computer

Science
B. Tech II Year I Sem

Mrs. M. RAMA, M.Tech


Assistant Professor,
Department of CSE
Introduction

M. RAMA

2
Syllabus
UNIT-I
Mathematical Logic: Statements and notations, Connectives, Well formed formulas, Truth
Tables, tautology, equivalence implication, Normal forms.
Predicates:Predicative logic, Free & Bound variables, Rules of inference, Consistency, proof
of contradiction, Automatic Theorem Proving.

UNIT-II
Relations: Properties of binary Relations, equivalence, transitiveclosure, compatibility and
partial ordering relations.
Functions: Inverse Function, Composition of functions,recursive Functions, Lattice and its
Properties.

M. RAMA
UNIT-III
Elementary Combinatorics: Basis of counting, Combinations & Permutations, with repetitions,
Constrained repetitions, Binomial Coefficients, Binomial Multinomial theorems, the principles of
Inclusion -Exclusion. Pigeon hole principles and its application.

UNIT-IV
Recurrence Relation: Generating Functions, Function of Sequences Calculating Co-efficient of
generating function, Recurrence relations, Solving recurrence relation by substitution and
Generating functions. Characteristics roots solution of In- homogeneous Recurrence Relation.

UNIT-V
Graph Theory: Basic Concepts, Isomorphisms and Subgraphs, Trees and Their Properties Spanning
Trees, B.F.S,D.F.S. Directed Trees, Binary Trees, Planar Graphs, Euler’s Formula, Multigraphs and
Euler Circuits, Hamiltonian Graphs, Chromatic Numbers, The Four-ColorProblem.

M. RAMA
TEXT BOOKS:
1. Discrete Mathematical Structures with Applications to Computer Science-J. P.Tremblay
R. Manoharn, Tata McGraw Hill.
2. Discrete mathematics for computer scientists & mathematicians JL Mott, A Kandel,
T. P.Baker PHI.
REFERENCE BOOKS:
1. Discrete Mathematics and its Applications, Kenneth H.Rosen, Fifth Edition.TMH.
2. Discrete Mathematical Structures Theory and application-Malik & Sen, Cengage.
3. Discrete Mathematics with Applications, Thomas Koshy, Elsevier.
4. Logic and Discrete Mathematics, Grass Man & Trembley, Pearson Education.
5. Mathematical Foundations of Computer science, 3rd Edition, Dr. D.S.C.

M. RAMA
UNIT – I
Mathematical Logic: Statements and notations, Connectives, Well formed
formulas, Truth Tables, tautology, equivalence implication, Normal forms.

Predicates : Predicative logic, Free & Bound variables, Rules of inference,


Consistency, proof of contradiction, Automatic Theorem Proving.

M. RAMA
Mathematical logic
Proposition :
A proposition is a declarative sentence which is either true or false
but not both.

Consider the following sentences:


1. Sun rises in the east.
2. Kolkata is a country.
3.5 is a prime number.
4. 2 + 3 = 4
These are propositions because they are either true of false.

M. RAMA
7
contd…
• Propositions are also called as Statements.
• The truth or falsity of a proposition is called its truth-value.
• These two values true and false are denoted by the symbols T and F
respectively.
• Sometimes these are also denoted by the symbols 1 and 0 respectively.
•Propositions are usually represented by small letters such as p, q, r, s, ..
Ex:
p: 14 is divisible by 7.
q: India had a woman Prime minister.

M. RAMA
8
Examples:
 x+2 is a positive number
 What is your name?
 5 divides x
 x+y=z

These are not propositions as they are not declarative in nature, that is,
they do not declare a definite truth value T orF.

Note: All sentences are not Propositions.

M. RAMA
9
Atomic and Compound statements
Atomic statement : A statement which can not be divided further, is called
atomic statement.
These statements are also called as Simple statements or primary statements.

These statements are denoted by p,q,r,s,……

Ex. Milk is white

2+3 = 5

M. RAMA
10
Compound Statement :
 Two or more simple statements can be combined to form a new statement.
 These new statements are called as Compound statements or Molecular
Statements or Propositional function or Statement formulas.
Compound statements can be formed from atomic statements through
the use of following words or phrases. Such words or phrases are called
Logical Connectives.

‘not’, ‘and', ‘or', ‘if …then‘ and ‘if and only if ‘ are called connectives.
Ex: It is raining today and there are 20 tables in this room.
Note: Propositions which do not contain any logical connective are called
Simple propositions.
M. RAMA 1

1
Logical Connectives
Basic connectives:

• Negation
• Conjunction
• Disjunction
• Conditional
• Biconditional
• Exclusive Disjunction.

M. RAMA
12
Representations and Meanings of Logical Connectives

S. No. Name Representation Meaning

1 Negation ~P “not p”
2 Conjunction P Q “P and Q”
3 Disjunction P VQ “P or Q ”
4 Conditional P →Q “if P then Q”
5 Biconditional P ↔Q “P if and only if Q”

6 Exclusive P ⊻Q “Either P or Q”
Disjunction

M. RAMA
Negation:
If p is a statement, then the negation of p, written as ~p and read as “ not p”
is a statement.
Example 1: Example 2:
p : London is a city. q : 2+3=5
~p : London is not a city. ~q : ?
2+3=5
The truth table forNegation is given below.

P ~P P ~P
T F 1 0
F T 0 1
M. RAMA 11
Conjunction (and) pq
• A compound proposition obtained by combining two given propositions by
inserting the word ‘and’ in between them is called the conjunction of the given
proposition.
• If p and q are two propositions, then the conjunction of p and q is the statement
p  q which is read as “ p and q ”.
• The statement p  q has the truth value T whenever both p and q have truth value T,
otherwise it has the truth value false.

p q pq
F F F
F T F
T F F
T T T
15
M. RAMA
Example:
p: 3 is a prime number
q: All triangles are equilateral
r: 2+5=7

a) p is a true proposition
b) q is a false proposition
c)r is a true proposition
Find
p  q : 3 is a prime number and All triangles are equilateral
p  r : 3 is a prime number and 2+5=7
q  r : All triangles are equilateral and 2+5=7
According to truth table p  q is false, p  r is true and q  r is false.

M. RAMA 16
Truth values:
pq:
p q pq
T F F

pr:
p r pr
T T T

qr:
q r qr
F T F

M. RAMA
Disjunction ( or ) pvq
• Inserting ‘or’ in between two propositions is called disjunction.
• If p and q are two propositions, then the disjunction of p and q is the statement
pq which is read as “ p orq”.
• The statement pq has the truth value F only when both p and q have truth
value F; Otherwise it has the truth value T.

p q pq
F F F
F T T
T F T
T T T

18
M. RAMA
Example:
p: 3 is a prime number
q: All triangles are equilateral
s: 2+5=7
a) p is a true proposition
b) q is a false proposition
c)s is a true proposition
Find
p  q : 3 is a prime number or All triangles areequilateral
p  s : 3 is a prime number or 2+5=7
q  s : All triangles are equilateral or 2+5=7
According to truth table p  q is true, p  s is true and q  s is true
19
M. RAMA
Truth values:
pq:
p q pq
T F T

p  r:
p r pr
T T T

q  r:
q r qr
F T T

M. RAMA
Conditional (Implies) pq
If p and q are two propositions, then the statement p  q which is read as
“ if p, then q ” or “ p implies q “.
The statement p  q has truth value F only when p is true and q is false;
otherwise it has a truth value T.
p q pq
F F T
F T T
T F F
T T T

M. RAMA
21
Example:
1) P : It rains.
Q: The crop will grow.
The implication P → Q states that
R: If it rains then the crop will grow.
2) P : I will go to Australia.
Q: I will earn more money.
The implication P → Q states that
R: If I will go to Australia, then I will earn more money.

M. RAMA
Example:
p: 2 is a prime number
q: 3 is a prime number
r : 6 is a perfect square
s: 9 is a multiple of 6
here,
p and q are true propositions
r and s are false propositions

Find
pq: if 2 is a prime number, then 3 is a prime number, truth value 1
pr: if 2 is a prime number, then 6 is a perfect square, truth value 0
rq: if 6 is a perfect square, then 3 is a prime number, truth value 1
rs: if 6 is a perfect square, then 9 is a multiple of 6, truth value 1
M. RAMA
23
Truth values:

p q:
p q pq
T T T

pr:

p r pr
T F F

M. RAMA
Biconditional (Bi-implies) pq
If p and q are two propositions, then the conjunction of p q and q pis
called biconditional of p and q. It is denoted by p  q, which is read as
“ if p then q and if q then p or p if and only if q ”.
The statement p  q has the truth value T whenever both p and q have
identical truth values.
Note: p  q is same as (p q)  (q p)
p q pq
F F T

F T F

T F F

T T T

25
M. RAMA
1) P : He goes to play a match
Q : it does not rain.
The P  Q states that
R: He goes to play a match if and only if it does not rain.
2) P : Birds fly
Q : sky is clear
The P  Q states that
R : Birds fly if and only if sky is clear.

M. RAMA
Exclusive Disjunction(⊕ / ⊻) or ExclusiveOR :
Let p and q are 2 propositions. 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
F F F

F T T

T F T

T T F

M. RAMA
Example:

p: 8 is prime number
q: 2+3=5

p⊻q: either 8 is prime numberor 2+3=5


Example 1 Express the following statements in symbolic form:
1) If Ravi does not visit a friend this evening, then he studies this evening.
p:Ravi visit a friend this evening q: He(Ravi) studies this evening
((¬p) →q)
(2) If there is a cricket telecast this evening, then Ravi does not study and does not
visit a friend this evening.
r: there is a cricket telecast this evening
(r →(¬q∧¬p))
(3) If there is no cricket telecast this evening, then Ravi does not study but visits a friend this
evening. (¬ r →(¬q∧p))

(4)There is no cricket telecast this evening but Ravi does not study and does not visit a friend
this evening. (¬ r ∧ (¬q∧¬p))
Exercises:
1) Find conjunction and disjunction of following propositionsand
indicate truth value
p: 4 is a perfect square
q: 5 is divisible by 2
r : 27 is prime number
s: 7 is a multiple of 3
2) Determine the truth value
a. pq is false and p is true, find the truth value of q
b. pq is false and q is false, find the truth value of p
c. pq is true and p is false, find the truth value of q
d. p  q is true and p is false, find the truth value of q
M. RAMA
30
Well formed formulas:
While representing a statement involving connectives in symbolic form, care has
to be taken to ensure that the symbolic representation convey the intended
meaning of the statement without any ambiguity .

Statements represented in symbolic forms which can not be interpreted in more


than one way are called well formed formulas.

Appropriate parenthesis are to be used at appropriate places to achieve this


objective.

M. RAMA
31
Example-1:
The negation of the conjunction of the propositions p and q.

¬p∧q // wrong
¬ (p ∧ q) // correct
Example-2: “If p and q ,then r” involving the propositions p, q,r
p∧q →r // wrong

(p∧q)→r // correct
Wffs are constructed using the followingrules:

1. True and False are wffs.


2.Each propositional constant (i.e. specific proposition), and each
propositional variable (i.e. a variable representing propositions) are wffs.
3. Each atomic formula (i.e. a specific predicate with variables) is a wff.
4. If A, B, and C are wffs, then so are ¬A, (A ∨B), (A ∧B), (A →B), and (A↔B).
Examples:
Ex-1: (PQ) , (PQ) ,
(P (PQ) ),
(P (Q R)) and (PQ)(PQ)
are well formed formulas.

Ex-2: PQ ,
(PQ )Q ) and
(P Q )  (Q) are
not well formed formulas.

M. RAMA
non-WFF explanation

A~ the ~ belongs on the left side of the negated proposition

parentheses are only introduced when joining twoWFFs


(A) with ∨,  

(A v ) there’s no WFF on the right side of the V

(A  B) v C) missing paranthesis on the left side

(A  B) cannot be formed by the rules of syntax


35
Example 2:
p: A circle is a conic. q: √5 is a real number. r : Exponential series is
convergent.
Express the following compound propositions in words:
1) p∧(¬q)
A circle is a conic and √5 is not a real number
2) (¬p)∨q
A circle is not a conic or √5 is a real number
3) p ⊻ (¬q)
Either a circle is a conic or √5 is not a real number
p: A circle is a conic. q: √5 is a real number. r : Exponential series is
convergent.
4) q → (¬p)
If √5 is a real number then A circle is not a conic
5) p →(q ⊻r)
If a circle is a conic then either √5 is a real number or Exponential
series is convergent
6) (¬p) ↔q
If A circle is not a conic then √5 is a real number and if √5 is a real
number then A circle is not a conic
( p  q is same as (p q)  (q p) ) or
A circle is not a conic If and only if √5 is a real number.
Truth tables - Examples
Our basic concern is to determine the truth value of a statement formula for
each possible combination of the truth values of the component statements.
A table showing all such truth values is called the truth table of the formula.

Ex.1 Construct truth table for the statement formula P  Q

P Q Q P  Q
F F T T
F T F F
T F T T
T T F T
38
Truth Tables - Examples
Ex – 2: Construct the truth table for (PQ)  P

P Q PQ P (PQ) P

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

M. RAMA 39
Exercises:

• Construct the truth tables for the following:


1) p q v p)
 (p v q)  (~p)
[(p  q) v (~r)] p

4
M. RAMA
0
1) Construct the truth table for p q v p)

p q qvp p (q v p)
F F F F
F T T F
T F T T
T T T T
2) Construct the truth table for (p v q)  (~p)

p q ~p pvq (p v q) (~p)


F F T F F
F T T T T
T F F T F
T T F T F
3) Construct truth table for [(pq) (r)]  p

p q r pq r (pq) (r) [(pq) (r)]p]

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

M. RAMA 43
PART - 2

Tautology
Contradiction
Contingency
Logical Equivalence
Laws of Logic
Tautology and Contradiction
Tautology :
A compound proposition which is true for all possible truth values
of its components is called a Tautology ( A Universally valid formula or a
logical truth). A tautology is generally denoted by T0.

Ex-1: P  P is a tautology. Ex-2: ( P  P )  Q is a tautology.

P P P vP P Q P (PvP) (PvP)v Q


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

45
Contradiction (Absurdity): A compound proposition which is false for all
possible truth values of its components is called a Contradiction.

Ex-1: P  P is a Contradiction.
P P P P
F T F
T F F
Ex-2: ( P  P )  Q is a Contradiction

P Q P P  P ( P  P )  Q
F F T F F
F T T F F
T F F F F
T T F F F
Contingency:
A compound proposition that can be true or false is
called a Contingency. In other words, a contingency is a compound proposition
which is neither a tautology or contradiction.
Ex. PQ, PQ, PQ, ….

1. PVQ

P Q PVQ
F F F
F T T
T F T
T T T
Exercises:
Prove that the following are tautologies
1. (p v q) v ~p
2. [(p q) (q r)] (p r)
3. [ (p q)  (p ~q)]  ~q
4. (PQ)(Q)
5. ~(p v q) v [(~p)  q] v p
Prove that [(p q) (q r)] (p r) is a tautology
Truth table

p q r p q q r (p q)  (q r) p r [(p q)  (q r)] p r)]

F F F T T T T T
F F T T T T T T
F T F T F F T T
F T T T T T T T
T F F F F F F T
T F T F F F T T
T T F T F F F T
T T T T T T T T
Ex-4: Using truth tables, show that (PQ)(Q) is a
tautology
P Q P  Q ( P  Q ) Q ( P  Q )  (Q)

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

M. RAMA
50
Logical Equivalence
Two propositions P and Q are logically equivalent, if they have same truth values.
Then we write P  Q (or) P  Q
Ex: (P )  P
Ex: ( P  Q )  ( P Q ).

Note : The symbol  is not a connective.


Logical equivalent propositions are treated as identical propositions.
If P & Q have identical truth values then P and Q are logically equivalent P  Q
when the propositions P & Q are not equivalent, we write P Q.
Equivalence relation is symmetric and transitive.
Two formulas P and Q are said to equivalent to each other if and only if
P↔Q is a tautology.
M. RAMA 51
Logical Equivalence

p q P→Q ¬P ¬P ∨ Q (P → Q) ↔(¬P ∨ Q)
0 0 1 1 1 1
0 1 1 1 1 1
1 0 0 0 0 1
1 1 1 0 1 1

Definition: Two propositions p and q are said to be logically equivalent whenever p


and q have the same truth values, or equivalently, whenever the bi-conditional
“p ↔ q “ is a tautology.

52
Logical Equivalence
Example 1: Let x be a specified positive integer . Consider the following propositions
p: x is an odd integer q: x is not divisible by 2
Are p and q logically equivalent?
Ans: p and q have identical truth values. As such p and q are logically equivalent
Method I. Truth Table Method: One method to determine whether any two statement formulas
are equivalent is to construct their truth tables.

Example 2: Prove P ∨ Q ⇔ ¬(¬P ∧ ¬Q).


P Q P∨Q ¬P ¬Q ¬P ∧ ¬Q ¬(¬P ∧ ¬Q) (P ∨ Q) ⇔ ¬(¬P ∧ ¬Q)

T T T F F F T T
T F T F T F T T
F T T T F F T T
F F F T T T F 53 T
Examples:
Ex-1: Show that ( P Q )  (P ) Q

P Q PQ P P)Q
F F T T T
F T T T T
T F F F F
T T T F T

Since columns 3 and 5 are identical.

M. RAMA 54
Ex-2: Prove that (PQ)  (Q  P)

Let us prove the result using truth table.

P Q PQ Q P (Q P)


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

M. RAMA 55
Exercises:

Prove that the following are logical equivalence


1. [p  (q  r)] [p  q p  r]
. [p v q) r]  [r p v q)]
. [p  (q v r)][p v (qr)]
The Laws of Logic
1. Double Negation:
~(~ P) ⇔ P
2. Idempotent laws:

(a)P ∨ P ⇔ P (b) P ∧ P ⇔ P

3. Identity Laws:

(a) (P ∨ F0)⇔ P (b) (P ∧ T0)⇔ P

4. Inverse Laws:
(a) (P ∨ ~ P)⇔ T0 (b) (P ∧ ~ P )⇔ F0
5. Domination Laws:
(a) (P ∨ T0)⇔ T0 (b) (P ∧ F0)⇔ F0

6. Commutative laws:
(a) (P ∨ Q) ⇔ (Q ∨ P) (b) (P ∧ Q) ⇔ (Q ∧ P)

7. Absorption laws:
(a) [P ∨ (P ∧ Q) ]⇔ P (b) [P ∧ (P ∨ Q) ]⇔ P

8. DeMorgan laws:
(a) ¬(P ∨ Q) ⇔ ¬P ∧ ¬Q (b) ¬(P ∧ Q) ⇔ ¬P ∨ ¬Q
9. Associative laws:
(a) P ∨ (Q∨ R) ⇔ (P ∨ Q) ∨ R
(b) P ∧ (Q∧ R) ⇔ (P ∧ Q )∧ R

10. Distributive laws:


(a)P ∨ (Q ∧ R) ⇔ (P ∨ Q) ∧ (P ∨ R)
(b) P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)

Note: The conditional p  q is equivalent to (~p v q)


p q  ( p  q)
Ex. Without using truth tables, Show that P  ( Q  R)  ( P  Q )  R

Proof:
L.H.S = P  (Q  R)
 P  (Q  R) (Since p q  ( p  q))
 P (Q  R)
 P (Q  R)
(P  Q)  R (By using associative law)
( P  Q )  R (By using demorgan law)
P  Q
 ( P  Q ) R
= R.H.S

M. RAMA 60
Ex. Without using truth tables, Show that ( P  Q ) P is a tautology.

Proof:
Consider, (P  Q ) P
 (P  Q ) P
 ( Q  P ) P ( By commutative law )
 Q  ( P  P ) ( By associative law)
Q T ( By inverse law)
T ( By domination law)

 ( P  Q )  P is a tautology.

M. RAMA 61
Ex. Show that the Statement formula ( P  Q ) (PQ)  P is a tautology.

Proof :
Consider, {( P  Q ) (PQ)} P
 {(P  Q ) (PQ)}  P (Demorgan’s law)
 {P  (Q Q)}P (Inverse law)
 {P  T }  P (Distributive law)
 {P }  P (Identity law)
T (Inverse law)

 ( P  Q )  (PQ)  P is a tautology

M. RAMA 62
Ex. Show that [{( P  Q )  ( P  Q )}  R ]  R

Proof: L.H.S = {( P  Q )  ( P  Q )}  R
 {( P  Q )  ( P  Q )}  R (Since P  Q  ( P  Q))
PP ( P  P  ( P  P) )
 { ( P  Q )  ( P  Q )}  R
P V P (By using Inverse law- (Pv~P)  T)
{T}R
 R (By using Identity law- (P  T)  P)
= R.H.S

M. RAMA 63
Ex. Show that {( P  Q )  ( P  Q )} is a Contradiction.

Proof : Consider,
{( P  Q )  ( P  Q )} Let P  Q = R
 { R  R }
 F

 { ( P  Q )  ( P  Q )} is a contradiction.
Ex. Show that (P  (Q  R))  ( Q  R )  (P  R) R
Proof : Consider,
{P  (Q  R)}  ( Q  R )  (P  R)

 {(P  Q)  R}  {( Q  R )  (P  R)}, By associative law

 { (P  Q)  R}  {(Q P )  R} , By distributive law


 { (P Q)  R}  {(Q  P )  R} , By Demorgan’s law

 { (P Q)  (Q  P ) }  R,

 {T }  R (Since, p  p T) By distributive law

R

M. RAMA 65
Ex. S.T. [(P  Q)  {P  (Q  R)}]  ( P  Q)  (P  R) is a
tautology.
Consider,
[(P  Q)   {P  (Q  R)}]  {(P  Q)  (P  R)}
 [(P  Q)   {P  (Q  R)}]  {(P  Q)  (P  R)} (By Demorgan laws)
 [(P  Q)  {P  (Q  R)}]   {(P  Q)  (P  R)}
 [(P  Q) {(P  Q)  (P  R)} ]   {(P  Q)  (P  R)} (By Distributive law)
 [(P  Q)  (P  Q)  (P  R)]   {(P  Q)  (P  R)} (By Distributive law)
P P (Since p p  p)
 {(P  Q)  (P  R)}   {(P  Q)  (P  R)}
P v ~P (By Inverse law p  p T)
 T

M. RAMA 66
Table

S. No. Disjunctions Conjunctions Laws


1 P V P P P P P Idempotent Law
2 P V F P P T P
Identity Law
3 P V P  T P  P  F
Inverse Law
4 P VTT P F F
Domination aw
5 P VQQV P P Q Q P Commutative Law
6 P V (P  Q)  P P  (P V Q)  P Absorption law
7 (P V Q)  P  Q (P  Q)  P V Q De Morgan’s law
8 (P V Q) V R  P V (Q V R) (P  Q)  R  P  (Q  R) Associative Law

9 P V (Q  R)  (P V Q)  (P V R) P  (Q V R)  (P  Q) V (P  R) Distributive Law
Simplify the following compound proposition using the laws of logic:

i) (p v q)  [¬{(¬p)  q}]

 (p v q)  [¬ ¬p) v ¬q)] (By DeMorgan Law)


 (p v q)  [p v ¬q)] (By Law of double negation)
 p v (q  ¬q) (By Distributive Law)

pvF (By Inverse Law)

p (By Identity Law)


Simplify the following compound proposition using the laws of logic:

ii) (p v q)  ¬[(¬p) v q}]

 (p v q)  p  ¬q)]

 [(p v q)  p]  ¬q)] (Using Assosiative Law)

 p  (p v q)  ¬q) (Using commutative Law)


 p  ¬q) (using Absorption Law)
Simplify the following compound proposition using the laws of logic:

ii) ¬[¬{(p v q)  r} v ¬q]

 ((p v q)  r   q (double negation Law)

 ((p v q)  r  q) (using associative Law)

 [(p v q)  q ]  r (using Associative Law)


qr (using Absorption Law)
Exercises:
Indicate the negation of the following compound propositions:

1. 3 is a prime and 4 is even


Solution:
3 is not a prime or 4 is not even

2. 2<3 or 4<3
Solution:
2>=3 and 4>=3
Exercises:
3. Rewrite the following statements without using the conditional:
[Hint: ( p q  ( p  q) ) ]
a) If I dream of home, then I will work hard and earn money
I do not dream of home or I will work hard and earn money

b) If I am awake, then I will work on the computer or read a novel


I am not awake, or I will work on the computer or read a novel
c) If I study mathematics and discrete structures, then I will not fail in the
examination.
I do not study mathematics or discrete structures, or I will not fail in the
examination.
Example:
Indicate the negation of the following compound propositions:
4. If it rains, then I do not drive the car
Solution:
It rains and I drive the car

Explanation:
p: It rains q: I do not drive the car
p q: If it rains then I do not drive the car
( p q  ( p  q) )
the negation of above statement is: It rains and I drive the car
[negation of p q is ~ ( p  q) equal to ( p ∧ q) ]
Exercises:
5. Write down the negation of each of the following statements:
[Hint: ( p q  ( p  q) ) negation is (p ∧ ¬ q) ]
a) If I dream of home, then I will work hard and earn money
I dream of home and I will not work hard or will not earn money
b) If I am awake, then I will work on the computer or read a novel
I am awake, and I will not work on the computer and I will not read a novel
c) If I study mathematics and discrete structures, then I will not fail in the
examination.
I study mathematics and discrete structures, and I will fail in the examination.
Exercises:
6. Indicate the negation of the following compound propositions:
1) If an integer is greater than 2 and less than 4, then it is divisible by 3
2) (p v q) ∧ r
3) p → (q → r)
4) (p ∧ r) → (q v r)
5) (p v q) → r
6) (p ∧ q) → r
7) p → (¬ q ∧ r )
Solutions:
1. An integer is greater than 2 and less than 4, and it is not divisible by 3
2. (p v q) ∧ r (¬p ∧ ¬q) v ¬r

3. p → (q → r) p ∧ (q ∧ ¬ r)

4. (p ∧ r) → (q v r) (p ∧ r) ∧ (¬ q ∧ ¬ r)
5. (p v q) → r (p v q) ∧ ¬ r
6. (p ∧ q) → r (p ∧ q) ∧ ¬ r)
7. p → (¬ q ∧ r ) p ∧ (q v ¬ r)
Exercises:
1. Verify the Identity, Inverse and Domination laws through truth
tables.
2. Prove that DeMorgan law: ¬(P ∧ Q) ⇔ ¬P ∨ ¬Q
3. Prove that Distributive law: P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
PART-3
Transitive Rule
Substitution Rule
Duality Law
NAND and NOR connectives
Logical Implications
Tautological Implication
Transitive Rule: If u, v, w are prepositions such that u ⇔ v and v ⇔ w,
then u ⇔ w

Substitution Rule:

(1) suppose that a compound proposition u is a tautology and p is a


component of u. if we replace each occurrence of p in u by a proposition q,
then the resulting compound proposition v is also a tautology.( this is called a
substitution Rule)

(2) Suppose that u is a compound proposition which contains a component p.


Let q be a proposition such that q ⇔ p. suppose we replace one or more
occurrence of p by q and obtain a compound proposition v. then v ⇔ u.( this
is also a Substitution Rule)
Duality Law
Two formulas u and ud 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 u contains the special variable T or F , then ud , its dual is obtained
by replacing T by F and F by T in addition to the above mentioned interchanges.

The following 2 rules are of important:


1) (ud) d ⇔ u. (i.e., dual of the dual of u is logically equivalent to u)
2) For any 2 propositions u and v, if u ⇔ v, then ud ⇔ vd . (This is known as the
Principle of Duality)
Example -1: 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)
Example -2 : Write down the duals of the following propositions
i) ¬(p v q) ∧ [p v ¬(q ∧ ¬s)]
ii) (p ∧ q)v [(¬p v q) ∧ (¬r v s)] v (r ∧ s)

Solutions:
i) ¬(p ∧ q) v [p ∧ ¬ (q v ¬s)]
ii) (p v q) ∧ [(¬p ∧ q) v (¬r ∧ s)] ∧ (r v s)
Example-3 : Write down the duals of the following propositions
i) p → q
We recall that (p → q) ⇔ (¬p v q)
(p → q)d ⇔ (¬p v q)d
 ¬p ∧ q
ii) [(p → q) → r] d ⇔ [¬(p → q) v r] d
⇔ [¬(¬p v q) v r] d
⇔ [(p ∧ ¬q) v r] d
 (p v ¬q) ∧ r
iii) [p → (q → r)] d ⇔ ¬p ∧ (¬q ∧ r)
Exercises:
Write down the duals of the following compound propositions:
1. q → p u = ¬q v p ud = ¬q ∧ p
2. (p v q) ∧ r ud = (p ∧ q) v r
3. (p ∧ q) v T ud = (p v q) ∧ F
4. p →(q ∧ r) u= ¬p v (q ∧ r) ud= ¬p ∧ (q v r)
5. p ↔ q u=(p →q) ∧ (q → p), u=(¬p v q) ∧ (¬q v p)
ud=(¬p ∧ q) v (¬q ∧ p)
6. p v q ud = ¬(p ↔ q) ud = (p v ¬q) ∧ (q v ¬p)
Example-4: Verify the principle of duality for the following logical equivalence
(a). ¬(P ∧ Q) → (¬P ∨ (¬P ∨ Q)) ⇔ (¬P ∨ Q)
Solution: u=¬(P ∧ Q) → (¬P ∨ (¬P ∨ Q)) and v= (¬P ∨ Q)
u= ¬ (¬(P ∧ Q)) ∨ (¬P ∨ (¬P ∨ Q)) [∵ P → Q ⇔ ¬P ∨ Q]
⇔ (P ∧ Q) ∨ (¬P ∨(¬P ∨ Q))
Therefore,
ud⇔ (P V Q) ∧ (¬P ∧ (¬P ∧ Q))
⇔ (P V Q) ∧ (¬P ∧ Q)
⇔ [(P ∧ (¬P ∧ Q)] ∨ [(Q ∧ (¬P ∧ Q)]
⇔ (F ∧ Q) ∨ (Q ∧ ¬P )
⇔ F V (Q ∧ ¬ P)
⇔ (¬P ∧ Q)

Also, vd ⇔ (¬P ∧ Q)
We observe that ud⇔ vd
Exercises:

1. Prove that (¬p v q) ∧ (p ∧ (p ∧ q)) ⇔ p ∧ q


Hence deduce that (¬p ∧ q) v (p v (p v q)) ⇔ p v q
2. Verify the principle of duality for the following logical equivalence
(P ∨ Q) ∧ (¬P ∧ (¬P ∧ Q)) ⇔ (¬P ∧ Q)
[ Hint: (P ∧ Q) ∨ (¬P ∨(¬P ∨ Q)) ⇔ (¬P ∨ Q) from ex-4 ]
The Connectives NAND and NOR
We introduce the connectives NAND, NOR which have useful applications in the
design of computers.
NAND: The word NAND is a combination of ‘NOT‘ and ‘AND‘ where ‘NOT‘ stands for
negation and ‘AND‘ for the conjunction. It is denoted by the symbol ↑.
The compound proposition ¬(P ∧ Q) is read as “Not (p and q)” and is denoted by
(p ↑ q)
If P and Q are two propositions then
P ↑ Q ⇔ ¬(P ∧ Q) [Not P and Q]
⇔ ¬P v ¬Q
The connective ↑ has the following equivalence:
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.
NAND is Commutative:
Let P and Q be any two statement formulas.
(P ↑ Q) ⇔ ¬(P ∧ Q)
⇔ ¬(Q ∧ P )
⇔ (Q ↑ P )
∴ NAND is commutative.
(P ↑ Q) ⇔ (Q ↑ P )
NAND is not Associative:
Let P , Q and R be any three statement formulas.
Consider
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
Therefore the connective ↑ is not associative.
NOR:
The word NOR is a combination of ‘NOT‘ and ‘OR‘ where ‘NOT‘ stands for
negation and ‘OR‘ for the disjunction. It is denoted by the symbol ↓.
If P and Q are two formulas then
P ↓ Q ⇔ ¬(P ∨ Q)

The connective ↓ has the following equivalence:


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.
NOR is Commutative:
Let P and Q be any two statement formulas.
(P ↓ Q) ⇔ ¬(P ∨ Q)
⇔ ¬(Q ∨ P )
⇔ (Q ↓ P )

∴ NOR is commutative.
(P ↓ Q) ⇔ (Q ↓ P )
NOR is not Associative:
Let P , Q and R be any three statement formulas.
Consider
P↓ (Q ↓ R) ⇔ ¬(P ∨ (Q ↓ R))
⇔ ¬(P ∨ (¬(Q ∨ R)))
⇔ ¬P ∧ (Q ∨ R)
(P ↓ Q) ↓ R ⇔ ¬(P ∨ Q) ↓ R
⇔ ¬(¬(P ∨ Q) ∨ R)
⇔ (P ∨ Q) ∧ ¬R
Therefore the connective ↓ is not associative.
Points:
i) NAND is commutative. (P ↑ Q) ⇔ (Q ↑ P )
ii) NAND is not associative.
iii) NOR is commutative. (P ↓ Q) ⇔ (Q ↓ P )
iv) NOR is not associative.
v) P ↑ Q and P ↓ Q are duals of each other.
Since
¬(P ∧ Q) ⇔ ¬P ∨ ¬Q
¬(P ∨ Q) ⇔ ¬P ∧ ¬Q.
Truth Table for (P ↑ Q) and (P ↓ Q)

P Q P↑Q P↓Q
0 0 1 1
0 1 1 0
1 0 1 0
1 1 0 0
Example: Show that (A ⊕ B) ∨ (A ↓ B) ⇔ (A ↑ B).
Solution: We prove this by constructing truth table.

A B A⊕B A ↓B (A ⊕ B)V(A ↓B) A↑B


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

As columns (A ⊕ B) ∨ (A ↓ B) and (A ↑ B) are identical.


∴ (A ⊕ B) ∨ (A ↓ B) ⇔ (A ↑ B).
Examples:
Express P ↓ Q in terms of ↑ only.
Solution:
P ↓ Q ⇔ ¬(P ∨ Q) [¬P ⇔ (P ↑ P)]
⇔ (P ∨ Q) ↑ (P ∨ Q)
⇔ [(P ↑ P ) ↑ (Q ↑ Q)] ↑ [(P ↑ P ) ↑ (Q ↑ Q)]
Express P ↑ Q in terms of ↓ only.
Solution:
P ↑ Q ⇔ ¬(P ∧ Q)
⇔ (P ∧ Q) ↓ (P ∧ Q)
⇔ [(P ↓ P ) ↓ (Q ↓ Q)] ↓ [(P ↓ P ) ↓ (Q ↓ Q)]
Examples:
Prove the following
i) ¬(P ↓ Q) ⇔ ¬P ↑ ¬Q ii) ¬(P ↑ Q) ⇔ ¬P ↓ ¬Q
Solution:
i) ¬(P ↓ Q) ⇔ ¬[¬ (P ∨ Q)]
⇔ ¬[(¬P)∧ (¬Q)]
⇔ (¬P)↑(¬Q)
ii) ¬(P ↑ Q) ⇔ ¬[¬ (P ∧ Q)]
⇔ ¬[(¬P) V (¬Q)]
⇔ (¬P) ↓ (¬Q)
Exercises:
Prove the following:
i) p↑(q ↑ r) ⇔ ¬p v (q ∧ r)
ii) (p↑q) ↑ r ⇔ (p ∧ q) v ¬r
iii) p ↓(q ↓ r) ⇔ ¬p ∧ (q v r)
iv) (p ↓ q) ↓ r ⇔ (p v q) ∧ ¬r
Note: [p↑(q ↑ r)] ⇔ [(p↑q) ↑ r] and
[p ↓(q ↓ r)] ⇔ [(p ↓ q) ↓ r]
That is, the connectives ↑ and ↓ are not associative.
Solutions:
1) p ↑ (q ↑ r) ⇔ ¬p v (q ∧ r)
Solution:
⇔ ¬ (p ∧ (q ↑ r))
⇔ ¬ p ∨ ¬ (q ↑ r)
⇔ ¬p ∨ (¬(¬ (q ∧ r)))
⇔ ¬p ∨ (q ∧ r)
2) (p ↑ q) ↑ r ⇔ (p ∧ q) v ¬r
Solution:
⇔ ¬ ((p ↑ q) ∧ r)
⇔ ¬ (p ↑ q) ∨ ¬r
⇔ ¬ (¬ (p ∧ q)) ∨ ¬r
⇔ (p ∧ q) ∨ ¬ r
3) p ↓ (q ↓ r) ⇔ ¬p ∧ (q v r)
Solution:
⇔ ¬ (p ∨ (q ↓ r))
⇔ ¬ (p) ∧ ¬ (q ↓ r)
⇔ ¬ p ∧ (¬ (¬ (q ∨ r)))
⇔ ¬ p ∧ (q ∨ r)
4) (p ↓ q) ↓r ⇔ (p v q) ∧ ¬r
Solution:
⇔ ¬ ((p ↓ q) v r)
⇔ ¬ (p ↓ q) ∧ ¬r
⇔ ¬ (¬ (p ∨ q)) ∧ ¬r
⇔ (p ∨ q) ∧ ¬r
Examples:
Express the following propositions in terms of only NAND and only NOR connectives
i) ¬p ii) p ∧ q iii) p v q iv) p → q

Solutions:
i) For any proposition p, we have p ∧ p  p and p v p  p.
Therefore, ¬p ⇔ ¬(p ∧ p)
⇔ (p ↑ p)
Also, ¬p ⇔ ¬(p v p)
⇔ (p ↓ p)
ii) p ∧ q
p ∧ q ⇔ ¬[¬(p ∧ q)] [P ↑ Q ⇔ ¬(P ∧ Q)]
⇔ ¬ (p ↑ q) [¬p ⇔ (p ↑ p)]
⇔ (p ↑ q) ↑ (p ↑ q)
Also,
p ∧ q ⇔ ¬(¬p) ∧ ¬(¬ q)
⇔ ¬[(¬p) v (¬ q)] [(p ↓ q) ⇔ ¬(p v q)]
⇔(¬p) ↓ (¬q) [¬p ⇔ (p ↓ p)]
⇔ (p ↓ p) ↓ (q ↓ q)
iii) p v q
p v q ⇔ ¬(¬p) v ¬(¬ q)
⇔ ¬[(¬p) ∧ (¬ q)] [P ↑ Q ⇔ ¬(P ∧ Q)]
⇔ (¬p) ↑ (¬q) [¬p ⇔ (p ↑ p)]
⇔(p ↑ p) ↑ (q ↑ q)
Also,
p v q ⇔ ¬¬(p v q)
⇔ ¬[¬(p v q)] [(p ↓ q) ⇔ ¬(p v q)]
⇔ ¬ (p ↓ q) [¬p ⇔ (p ↓ p)]
⇔ (p ↓ q) ↓ (p ↓ q)
iv) p → q
p → q ⇔ ¬ ¬(p → q) [(p → q)⇔ (¬p v q)]
⇔ ¬[¬(¬p v q)]
⇔ ¬ (p ∧ ¬q) [P ↑ Q ⇔ ¬(P ∧ Q)]
⇔ p ↑(¬q) [¬p ⇔ (p ↑ p)]
⇔ p ↑(q ↑q)
Also,
p → q ⇔(¬p v q) [using above (iii) P∨ Q ⇔ (P ↓ Q) ↓ (P ↓ Q)]
⇔ (¬p ↓ q) ↓(¬p ↓ q),
⇔ [(p ↓ p) ↓ q)] ↓[(p ↓ p) ↓ q)
Exercises:
1. Prove that
a) (p ↑ q) ⇔ (q ↑ p)
b) (p ↓ q) ⇔ (q ↓ p)
2. Prove that [p→ (¬p→ q)] ⇔ [p ↑ (p ↓ q)]
3. Prove the following
a) (p ↑ q) ⇔ (¬p ∧ q)v (p ∧ ¬q) v (¬p ∧ ¬q)
b) (p ↓ q) ⇔ (¬p v q) ∧ (p v ¬q) ∧ (¬p v ¬q)
Logical Implication

A conditional statement (p → q) has two parts − Hypothesis and


Conclusion.
Example of Conditional Statement :
“If you do your homework, you will not be punished.”
Here, "you do your homework" is the hypothesis and
"you will not be punished" is the conclusion
Converse
Inverse
Contra positive

M. RAMA 29
Converse: It is defined as interchanging the implication
Ex: The converse of p  q is q  p
Inverse (opposite): It is defined as the negation of the implication
Ex: The opposite of p  q is p  q
Contra positive : It is defined as the negation of converse of the original statement.
Ex: The contra positive of p  q is q  p
Consider a conditional p → q
1) q → p is called the Converse of p → q.
2) ¬p →¬q is called the inverse (or opposite) of p → q
3) ¬q →¬p is called the Contra positive of p → q
30
Example: p: 2 is an integer q: 9 is a multiple of 3
Then
p → q: If 2 is an integer then 9 is a multiple of 3.
Converse of this conditional is
q → p : if 9 is a multiple of 3 then 2 is an integer .
The inverse is
¬p →¬q: If 2 is not an integer then 9 is not a multiple of 3.
The Contrapositive is:
¬q →¬p: if 9 not is a multiple of 3 then 2 is not an integer
Truth table for Converse, Inverse and Contra positive
p q ¬p ¬q p → q q → p ¬p →¬q ¬q →¬p

0 0 1 1 1 1 1 1
0 1 1 0 1 0 0 1
1 0 0 1 0 1 1 0
1 1 0 0 1 1 1 1

p → q ⇔ ¬q →¬p ( Conditional ⇔Contrapositive)


q →p ⇔ ¬p →¬q (Converse ⇔ Inverse)

32
Points:
1. A conditional & its contra positive are logically equivalent.
i.e., p  q is logically equivalent to q  p
denoted as p  q  q  p (or) p  q  q  p
2. The converse & inverse of a conditional are logically equivalent.
i.e., qp  p  q
3. (pq) and(qp) do not have same truth values in all situations.
i.e., (pq)  (qp)
Ex: p: Today is Sunday q: Today is Holiday
• p  q : If today is Sunday, then today is Holiday
•q  p :If today is not Holiday, then today is not Sunday
If p  q is true then it’s converse q  p need not be true.
If p  q is true then it’s opposite p  q need not be true.
Example: Consider the statement
P : It rains.
Q: The crop will grow.
The implication P → Q states that
If it rains then the crop will grow.
The converse of the implication P → Q, namely Q → P states that
If the crop will grow then there has been rain.
The inverse of the implication P → Q, namely ¬P → ¬Q states that
If it does not rain then the crop will not grow.
The contrapositive of the implication P → Q, namely ¬Q → ¬P states that
If the crop do not grow then there has been no rain.
Exercises
Write converse ,inverse and contra positive for the following statements :
1) If P is a square, then Q is a rectangle
2) If c is rational, then the decimal expansion of r is repeating
3) If n is prime, then n is odd or n is 2
4) If x is non negative, then x is positive or x is 0
5) If Tom is Ann’s father, then Jim is her uncle and Sue is her aunt
6) If n is divisible by 6, then n is divisible by 2 and n is divisible by 3
7) If you drive, then you don’t drink.
8) If x2 is an even number, then x is an even number.

35
Tautological Implications
A statement formula p is said to tautologically imply a statement q if and only if
p→ q is a tautology
In this case we write p ⇒ q, which is read as ‘p implies q‘.
Note: ⇒ is not a connective, p ⇒ q is not a statement formula.

p⇒ q states that p → q is tautology.

Clearly p ⇒ q guarantees that q has a truth value T whenever p has the truth
value T .
One can determine whether p ⇒ q by constructing the truth tables of p and q
in the same manner as was done in the determination of p ⇔ q.

36
Example: 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

Since all the entries in the last column are true, (P → Q) → (¬Q → ¬P ) is a
tautology.
Hence (P → Q) ⇒ (¬Q → ¬P ).
37
Show that [p ∧ (p → q)] ⇒q

p q p → q p ∧ (p → q) p ∧ (p → q) → q
0 0 1 0 1
0 1 1 0 1
1 0 0 0 1
1 1 1 1 1
Since all the entries in the last column are true, p ∧ (p → q) → q
is a tautology.
Hence [p ∧ (p → q)] ⇒q
38
Ex: S.T [p ∧ (p → q) ∧r] ⇒[(p ∨q) →r]
p q r p→q p ∨q p ∧ (p → q) ∧r (p ∨q) →r X→Y
0 0 0 1 0 0 1 1
0 0 1 1 0 0 1 1
0 1 0 1 1 0 0 1
0 1 1 1 1 0 1 1
1 0 0 0 1 0 0 1
1 0 1 0 1 0 1 1
1 1 0 1 1 0 0 1
1 1 1 1 1 1 1 1

Hence [p ∧ (p → q) ∧r] ⇒[(p ∨q) →r]

39
Example: Prove that ¬Q ∧ (P → Q) ⇒ ¬P
Solution: Assume that the antecedent(L.H.S) ¬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 truth value F , P → Q has the truth value T .
Hence P must have the truth value F .
Therefore the consequent ¬P must have the truth value T.
Truth Table for ¬Q ∧ (P → Q) ⇒ ¬P . ¬Q ∧ (P→Q) ¬Q ∧ (P →Q) → ¬P
P Q ¬P ¬Q P→Q

F F T T T T T

F T T F T F T

T F F T F F T

T T F F T F T

40
Another method to show: A ⇒ B is to assume that the consequent B
has the truth value F and then show that this assumption leads to A
having the truth value F . Then A → B must have the truth value T .
Example: Show that ¬(P → Q) ⇒ P .
Solution: Assume that P has the truth value F . When P has F , P → Q
has T , then ¬(P → Q) has F
Hence ¬(P → Q) → P has T .
¬(P → Q) ⇒ P

41
42
PART – 4
Normal Forms
1. Disjunctive Normal Form (DNF).
2. Conjunctive Normal Form (CNF).
3. Principal Disjunctive Normal Form (PDNF).
4. Principal Conjunctive Normal Form (PCNF).
Normal Forms
Let A(P1, P2, …, Pn) be a statement formula where P1, P2, …, Pn are the atomic
variables.
The truth table for A consists of truth values for A, for all possible assignments of
the truth values to P1, P2, …, Pn.
 If the formula A have the truth value T for all possible combinations, then it is
called as identically true or tautology.
The truth value F for all possible combinations, then it is called as identically false
or contradiction.
The truth value T for at least one combination, then it is called as satisfiable.
 A decision problem is a problem of determining, whether the given formula is a
tautology, contradiction or at least satisfiable in a finite number of steps.
The straight forward approach for determination is by constructing the truth
tables. But, it is tedious and complicate when there are many component
variables in the given formula.
The alternative procedure is reduce the given formula to normal forms.
 It will be convenient to use the word “product” in place of “conjunction” and
“sum” in place of “disjunction” in our current discussion.
A product of the variables and their negations in a formula is called an
elementary product.
Ex: (P ∧ ¬P ), (P ∧ Q)
 Similarly, a sum of the variables and their negations in a formula is called an
elementary sum.
Ex: (P ∨ P), (¬P ∨ Q)
There are four types of normal forms :

1. Disjunctive Normal Form (DNF).


2. Conjunctive Normal Form (CNF).
3. Principal Disjunctive Normal Form (PDNF).
4. Principal Conjunctive Normal Form (PCNF).
Disjunctive Normal Form (DNF)
Def-1: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.
Def 2: Given a compound proposition u, suppose we obtain a compound
proposition v such that (i) u ≡ v, and (ii) v is a disjunction of two or more
compound propositions each of which is a conjunction involving the
components of u or their negations. Then v is called a disjunctive normal form
of u.
Example-1: Obtain disjunctive normal form of P ∧ (P → Q)
Solution:
We have P ∧ (P → Q) ⇔ P ∧ (¬P ∨ Q)
⇔ (P ∧ ¬P ) ∨ (P ∧ Q) [( ∧ )v( ∧ )v( ∧ )]
Ex- 2. Construct the disjunctive normal form of the formula: ¬( P → (Q ∧R))

¬( P → (Q ∧R) ⇔ ¬ (¬P ∨ (Q ∧R)) [P →Q ⇔ ¬P ∨ Q)]


⇔ (P∧ ¬ (Q ∧ R))
⇔ (P∧ (¬ Q ∨ ¬ R)) [Demorgan’s law]
⇔ (P∧ ¬ Q ) ∨ (P∧ ¬ R)) [distributive law]
Ex-3:Construct the disjunctive normal form of the formula: P↔Q?

P↔Q ⇔ (P → Q) ∧ (Q → P)
⇔ (¬ P ∨ Q) ∧ (¬ Q ∨ P)
⇔ [(¬ P ∨ Q) ∧ ¬ Q ] ∨ [(¬ P ∨ Q) ∧ P] [Distributive Law]
⇔ (¬ P ∧ ¬ Q )∨ (Q ∧ ¬ Q ) ∨ (¬ P ∧ P )∨ (Q ∧ P)
⇔ (¬ P ∧ ¬ Q )∨ F ∨ F∨ (Q ∧ P) [Inverse law]
⇔ (¬ P ∧ ¬ Q ) ∨ F V (Q ∧ P)
⇔ (¬ P ∧ ¬ Q ) ∨ (Q ∧ P)
Ex-4: Find disjunctive normal form of the compound proposition
P →{(P →Q) ∧¬(¬Q ∨ ¬P)}
P →{(P →Q) ∧¬(¬Q ∨ ¬P)} ⇔ ¬P ∨ {(P →Q) ∧¬(¬Q ∨ ¬P)}
⇔ ¬P ∨ {(¬ P ∨ Q) ∧ (Q ∧P)} [P →Q ⇔(¬ P ∨ Q)]
⇔ ¬P ∨ {(¬ P ∨ Q) ∧ (Q ∧P)} [Distributive Law]
⇔ ¬P ∨ {(¬ P ∧ (Q ∧P)) ∨ (Q∧ (Q ∧P)}
⇔ ¬P ∨ {(¬ P ∧ P) ∧Q) ∨ ((Q∧ Q) ∧P)} [commutative law]
⇔ ¬P ∨ {F0 ∧Q) ∨ ((Q ∧P)} [Inverse law(¬ P ∧ P) ⇔ F0 ]
⇔ ¬P ∨ {F0 ∨ ((Q ∧P)} [Domination law( P ∧ F0) ⇔ F0 ]
⇔ ¬P ∨ (Q ∧P) [Identity law( P V F0) ⇔ P ]
⇔ (¬P ∧T0 )∨ (Q ∧P) [(¬P ∧T0 ) ⇔¬P identity Law]
Example - 5: Obtain disjunctive normal forms of ¬(P ∨ Q) ↔(P ∧ Q)
Solution: ¬(P ∨ Q) ↔(P ∧ Q)
R S
⇔ (¬(P ∨ Q) ∧ (P ∧ Q)) ∨ (¬(¬(P ∨ Q)) ∧ ¬(P ∧ Q)) [using R↔ S ⇔ (R ∧ S) ∨ (¬R ∧ ¬S)]
⇔ (¬(P ∨ Q) ∧ (P ∧ Q)) ∨ ((P ∨ Q) ∧ ¬(P ∧ Q))
⇔ ((¬P ∧ ¬Q) ∧ (P ∧ Q)) ∨ ((P ∨ Q) ∧ (¬P ∨ ¬Q))
⇔ (¬P ∧ ¬Q ∧ P ∧ Q) ∨ ((P ∨ Q) ∧ ¬P ) ∨ ((P ∨ Q) ∧ ¬Q)
⇔ (¬P ∧ ¬Q ∧ P ∧ Q) ∨ (P ∧ ¬P ) ∨ (Q ∧ ¬P ) ∨ (P ∧ ¬Q) ∨ (Q ∧ ¬Q)
⇔ (¬P ∧ P) ∧ (¬Q ∧ Q) V (P ∧ ¬P ) ∨ (Q ∧ ¬P ) ∨ (P ∧ ¬Q) ∨ (Q ∧ ¬Q)
⇔ F0 ∧ F0 ∨ F0 ∨ (Q ∧ ¬P ) ∨ (P ∧ ¬Q) V F0
⇔ F0 ∨ F0 ∨ (Q ∧ ¬P ) ∨ (P ∧ ¬Q)
⇔ (Q ∧ ¬P ) ∨ (P ∧ ¬Q)

Note: The DNF of a given formula is not unique.


Conjunctive Normal Form (CNF)
Def 1: 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.
Def 2: Given a compound proposition u, suppose we obtain a compound proposition
v such that (i) u ≡ v, and (ii) v is a conjunction of two or more compound
propositions each of which is a disjunction involving the components of u or their
negations. Then v is called a conjunctive normal form of u.

Example -1: Obtain conjunctive normal form of P ∧ (P → Q)


Solution: P ∧ (P → Q)
⇔ P ∧ (¬P ∨ Q) (Idempotent Law (P ∨ P) ⇔ P)
⇔ (P ∨ P)∧ (¬P ∨ Q) [( v )∧( v )∧( v )]
EX-2: Find conjunctive normal form of the compound proposition
{(q ∨(p ∧ r)} ∧ ¬ {(p ∨r) ∧q}

{(q ∨(p ∧ r)} ∧ ¬ {(p ∨r) ∧q}

⇔ {(q ∨p) ∧ (q ∨ r)} ∧ {(¬ p ∧ ¬ r) ∨ ¬ q}

⇔ (p ∨q) ∧ (q ∨ r) ∧ (¬p ∨ ¬q) ∧ (¬r ∨ ¬q)


Example -3: Show that the formula Q ∨ (P ∧ ¬Q) ∨ (¬P ∧ ¬Q) is a tautology.
Solution: First we obtain a CNF of the given formula.
Q ∨ (P ∧ ¬Q) ∨ (¬P ∧ ¬Q)
⇔ Q ∨ ((P ∨ ¬P ) ∧ ¬Q) [By Distribute Law]
⇔ (Q ∨ (P ∨ ¬P )) ∧ (Q ∨ ¬Q) [By Distribute Law]
(The R.H.S. is a conjunctive normal form of L.H.S)
⇔ (Q ∨ T0 ) ∧ T0
⇔ T0 ∧ T0
⇔ T0
Thus, this conjunctive normal form is a tautology. Therefore, the given Compound
Proposition is a tautology.
Example-4: Obtain conjunctive normal forms of ¬(P ∨ Q)↔ (P ∧ Q).

¬(P ∨ Q)↔ (P ∧ Q) ((P ↔ Q)⇔ (P →Q) ∧ (Q →P))


⇔ (¬(P ∨ Q) → (P ∧ Q)) ∧ ((P ∧ Q) → ¬(P ∨ Q)) [p →q ⇔ ¬P ∨Q]
⇔ (¬[¬(P ∨ Q)] ∨ (P ∧ Q)) ∧ (¬(P ∧ Q) ∨ ¬(P ∨ Q))
⇔ ((P ∨ Q) ∨ (P ∧ Q)) ∧ (¬(P ∧ Q) ∨ ¬(P ∨ Q)) (Distributive Law)
⇔ [(P ∨ Q ∨ P ) ∧ (P ∨ Q ∨ Q)] ∧ [(¬P ∨ ¬Q) ∨ (¬P ∧ ¬Q)]
⇔ (P ∨ Q ∨ P ) ∧ (P ∨ Q ∨ Q) ∧ (¬P ∨ ¬Q ∨ ¬P ) ∧ (¬P ∨ ¬Q ∨ ¬Q)
⇔(P ∨ Q) ∧ (P ∨ Q) ∧ (¬P ∨ ¬Q ) ∧ (¬P ∨ ¬Q ) (Idempotent Law)
⇔(P ∨ Q ) ∧ (¬P ∨ ¬Q )
Note: A given formula is tautology if every elementary sum in CNF is tautology.
Find DNF and CNF for ((P  Q)  R  (P → Q))
 ((P  Q)  R  (P  Q))
 (P  Q)  R  (P  Q)
 (P  Q)  R  (P  Q) [demorgan’s Law]
 (P  Q)  R  (P  Q) DNF [ double negation]

 ((P  R)  (Q  R))  (P  Q) [Distributive law]


 ((P  R)  (P  Q))  ((Q  R)  (P  Q))
 (((P  R)  P)  ((P  R)  Q))  ((Q  R)  P)  ((Q  R)  Q)
 (P  R)  (P  R  Q)  (Q  R) CNF

31/16
Exercises:
Find the disjunctive normal forms of the following:
1. (p v q v ~q) ∧ (p v ~p)
2. ~{p->(q ∧ r )}
3. p v [ ~p -> {q v (q ->~r)}]
4. Using the truth table, obtain a disjunctive normal form of
{ p ∧ ¬(q v r)} v [ { (p ∧ q) v ¬r} ∧ p ]
5. Find the conjunctive normal forms of the following:
i) (q->p) ∧(~p ∧ q )
ii) q v (p ∧ ¬q) v (¬p ∧ ¬q)
Principal Normal Forms:
Two types
1. Principal Disjunctive Normal Form
2. Principal Conjunctive Normal Form
Minterm: For a given number of variables, the minterm consists of conjunctions
in which each statement variable or its negation, but not both, appears only
once.
Let P and Q be the two statement variables. Then there are 22 minterms given by
P ∧ Q, P ∧ ¬Q, ¬P ∧ Q, and ¬P ∧ ¬Q.
Minterms for three variables P , Q and R are P ∧ Q ∧ R, P ∧ Q ∧ ¬R, P ∧ ¬Q ∧ R,
P∧ ¬Q ∧ ¬R, ¬P ∧ Q ∧ R, ¬P ∧ Q ∧ ¬R, ¬P ∧ ¬Q ∧ R and ¬P ∧ ¬Q ∧ ¬R.

P Q P∧Q P ∧ ¬Q ¬P ∧ Q ¬P ∧ ¬Q
T T T F F F
T F F T F F
F T F F T F
F F F F F T
From the truth tables of these minterms of P and Q, it is clear that
i) no two minterms are equivalent
ii) Each minterm has the truth value T for exactly one combination of the truth
values of the variables P and Q.
Principal Disjunctive Normal Form
Definition: For a given formula, an equivalent formula consisting of disjunctions of
minterms only is called the Principal disjunctive normal form of the formula.
The principal disjunctive normal formula is also called the sum-of-products canonical form.
METHOD - I:
Rules:
• First replace →, by their equivalent formula containing only ∧, ∨ and ¬.
• Next, negations are applied to the variables by De Morgan‘s laws followed by the
application of distributive laws.
• Any elementarily product which is a contradiction is dropped. Minterms are obtained in
the disjunctions by introducing the missing factors. Identical minterms appearing in the
disjunctions are deleted.
Example: Obtain the principal disjunctive normal form of
(1) P ∨ (P ∧ Q) (2)(¬P)∨ Q
Solution:
(1) P ∨ (P ∧ Q) ⇔ (P ∧ T ) ∨ (P ∧ Q) [ P ∧ T ⇔ P Identity Law ]
⇔ (P ∧ (Q ∨ ¬Q)) ∨ (P ∧ Q) [ Inverse Law P ∨ ¬P ⇔ T ]
⇔ ((P ∧ Q) ∨ (P ∧ ¬Q)) ∨ (P ∧ Q) [distributive law]
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) [Idempotent Law P ∨ P ⇔ P ]
(2) ¬P ∨ Q
Solution:
¬P ∨ Q ⇔ (¬P ∧ T ) ∨ (Q ∧ T ) [Identity Law P ∧ T ⇔ P]
⇔ (¬P ∧ (Q ∨ ¬Q)) ∨ (Q ∧ (P ∨ ¬P )) [Inverse P ∨¬P ⇔ T ]
⇔ (¬P ∧ Q) ∨ (¬P ∧ ¬Q) ∨ (Q ∧ P ) ∨ (Q ∧ ¬P)
[∵ P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
⇔ (¬P ∧ Q) ∨ (¬P ∧ ¬Q) ∨ (P ∧ Q) [Idempotent Law P ∨ P⇔ P ]
3) P ∨ (¬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.
4) P ∨ Q
P ∨ Q ⇔ (P ∧ T ) ∨ (Q ∧ T )
⇔ (P ∧ (Q ∨ ¬Q)) ∨ (Q ∧ (P ∨ ¬P ))
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (Q ∧ P ) ∨ (Q ∧ ¬P )
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (¬P ∧ Q) which is the required PDNF.
5) Example: Obtain the principal disjunctive normal form of
P → ((P → Q) ∧ ¬(¬Q ∨ ¬P )). (Nov. 2011)
Solution: Using P → Q ⇔ ¬P ∨ Q and De Morgan‘s law, we obtain
P →((P → Q) ∧ ¬(¬Q ∨ ¬P )) ⇔ ¬P ∨ ((¬P ∨ Q) ∧ (Q ∧ P ))
⇔ ¬P ∨ ((¬P ∧ Q ∧ P ) ∨ (Q ∧ Q ∧ P )) [Distributive Law]
⇔ ¬P ∨ ((¬P ∧ P ∧ Q ) ∨ (Q ∧ Q ∧ P ))
⇔¬P ∨ (F ∧ Q) ∨ (Q ∧ P) [(P ∧ ~ P )⇔ F0, P ∧ P ⇔ P ]
⇔ ¬P ∨ F v (P ∧ Q) [ (P ∧ F0)⇔ F ]
⇔ (¬P ∧ T ) ∨ (P ∧ Q) [ (P ∨ F0)⇔ P ]
⇔ (¬P ∧ (Q ∨ ¬Q)) ∨ (P ∧ Q)
⇔ (¬P ∧ Q) ∨ (¬P ∧ ¬Q) ∨ (P ∧ Q)
Hence (P ∧ Q) ∨ (¬P ∧ Q) ∨ (¬P ∧ ¬Q) is the required PDNF.
6) (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) ∨ (¬P ∧ ¬Q ∧ R)


Find PDNF for the following (p q)  (q  p)
Solution:
(p q)  (q  p) = ( p  q ) ( q p) [(p q)=  p  q ]
=  ( p  q )  ( q p)
=(p q)(q  T)  ( p T)
= (p q)(q(p p))  (p(q q))
= (p  q)(q  p)( q   p) v (p  q) v (p q)
= (p q)(p q)( p q) in PDNF.
Find PDNF for the following (p ↔ q)
Solution:

p ↔ q = (p q)  (q  p)
=( p  q )  ( q p)
= (( p  q )  q)  ( p  q )  p)
= (( p  q)  (q  q))  ( ( p  p ) (q  p))
= (( p  q)  F)  ( F  (q  p))
= (pq)(pq) in PDNF.
METHOD II

By Truth table:


(a)Construct a truth table of the given formula.
(b)For every truth value T in the truth table of the given formula, select the
minterm which also has the value T for the same combination of the truth
values of P and Q.
(c)The disjunction of these minterms will then be equivalent to the given
formula.
Example: Obtain the PDNF of P → Q.
Solution: From the truth table of P → Q

P Q P→Q Minterm

0 0 1 ¬P ∧¬Q
0 1 1 ¬P ∧Q
1 0 0 P ∧¬Q
1 1 1 P ∧Q

The PDNF of P → Q is (¬P ∧ ¬Q) ∨ (¬P ∧ Q) ∨(P ∧ Q)


Example: Obtain the PDNF for (P ∧ Q) ∨ (¬P ∧ R) ∨ (Q ∧ R).

P Q R Minterm P∧Q ¬P ∧ R Q∧R (P ∧ Q) ∨ (¬P ∧ R) ∨ (Q ∧ R)

0 0 0 ¬P ∧¬Q ∧¬R 0 0 0 0
0 0 1 ¬P ∧¬Q ∧ R 0 1 0 1
0 1 0 ¬P ∧ Q ∧¬R 0 0 0 0
0 1 1 ¬P ∧ Q ∧ R 0 1 1 1
1 0 0 P ∧¬Q ∧¬R 0 0 0 0
1 0 1 P ∧ ¬Q ∧ R 0 0 0
0
1 1 0 P ∧ Q ∧¬R 1 0 0 1
1 1 1 P∧ Q∧ R 1 0 1 1

The PDNF of (P ∧ Q) ∨ (¬P ∧ R) ∨ (Q ∧ R) is


(¬P ∧ ¬Q ∧ R) ∨ (¬P ∧ Q ∧ R) ∨ (P ∧ Q ∧ ¬R) ∨ (P ∧ Q ∧ R)
Principal Conjunctive Normal Form

The dual of a minterm is called a Maxterm. For a given number of variables, the
maxterm consists of disjunctions in which each variable or its negation, but not
both, appears only once.
Each of the maxterm has the truth value F for exactly one combination of the
truth values of the variables.
Now we define the principal conjunctive normal form.

Let P and Q be the two statement variables. Then there are 22 maxterms given by
P ∨ Q, P ∨ ¬Q, ¬P ∨ Q, and ¬P ∨ ¬Q.

(P ∨ ¬P ), (Q ∨ ¬Q ), (P ∨ T), (P ∨ F )
Max-terms for three variables P , Q and R are (P ∨ Q ∨ R), (P ∨ Q ∨ ¬R), (P ∨ ¬Q ∨R),
(P ∨ ¬Q ∨ ¬R), (¬P ∨ Q ∨ R), (¬P ∨ Q ∨ ¬R), (¬P ∨ ¬Q ∨ R )and (¬P ∨ ¬Q ∨ ¬R).

P Q P∨Q P ∨ ¬Q ¬P ∨ Q ¬P ∨ ¬Q
T T T T T F
T F T T F T
F T T F T T
F F F T T T
From the truth tables of these max-terms of P and Q, it is clear that
i) no two max-terms are equivalent
ii) Each of the max-term has the truth value F for exactly one combination of the
truth values of the variables
Principal Conjunctive Normal Form
Definition: For a given formula, an equivalent formula consisting of
conjunctions of the max-terms only is known as its principle conjunctive
normal form. This normal form is also called the product-of-sums canonical
form. The method for obtaining the PCNF for a given formula is similar to the
one described previously for PDNF.
EX: IF P,Q are two propositions then PCNF have some or all of these Max-terms
(P ∨ Q) ∧ ( P ∨ ¬Q) ∧ ( ¬P ∨ Q) ∧ (¬P ∨ ¬Q).
Method –I Rules:
• First replace →, by their equivalent formula containing only ∧, ∨ and ¬.
• Next, negations are applied to the variables by De Morgan‘s laws followed by the
application of distributive laws.
• Any elementarily product which is a Tautology is dropped. Max-terms are obtained
in the conjunctions by introducing the missing factors. Identical max-terms
appearing in the conjunctions are deleted.
Find PCNF for the following
p ↔ q = (p  q)  (q p)
= (p  q)  (q  p) in PCNF

Find PCNF [(p  q)  p   q]


[(p  q)  p   q] = [(p  q)  [(p)   q ] (p  q= p  q)

=(p  q)  (p   q)
Find PCNF of (pq)  (qp)
= (p  q)  (q  p)
= (p  q)  (q  p) (p  q= p  q)
= (p   q)  (q  p)
= (p  (q  p))  ( q  (q  p))
= (p  q  p)  ( q  q  p) [P  P ⇔ T ]
=(p  p  q) ( q  p) [ P ∧ P ⇔ P, P v T ⇔ T ]
= (p  q)  (p   q ) [ P∧T⇔P]
= (p  q) in PCNF
Find PCNF of (p  q)  ( p  q)
(p  q)  ( p  q) ⇔ [(p  q)   p]  [(p  q)  q]
⇔ [(p   p)  (q  p)]  [(p  q)  (q q)]
⇔ [T  (q  p)]  [(p  q)  q] [P  P ⇔ T, P v P ⇔ P ]
⇔ [ (q  p)]  [(p  q)  (q F)] [ P ∧ T ⇔ P, q  F ⇔q ]
⇔ [ (q  p)]  [(p  q)  (q (p  p)] [p  p ⇔F]
⇔ [ (q  p)]  [(p  q)  (q p)  (q   p)] [ Distributive ]
⇔ ( p  q)  (p  q)  (p q)  ( p  q)
⇔ ( p  q)  (p  q)
Exercises:
1. Obtain the Principal Disjunctive Normal Form of the following
i) p q ii)  (p  q)
2. By using PDNF, prove that {p ∨ (¬p∧ q)} ⇔ (p v q)
3. Obtain the Principal Conjunctive Normal Form of the following
i) ( p q) (q ↔ p) ii)  (p)  q iii) p (p v q)
Note: If the principal disjunctive (conjunctive) normal form of a given
formula A containing n variables is known, then the principal
disjunctive (conjunctive) normal form of ¬A will consist of the
disjunction (conjunction) of the remaining minterms (maxterms)
which do not appear in the
principal disjunctive (conjunctive) normal form of A. From A ⇔ ¬¬A
one can obtain the principal conjunctive (disjunctive) normal form of
A by repeated applications of De Morgan‘s laws to the principal
disjunctive (conjunctive) normal form of ¬A.
Example: Find the PDNF form PCNF of S : P ∨ (¬P → (Q ∨ (¬Q → R))).
Solution:
⇔ P ∨ (¬P → (Q ∨ (¬Q → R)))
⇔ P ∨ (¬(¬P ) ∨ (Q ∨ (¬(¬Q) ∨ R))
⇔ P ∨ (P ∨ Q ∨ (Q ∨ R)))
⇔ P ∨ (P ∨ Q ∨ R)
⇔P∨Q∨R which is the PCNF.
Now PCNF of ¬S is the conjunction of remaining maxterms, so
PCNF of ¬S : (P ∨ Q ∨ ¬R) ∧ (P ∨ ¬Q ∨ R) ∧ (P ∨ ¬Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R)
∧ (¬P ∨ Q ∨ ¬R) ∧ (¬P ∨ ¬Q ∨ R) ∧ (¬P ∨ ¬Q ∨ ¬R) Hence the PDNF of S is
¬(PCNF of ¬S) : (¬P ∧ ¬Q ∧ R) ∨ (¬P ∧ Q ∧ ¬R) ∨ (¬P ∧ Q ∧ R) ∨ (P ∧ ¬Q ∧ ¬R)
∨ ( P ∧ ¬Q ∧ R) ∨ (P ∧ Q ∧ ¬R) ∨ (P ∧ Q ∧ R)
Rules of Inference

1
INFERENCE THEORY

In inference theory we check the validity of the arguments. There are two
branches in it.
1. Inference theory for propositional calculus and
2. Inference theory for predicate calculus.

In the inference theory for propositional calculus the arguments are in terms
of propositions (ordinary statements).
But in inference theory for predicate calculus the arguments are in terms of
predicates with quantifiers (which are defined later).

In this section we deal with the inference theory for propositional calculus.
Theory of Inference

Definition: The main aim of logic is to provide rules of inference to infer a conclusion from
certain premises. The theory associated with rules of inference is known as inference theory.

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 a valid argument or conclusion is called a valid conclusion.

Note: Premises means set of assumptions, axioms, hypothesis.


Definition: Let A and B be two statement formulas. We say that ‘B logically follows from A’
or ‘B is a valid conclusion (consequence) of the premise A’ iff A → B is a tautology,
that is A ⇒ B.

M. RAMA 3
We say that from a set of premises {H1, H2, · · · , Hn}, a conclusion C
follows logically iff
H1 ∧ H2 ∧ ... ∧ Hn ⇒ C

Note: To determine whether the conclusion logically follows from the


given premises, we use the following methods:

• Truth table method


• Without constructing truth table method.
Rules of Inference
Inference (Argument): From a set of premises (called Hypotheses) {H1,
H2, …., Hn } a conclusion C follows logically
if H1  H2  ….  Hn  C.

Here, H1, H2, …. Hn called the premises of the argument and C is called a
Conclusion of the argument.

The rules of inference are criteria for determining the validity of an argument.

Any conclusion which is arrived at by following these rules is called a valid


conclusion, and the argument is called a valid argument.

Def: There exist rules of logic which can be employed for establishing the
validity of arguments. These rules are called the Rules of Inference.
M. RAMA 5
We write the above argument in the following tabular form
H1
H2,
.
.
Hn

C
Valid Argument:
An argument with premises P1, P2, P3 … Pn & conclusion Q is said to
valid if whenever each of premises is true, then the conclusion Q is
true. In other words
(P1  P2  P3…..  Pn )  Q is called an argument.
When
(P1  P2  P3…..  Pn )  Q
Note: the conclusion is true only in the case of valid argument.
RULES OF INFERENCES:

In addition to the rules of algebra of proposition we use another set of


rules called the rules of inference

A proposition P(p,q…) is said to logically imply a proposition


Q(p,q…) written as

P ( p, q.....)  Q ( p, ….)

if Q ( p, q.....) is true whenever P ( p, q….) is true. (i.e.) P  Q is a


tautology.
• The following statements are equivalent.
1.{H1 , H2 , …. , Hn }  C is a logical implication.
2.( H1  H2  ….  Hn) C is a tautology.
3.{H1 , H2 ,…. , Hn }  C is a valid argument.
Consistency Premises:
The premises p1, p2, p3 … pn of an argument are said to be consistent if
their conjunction (p1  p2  p3…..  pn ) is true in at least one possible
situation.
Inconsistency Premises:
The premises p1 ,p2, p3… pn of an argument are said to be inconsistent
if their conjunction (p2  p2  ….  pn) is false in every possible
situation.
Consistency Premises
Example : The premises (p v q) and (¬p) in the argument
pvq
¬p
r are consistent, because (p v q) (¬p) is true when p is false
and q is true.
p q pvq p (p v q)  (p)
F F F T F
F T T T T
T F T F F
T T T F F
Inconsistency Premises
Example: The premises p and (¬p  q) in the argument
p
¬p  q
r are inconsistent, because p  (¬p  q) is false in every
possible situation.
p q p (p  q) (p)  (p  q)
F F T F F
F T T T F
T F F F F
T T F F F
Implication Rules
I1 : P ∧ Q ⇒ P (simplification)
I2 : P ∧ Q ⇒ Q

I3 : P ⇒ P ∨ Q (addition)
I4 : Q ⇒ P ∨ Q

I5 : ¬P ⇒ P → Q
I6 : Q ⇒ P → Q

I7 : ¬(P → Q) ⇒ P
I8: ¬(P → Q) ⇒ ¬Q
Implication Rules

I9 : P, Q ⇒ P ∧ Q

I10 : ¬P, P ∨ Q ⇒ Q (disjunctive syllogism)

I11 : P, P → Q ⇒ Q (modus ponens)


I12 : ¬Q, P → Q ⇒ ¬P (modus tollens)

I13 : P → Q, Q → R ⇒ P → R (hypothetical syllogism)

I14 : P ∨ Q, P → R, Q → R ⇒ R (dilemma)
Rules of Inference (Logical Implications)
Simplification rules(Conjunctive Simplification):

I1 : (P  Q)  P
(P  Q)  P is a tautology.
P logically follows from (P  Q)

I2 : (P  Q)  Q
(P  Q)  Q is a tautology.
Q logically follows from (P  Q)

M. RAMA 15
Rules of Inference (contd.,)
Addition rules(Disjunctive Amplification):

I3 : P (P  Q)
P  (P  Q) is a tautology
(P  Q) logically follows from P

I4 : Q  ( P  Q )
Q  (P  Q) is a tautology
(P  Q) logically follows from Q

M. RAMA 16
Rules of Inference (contd.,)
I5 : P (P  Q)
P (P  Q) is a tautology
(P  Q) logically follows from P

I6 : Q (P  Q)
Q (P  Q) is a tautology
(P  Q) logically follows from Q

M. RAMA 17
Rules of Inference (contd.,)

I7 : (P  Q)  P
(P  Q)  P is a tautology
P follows from (P  Q)

I8 : (P  Q )  (Q)
(P  Q )  (Q) is a tautology
Q logically follows from (P  Q)

M. RAMA 18
Rules of Inference (contd.,)

I10 : Disjunctive syllogism


{ P, P  Q}  Q
{ P  ( P  Q)}  Q is a tautology.

The inference
P Q
P

 Q is valid
Modus ponens (Rule of detachment)
I11 : {P, PQ}  Q
{ P  (PQ) }  Q is a Tautology
The argument
P
P Q
 Q is valid

Ex: The following argument is valid.


A) Today is Sunday
B) If today is a Sunday then today is a Holiday
C: Hence, Today is Holiday

M. RAMA 20
Modus Tollens
I12 :{ PQ, Q }  P
{ (PQ)  Q}  (P) is a Tautology
The argument
PQ
Q

 P is valid

Ex: The following argument is valid.

A) If today is a Sunday, then today is a Holiday


B) Today is not Holiday
C: Hence, Today is not Sunday

M. RAMA 21
Rule of Transitivity (Hypothetical Syllogism)
I13 :{ PQ, QR }  (PR)
{ (PQ)  (QR}  (PR) is a Tautology
The argument
PQ
QR

 PR is valid

Ex: The following argument is valid.


A) If I Study well, then I will get distinction.
B) If I get distinction, then I will get a Good Job.
C:  If I Study well, then I will get a good job

M. RAMA 22
Dilemma
I14 :{ P  Q, PR, QR }  R is a logical implication.

{(PQ)  (PR}  (QR) }  R is a Tautology

The Inference

P Q
PR
QR

 R is a valid Inference.

M. RAMA 23
Equivalence Rules
E1 : ¬(¬P) ⇔ P (Double negation)

E2 : P ∧ Q ⇔ Q ∧ P (Commutative Law)
E3 : P V Q ⇔ Q V P

E4 : (P ∧ Q) ∧ R⇔ P ∧ (Q ∧ R) (Associative Law)
E5 : (P V Q) V R⇔ P V (Q V R)

E6 : P ∧ (Q V R) ⇔ (P ∧ Q) V (P ∧ R) ( Distributive Law)
E7 : P V (Q ∧ R) ⇔ (P V Q) ∧ (P V R)
Equivalence Rules
E8 : ¬(P ∧ Q) ⇔ ¬ P V ¬ Q (Dmorgan’s Law)
E9 : ¬(P V Q) ⇔ ¬ P ∧ ¬ Q

E10 : P V P ⇔ P
E11: P ∧ P ⇔ P (Idempotent Law)

E12 : R V (P ∧ ¬P) ⇔ R
E13: R ∧ (P V ¬P) ⇔ R

E14 : R V(P V ¬P) ⇔T


E15: R ∧ (P ∧ ¬P) ⇔ F
Equivalence Rules

E16 : P →Q ⇔ ¬P V Q
E17 : ¬(P →Q) ⇔ P ∧¬Q
E18 : P →Q ⇔ ¬Q → ¬P (Contra positive)
E19 : P →(Q → R)⇔ (P ∧ Q) →R
E20 : ¬(P ↔ Q) ⇔ P ↔ ¬Q
E21 : P ↔ Q ⇔ (P →Q) ∧(Q →P)
E22: (P ↔ Q) ⇔ (P ∧ Q) V(¬P ∧¬Q )
Test whether the following is a valid argument:
1. If Sachin hits a century, then he gets a free car.
Sachin hits a century
 Sachin gets a free car
Let
p: Sachin hits a century
q: Sachin gets a free car
Then, the given argument reads
pq
p [(p  q) ∧ p]  q =T
q
In view of Modus Ponens Rule, this is a valid argument
Test whether the following is a valid argument:
2. If Sachin hits a century, then he gets a free car.
Sachin does not get a free car
 Sachin has not hit a century
Let
p: Sachin hits a century
q: Sachin gets a free car
Then, the given argument reads
pq
¬q
¬p
In view of Modus Tollens Rule, this is a valid argument
3. If Sachin hits a century, then he gets a free car.
Sachin gets a free car
 Sachin has hit a century
Let p: Sachin hits a century q: Sachin gets a free car
Then, the given argument reads
pq
q
[( p  q )  q]  p not valid
p [( p  q )  q]  p is not a tautology.
We note that if p  q & q are true, there is no rule which asserts that p must be true. Indeed, p can
be false when p  q and q are true.

p q pq (pq)q
0 1 1 1

Thus, [( p  q )  q]  p is not a tautology. Therefore, the given argument is not valid


1  0 = 0 (not a tautology)
Test whether the following is a valid argument:
4. I will become famous or I will not become a musician
I will become a musician
 I will become famous
Let
p: I will become famous
q: I will become a musician
Then, the given argument reads
p v ¬q q  p (p v ¬q ⇔ ¬q v p ⇔ q  p)
q q
p
p
In view of Modus Ponens Rule I11 : {P, PQ}  Q, this argument is valid
Test whether the following is a valid argument:
5. If I study, then I do not fail in the examination
If I do not fail in the examination, my father gifts a two wheeler to me.
 If I study then my father gifts a two wheeler to me.
Let
p: I study q: I do not fail in the examination
r: my father gifts a two wheeler to me
Then, the given argument reads
pq
qr
pr

In view of Rule of Syllogism, this argument is valid


6. I will get grade A in this course or I will not graduate.
If I do not graduate, I will join the army.
I got grade A.
 I will not join the army.
Let p: I will get grade A in this course q: I do not graduate
r: I join the army
Then, the given argument reads
This argument is logically equivalent to
p vq ¬q  p (p v q ⇔ q v p ⇔ ¬q  p)
qr ¬r  ¬q ( Contra positive)
p p
 ¬r  ¬r
This is logically equivalent to
¬ r  p ( using Rule of Syllogism)
p
 ¬r This is not a valid argument.(using ex-3)
Test whether the following is a valid argument:
1. If a person is poor, he is unhappy.
If a person is unhappy, he dies young.
 Poor persons die young.

2. If there is a strike by students, the examination will be postponed.


There was no strike by students.
 The examination was not postponed.

3. If there is strike by students, the examination will be postponed.


The examination was not postponed.
 There was no strike by students.
4. If I drive to work, then I will arrive tired.
I do not drive to work
 I will not arrive tired.

5. If I have talent and work hard, then I will become successful in life.
If I become successful in life then I will be happy.
 If I will be happy, then I did not work hard or I do not have talent.

6. If Ravi studies, then he will pass in Discrete Mathematics paper.


If Ravi does not play cricket, then he will study.
Ravi failed in Discrete Mathematics paper.
 Ravi played cricket.
METHODS TO CHECK THE VALIDITY OF ARGUMENTS:

As we have done in the examples of valid argument and fallacy,


The validity of an argument can be found out using truth tables.
 In such a case we first identify the premises and the conclusion
and find the truth values of premises and conclusion in a truth
table.
We identify the rows where all the premises are true and check
whether the conclusion is true there. If the conclusion is also true
in all such rows then the argument is valid otherwise it is not
valid.
Example: p, p → q ⇒ q
P q p →q. p∧(p→q) q (p∧p →q) →q
Here the premises are p and
0 0 1 0 0 1
p →q. Both the premises are true
0 1 1 0 1 1
only in the last row. So we check
for validity only in the last row 1 0 0 0 0 1
where all the premises are true. 1 1 1 1 1 1
In that row the conclusion q is
true. Therefore the conclusion is Note:
true when all the premises are i) p→ q is a tautology
ii) p ⇒ q guarantees that q has a truth value T
true and hence it is a valid
whenever p has the truth value T .
argument.
NOTE:
As the truth table consists of 2n rows for an argument with n
variables, the construction of the truth table with a big value of n (i.e)
with many variables is difficult and time consuming. Hence we use
other methods to check the validity of arguments.
The following methods are used to check the validity of the arguments.

1)Direct Proof
2)Indirect Proof
Example: Prove that ( p  q)  ( p  q)
We have to prove that ( p  q ) logically implies ( p  q) .

(i.e.) we have to prove that ( p  q)  ( p  q)  T


(p  q)  ( p  q)
 ( p  q)  (p  q ) Conditional equivalence(p  q  p  q)
 ( p  q)  (p  q )
 (p  q)  (p  q) ( Demorgans law )
 p  (q  q) ( Distributive law )
 p  T ( inverse law )
 T ( Domination law)
Hence proved.
EX-1: Test the validity of the following arguments:
1. p  q
p  (q  r)
r
(or)
(p  q) (p  (q  r))  r

Solution: Since p  q is true, both p and q are true. Since p is true and p  (q 
r) is true, q  r has to be true. Since q is true and q  r is true, r has to be
true. Hence the given argument is valid.
p q r pq q  r p  (q  r) (p  q)  (p  (q  r))
1 1 1 1 1 1 1
EX-2: Test the validity of the following arguments:
2. p  r
qr
 (p v q)  r
Solution:
We note that
(p  r)  (q  r) ⇔ (¬p v r)  (¬ q v r)
⇔ (r v ¬p)  (r v ¬q), by commutative law
⇔ r v (¬p  ¬q), by distributive Law
⇔ ¬(p v q ) v r, by commutative and DeMorgan laws
⇔ (p v q )  r [p  q ⇔ ¬p v q ]
Ex-3: Prove the validity of the following arguments:
(¬p v ¬q) (r  s)
rt
¬t
p
Solution:
[(¬p v ¬q) (r  s)]  (r  t)  (¬t)
 [(¬p v ¬q) (r  s)]  ¬r by Modus Tollens Rule [ ¬Q, P → Q ⇒ ¬P ]
 [(¬p v ¬q) (r  s)]  (¬r v ¬s) by the rule of disjunctive amplification(p  p v q)
[(¬p v ¬q) (r  s)]  [¬(r  s)] by DeMorgan Law
⇔ ¬(¬p v ¬q) by the Modus Tollens Rule { [(P → Q)  ¬Q ] ⇒ ¬P }
pq by DeMorgan Law
p [ P∧Q ⇒P (simplification) ]
The following are two important rules of inferences.

Rule P: A premise may be introduced at any point in the derivation.

Rule T: A formula S may be introduced in a derivation if S is tautologically


implied by one or more of the preceding formulas in the derivation.
Example-1: Demonstrate that R is a valid inference from the premises
P → Q, Q → R, and P .
Solution:

{1} (1) P → Q Rule P


{2} (2) P Rule P,
{1, 2} (3) Q Rule T, (1), (2), and I11 (Modus Ponens)
{4} (4) Q → R Rule P
{1, 2, 4} (5) R Rule T, (3), (4), and I11 (Modus Ponens)
Hence the result.
OR
Ex: Show that R follows logically from the premises PQ, QR, P
Proof: Consider the premises,

PQ -----(1)
QR -----(2)
P ------(3)
From (1) and (2), By the rule of transitivity,we have
PR --------(4)
From (3) and (4), By the rule of Modus ponens, R follows.
 R logically follows from the given premises

M. RAMA 44
Example-2 : Show that R∨S follows logically from the premises
C ∨D, (C ∨D) → ¬H, ¬H → (A ∧ ¬B), and (A ∧ ¬B) → (R ∨ S).
Solution:
{1} (1) (C ∨ D) → ¬H Rule P
{2} (2) ¬H → (A ∧ ¬B) Rule P
{1, 2} (3) (C ∨ D) → (A ∧ ¬B) Rule T, (1), (2), and I13
{4} (4) (A ∧ ¬B) → (R ∨ S) Rule P
{1, 2, 4} (5) (C ∨ D) → (R ∨ S) Rule T, (3), (4), and I13
{6} (6) C ∨ D Rule P
{1, 2, 4, 6} (7) R ∨ S Rule T, (5), (6), and I11 [P, P → Q  Q ]
Hence the result.
Example-3: Show that S ∨R is tautologically implied by (P ∨ Q) ∧ (P → R) ∧ (Q → S).
Solution:
{1} (1) P∨Q Rule P
{1} (2) ¬P → Q Rule T, (1) P → Q ⇔ ¬P ∨ Q
{3} (3) Q→S Rule P
{1, 3} (4) ¬P → S Rule T, (2), (3), and (I13 : Hypothetical Syllogism)
{1, 3} (5) ¬S → P Rule T, (4), P → Q ⇔ ¬Q → ¬P (contra positive)
{6} (6) P→R Rule P
{1, 3, 6} (7) ¬S → R Rule T, (5), (6), and I13
{1, 3, 6} (8) S∨R Rule T, (7) and P → Q ⇔ ¬P ∨ Q
Hence the result.
OR
Example: Show that S ∨R is tautologically implied by (P ∨ Q) ∧ (P → R) ∧ (Q → S).
Solution:
(P ∨ Q) ∧ (P → R) ∧ (Q → S)
⇔ (¬P → Q) ∧ (Q → S) ∧ (P → R)
 (¬P → S) ∧ (P → R)
⇔ (¬R → ¬P) ∧ (¬P → S) (P → Q ⇔ ¬Q → ¬P)
 ¬R → S
⇔ ¬(¬R) ∨ S
⇔R∨S (P → Q ⇔ ¬P ∨ Q)
⇔S∨R
This proves the required result.
Exercises:
1. Prove that the following arguments are valid
i) p  q
iii) (¬ p v q) → r
ii) p → (q → r)
r → (s v t)
¬p pvs
¬s ∧ ¬u
 ¬p t→q
¬u → ¬t
¬s
p
 ¬ r → ¬t

2. Prove that the following arguments are not valid


i) p ∧ ¬q ii) p
p → (q → r) p→ r
¬r p → (q v r)
¬q v ¬s
s

3. Check whether ¬( p ∧ q) follows from (¬p) ∧ (¬q).


4. Prove that the premises p → r, q → r (p v q) → r are consistent.
5. Prove that the premises p v q, (p v q) → r, ¬ r are inconsistent.
Rules of Conditional Proof( Rule CP) or Deduction Theorem

We shall now introduce a third inference rule, known as CP or rule of conditional proof.
Rule CP: If we can derive S from R and a set of premises, then we can derive R → S from
the set of premises alone.
Rule CP is not new for our purpose here because it follows from the equivalence

(P ∧ R) → S ⇔ P → (R → S)

Let P denote the conjunction of the set of premises and let R be any formula. The above
equivalence states that if R is included as an additional premise and S is derived from P ∧ R,
then R → S can be derived from the premises P alone.
Rule CP is also called the deduction theorem and is generally used if the conclusion of the
form R → S. In such cases, R is taken as an additional premise and S is derived from the
given premises and R.
Example: Show that R → S can be derived from the premises P → (Q → S), ¬R ∨ P , and
Q. (Nov. 2011)
Solution: Instead of deriving R → S, we shall include R as an additional premise and
show S
{1} (1) ¬R ∨ P Rule P
{2} (2) R Rule P (assumed premise)
{1, 2} (3) P Rule T, (1), (2), and I10 :¬P, P ∨ Q ⇒ Q
(disjunctive syllogism)
{4} (4) P → (Q → S) Rule P
{1, 2, 4} (5) Q→S Rule T, (3), (4), and I11 (Modus ponens)
{6} (6) Q Rule P
{1, 2, 4, 6} (7) S Rule T, (5), (6), and I11 (Modus ponens)
{1, 2, 4, 6} (8) R→S Rule CP
Example-2: Show that P → S can be derived from the premises ¬P ∨ Q, ¬Q ∨ R, and R → S.
Solution: We include P as an additional premise and derive S.

{1} (1) ¬P ∨ Q Rule P


{2} (2) P Rule P (assumed premise)
{1, 2} (3) Q Rule T, (1), (2), and I10 [ ¬P, P ∨ Q ⇒ Q D.S ]
{4} (4) ¬Q ∨ R Rule P
{1, 2, 4} (5) R Rule T, (3), (4), and I10
{6} (6) R→S Rule P
{1, 2, 4, 6} (7) S Rule T, (5), (6), and I11
{1, 2, 4, 6} (8) P→S Rule CP
Example: If there was a ball game, then traveling was difficult. If they arrived on time,
then traveling was not difficult. They arrived on time. Therefore, there was no ball
game. Show that these statements constitute a valid argument.
Solution: Let us indicate the statements as follows:
P : There was a ball game. Q: Traveling was difficult. R: They arrived on time.
Hence, the given premises are P → Q, R → ¬Q, and R. The conclusion is ¬P .
{1} (1) R → ¬Q Rule P
{2} (2) R Rule P
{1, 2} (3) ¬Q Rule T, (1), (2), and I11
{4} (4) P→Q Rule P
{4} (5) ¬Q → ¬P Rule T, (4), and P → Q ⇔ ¬Q → ¬P (Contrapositive)
{1, 2, 4} (6) ¬P Rule T, (3), (5), and I11
Ex: Show that P follows logically from the premises
PQ, QR, R
Proof: Consider the premises,
PQ -----(1)
QR -----(2)
R ------(3)
From (1) and (2), By the rule of transitivity,we have
PR --------(4)
From (3) and (4), By the rule of Modus tollens,
P follows.
 P logically follows from the given premises
M. RAMA 53
Example: Determine the validity of the following arguments using propositional logic:
Smoking is healthy. If smoking is healthy, then cigarettes are prescribed by physicians.
Therefore, cigarettes are prescribed by physicians. (May-2012)
Solution: Let us indicate the statements as follows:
P : Smoking is healthy.
Q: Cigarettes are prescribed by physicians.
Hence, the given premises are P , P → Q. The conclusion is Q.

{1} (1) P → Q Rule P


{2} (2) P Rule P
{1, 2} (3) Q Rule T, (1), (2), and I11
Hence, the given statements constitute a valid argument.
Consistency of premises
Consistency
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 be atomic appearing in H1, H2, …, Hm.

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

A set of formulas H1, H2, …, Hm is inconsistent, if their conjunction implies


a contradiction, that is H1∧ H2∧ … ∧ Hm => R ∧ ¬R [(T ∧ F)=F]

Where R is any formula. Note that R∧¬R is a contradiction and it is


necessary and sufficient that H1, H2, …,Hm are inconsistent the formula.
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.

The premises are E → S, S → H, A → ¬H, and E ∧ A.


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

Thus, the given set of premises leads to a contradiction and hence it is inconsistent.
F ∧ T =F
Example: 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.
V → L, L → B, M → ¬B, V ∧ M
V → L, L → B, M → ¬B, V∧ M

{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) B → ¬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
Indirect method of proof or Proof of Contradiction:
In order to show that a conclusion C follows logically from the premises H1, H2,…, Hm, we
assume that C is false and consider ¬C as an additional premise. If the new set of premises
is inconsistent, so that they imply a contradiction, then the assumption that ¬C is true does
not hold simultaneously with
H1∧H2∧ ..… ∧ Hm being true. Therefore, C is true whenever H1∧H2∧..… ∧ Hm is true.
Thus, C follows logically from the premises H1, H2 ….., Hm.
NOTE: The notation of inconsistency is used in a procedure called “Proof of Contradiction or
Indirect method of proof”.
•Show that a  b, b  c)  a .
Solution:

Step Proposition Justification


1. a Negated conclusion (assumed) a  a
2. ab Rule P
3. b Rule T, (1) & (2) & modus ponens
4. bc Rule T, (3) & disjunctive addition
5. b  c) Rule P
6. b  c)  b  c) (4) & (5) Contradiction

By assuming the negated conclusion we get a contradiction. Hence the given premises
imply the conclusion & the argument is valid.
Show that ¬ ¬(P ∧ Q) follows from ¬P ∧ ¬Q.
Solution.
We introduce (P∧ Q) as an additional premise and show that this additional premise
leads to a contradiction.
{1} (1) ¬ ¬ (P∧ Q) Rule P (assumed premise)
{1} (2) P∧ Q Rule T, (1) and E1
{1} (3) P Rule T, (2) and I1: (P∧ Q)=>P

{1} (4) ¬P∧¬Q Rule P


{4} (5) ¬P Rule T, (4) and I1: (P∧ Q)=>P
{1, 4} (6) P ∧¬P Rule T, (3), (5) and I9 : P, Q =>P∧Q

Here (6) P∧¬P is a contradiction. Thus {1, 4} viz. ¬¬(P∧ Q) and ¬P∧¬Q leads to a
contradiction P ∧ ¬P.
•Prove by the method of indirect proof that p  q, q  r, r  p .
Solution:

Step Proposition Justification


1. p Negated conclusion (assume)
2. p  q Rule P
3. p  q)  q  p) Rule T , (2) and biconditional equivalence

4. p  q Rule T, (3) & simplification


5. qr Rule P
6. p  r Rule T, (4), (5) & chain rule.
7. r Rule T, (6), (1) and modus ponens
8. r Rule P
9. r  r (7) & (8) contradiction

Hence by the method of indirect proof the given argument is valid.


Example: Using the indirect method of proof, show that P → Q, Q → R, ¬(P ∧ R), P ∨ R ⇒ R.

Solution: We include ¬R as an additional premise.


Then we show that this leads to a contradiction.

{1} (1) P → Q Rule P


{2} (2) Q → R Rule P
{1, 2} (3) P → R Rule T, (1), (2), and I13
{4} (4) ¬R Rule P (assumed)
{1, 2, 4} (5) ¬P Rule T, (4), and I12

{6} (6) P ∨ R Rule P


{1, 2, 4, 6} (7) R Rule T, (5), (6) and I10
{1, 2, 4, 6} (8) R ∧ ¬R Rule T, (4), (7), and I9
Example: Show that the following set of premises are inconsistent, using proof by contradiction
P → (Q ∨ R), Q → ¬P, S → ¬R, P ⇒ P → ¬S.
Solution: We include ¬(P → ¬S) as an additional premise. Then we show that this leads to a contradiction.
∴ ¬(P → ¬S) ⇔ ¬(¬P ∨ ¬S) ⇔ P ∧ S.
Hence, it is proved that the given premises are inconsistent.
{1} (1) P → (Q ∨ R) Rule P

{2} (2) P Rule P


{1, 2} (3) Q ∨ R Rule T, (1), (2), and Modus Ponens
{4} (4) P ∧ S Rule P (assumed)
{1, 2, 4} (5) S Rule T, (4), and P ∧ Q ⇒ P
{6} (6) S → ¬R Rule P
{1, 2, 4, 6} (7) ¬R Rule T, (5), (6) and Modus Ponens
{1, 2, 4, 6} (8) Q Rule T, (3), (7), and P ∧ Q, ¬Q ⇒ P
{9} (9) Q → ¬P Rule P
{1, 2, 4, 6} (10) ¬P Rule T, (8), (9), and P ∧ Q, ¬Q ⇒ P
{1, 2, 4, 6} (11) P ∧ ¬P Rule T, (2), (10), and P, Q ⇒ P ∧ Q
{1, 2, 4, 6} (12) F Rule T, (11), and P ∧ ¬P ⇔ F
The Predicate Calculus
The declarative sentences such as
i) x+3=6
ii) x divides 4
The above sentences are not propositions unless the symbol x is specified. This kind
of sentences are called Open statements or open sentences & the unspecified symbols,
such as x in the above sentences are called free variables.
Consider the sentence (i) above, and the set of real numbers R. This sentence becomes
a proposition if x is replaced by any element of R.
Ex: if x is replaced by 3, the sentence becomes a true proposition.
if x is replaced by 5, the sentence becomes a false proposition.
Here R is a universe(universe discourse) for the variable x in the sentence (i).
Open statements containing a variable are denoted by p(x) & q(x).
The Predicate Calculus
A part of a declarative sentence describing the properties of an object is called a
predicate.
The logic based upon the analysis of predicate in any statement is called predicate
logic.

Consider two statements:


John is a bachelor
Smith is a bachelor.

In each statement ’is a bachelor’ is a predicate. Both John and Smith have the same
property of being a bachelor.

In the statement logic, we require two different symbols to express them and these
symbols do not reveal the common property of these statements.
 In predicate calculus these statements can be replaced by a single statement ‘x is a
bachelor’.
 A predicate is symbolized by a capital letters which is followed by the list of variables.
 The list of variables is enclosed in parenthesis.
 If P stands for the predicate ‘is a bachelor’, then P (x) stands for ‘x is a bachelor’,
where x is a predicate variable.

`The domain for P (x) : x is a bachelor, can be taken as the set of all human names.

Note that P (x) is not a statement, but just an expression.

Once a value is assigned to x, P (x) becomes a statement and has the truth value.

If x is Ram, then P (x) is a statement and its truth value is true.


EX 2: Consider the following sentences.

Ramesh is a student of II CSE.


Siri is a student of II CSE
Latha is a student of II CSE.
Prem is a student of II CSE.

All these sentences are about the students of II CSE and it is the predicate.
If P – denotes a student of II CSE

P(x): x is a student of II CSE.


r – Ramesh, s – Siri, l – Latha and p – Prem then the above sentences can be symbolized
as P(r), P(s), P(l), P(p) respectively.

Since only one variable is required to use this predicate it is called as 1 – place predicate.
2 - PLACE PREDICATE:

Consider the following sentences


Tina is taller than Ramya.
Vasan is cleverer than Roshan.

In the above two sentences we require two variables (names) to define the predicates.
hence they are 2-place predicates.
If T denotes : is taller than (predicate)
x : Tina and y : Ramya (Variables)
The first sentence can be denoted as T(x,y).

If C denotes : is cleverer than (predicate)


x : Vasan and y : Roshan (Variables)
The second sentence can be denoted as C(x,y).
3-PLACE PREDICATES:

If three variables are required to use a predicate then it is called 3 place


predicate.
Example:
5 is in between 4 and 6 in the set of whole numbers.
Here 4,5,6 are variables.
……..in between …. and ……. is the predicate.

n-PLACE PREDICATES:
Similarly it can be extended for n variables and in such a case it is called as
n-place predicates.
Quantifiers
Consider the following propositions:
1) All squares are rectangles
2) For every integer x, x2 is a non negative integer
3) Some determinants are equal to zero
4) There exists a real number whose square is equal to itself

In these propositions the words all, every, some, there exists are associated with the
idea of quantity. Such words are called quantifiers.

Quantifiers: Quantifiers are words that are refer to quantities such as ‘some‘ or ‘all‘.

There are two different quantifiers


1) Universal quantifier
2) Existential quantifier
Universal Quantifier
Def-1: The phrase ‘for all‘ (denoted by ∀) is called the universal quantifier.

Def-2: Let px) be a propositional function. “For every x ” or “for all x ”


is called the universal quantifier and is denoted by "x or  x) .

"x p  x ) means that the proposition is true for all x .

"x  A) p  x ) means that the proposition is true for all x in the set A.

The set of values for which the statement is true is called truth set.
1) For example, consider the sentence “All human beings are mortal”.
Let P (x) denote ‘x is a mortal‘.
Then, the above sentence can be written as (∀x ∈ S) P(x) or ∀x P(x)
where S denote the set of all human beings.
∀x represents each of the following phrases, since they have essentially the same for all x.
For every x.
For each x.
For any x.

2. Let A = {7, 8, 9, 10}


Consider ("x  A)(x + 5 > 9)
Since P(x): x + 5 > 9
x>9–5
x>4
Here x  A and A = {7, 8, 9, 10} and all the values in this set are greater than 4 and satisfy
the relation x + 5 > 9. Hence for every value x in the set the given statement is true.
Existential Quantifier
Definition 1: The phrase ‘there exists‘ (denoted by ∃) is called the existential quantifier.
Definition 2: Let p(x) be a propositional function. “There exists an x” or “There exists some x” is
called as the existential quantifier and is denoted by $x .
$x p(x) means that the proposition is true for some x.
($x  A) p(x) means that there exists some x  A such that the proposition p(x) is true.

For example, consider the sentence


There exists x such that x2 = 9.
This sentence can be written as
(∃x ∈ R)P (x) or (∃x)P (x), where P (x) : x2 = 9.
∃x represents each of the following phrases
There exists an x, There is an x
For some x, There is at least one x.
Ex 1: 1) Some students are intelligent.
Let S(x): x is a student.
L(x): x is intelligent.
($x) S (x)  L (x)) is the symbolic representation of the given statement.

Ex 2) Let A = {5, 6, 7,8, 9,10}


Consider ($x  A)(5x < 10)
Here 5x < 10  x < 2
But the set A has values which are greater than 2. There are no elements
in the set A that will satisfy this relation. Hence the statement is false and
the truth set = f (null set).
Example: Write the following statements in symbolic form:
(i). Something is good
(ii). Everything is good
(iii). Nothing is good
(iv). Something is not good.
Solution: Statement (i) means ‘There is at least one x such that, x is good’.
Statement (ii) means ‘For all x, x is good’.
Statement (iii) means, ‘For all x, x is not good’.
Statement (iv) means, ‘There is at least one x such that, x is not good’.
Thus, if G(x) : x is good, then
statement (i) can be denoted by (∃x)G(x)
statement (ii) can be denoted by (∀x)G(x)
statement (iii) can be denoted by (∀x)¬G(x)
statement (iv) can be denoted by (∃x)¬G(x).
Example: Let K(x) : x is a man
L(x) : x is mortal
M(x) : x is an integer
N(x) : x either positive or negative
Express the following using quantifiers:
(a)All men are mortal
(b)Any integer is either positive or negative.
Solution: (a) The given statement can be written as
for all x, if x is a man, then x is mortal and this can be expressed as
(x)(K(x) → L(x)).
b) The given statement can be written as
for all x, if x is an integer, then x is either positive or negative and this can be
expressed as (x)(M(x) → N(x)).
Exercises:
P(x): x>0
Q(x): x is even
R(x): x is perfect square
S(x): x is divisible by 3
T(x): x is divisible by 7
Write down the following quantified statements in symbolic form
i. At least one integer is even ∃x, Q(x)
ii. There exists a positive integer that is even ∃x, [P(x) ∧ Q(x)]
iii. Some even integers are divisible by 3 ∃x, [Q(x) ∧ S(x)]
iv. Every integer is either even or odd ∀x [Q(x) V ¬ Q(x)]
v. If x is even and perfect square, then x is not divisible by 3 ∀x [{Q(x) ∧ R(x)} →¬S(x)]
vi. If x is odd or is not divisible by 7, then x is divisible by 3. ∀x, [ {¬ Q(x) V ¬ T(x)} → S(x)]
BOUND AND FREE VARIABLES

A proposition involving the universal or the existential quantifier is called a


Quantified statement.
The variable present in a quantified statement is called a bound variable.- it is
bound by a quantifier.
Given a formula containing a part of the form (x)P (x) or (∃x)P (x), such a part
is called an x-bound part of the formula.
Any occurrence of x in an x-bound part of the formula is called a bound
occurrence of x.
while any occurrence of x or of any variable that is not a bound occurrence is
called a free occurrence.
The smallest formula immediately following (∀x) or (∃x) is called the scope of
the quantifier.
BOUND AND FREE VARIABLES

Consider (x)A(x) and ( $y )B(y).

Here (x)A(x) is called x-bound part of the formula and

( $y )B(y) is called an y-bound part of the formula.

In the first case x is called bound variable and in the second case y is called as the
bound variable.
Consider (x) P(x, y). Here x is a bound variable and y is a free variable.
The scope of the formula is the formula immediately following the quantifier. If
the scope is an atomic formula no parenthesis are used to enclose the formula.
Example: (x)W(x)
If it is not an atomic formula then parenthesis are needed.
1. (x)P (x, y)
2. (x)(P (x) → Q(x))
3. (x)(P (x) → (∃y)R(x, y))
4. (x)(P (x) → R(x)) ∨ (x)(R(x) → Q(x))
5. (∃x)(P (x) ∧ Q(x))

In (1), P (x, y) is the scope of the quantifier, and occurrence of x is bound occurrence, while the
occurrence of y is free occurrence.
In (2), the scope of the universal quantifier is P (x) → Q(x), and all concrescences of x are bound.
In (3), the scope of (x) is P (x) → (∃y)R(x, y), while the scope of (∃y) is R(x, y). All occurrences of
both x and y are bound occurrences.
In (4), the scope of the first quantifier is P (x) → R(x) and the scope of the second is
R(x) → Q(x). All occurrences of x are bound occurrences.
In (5), the scope (∃x) is P (x) ∧ Q(x).
Truth value of a Quantified Statement
The following rules are employed for determining the truth value of a quantified
statement.

Rule -1: The statement “∀x ∈ S, P(x)” is true only when p(x) is true for each x ∈ S.

Rule -2: The statement “∃x ∈ S, P(x)” is false only when p(x) is false for every x ∈ S.
Accordingly, to infer that a proposition of the form “∀x ∈ S, P(x)” is false, it is
enough to exhibit one element a of S such that p(a) is false. This element a is called
counter example.
To infer that a proposition of the form “∃ x ∈ S, P(x)” is true, it is enough to exhibit
one element a of S such that p(a) is true.
Two Rules of Inference

As a consequence of the Rules 1 and 2 indicated above, we obtain the following


Rules of Inference.

Rule 3: If an open statement p(x) is known to be true for all in a universe S and if a∈S,
then p(a) is true.(This is known as the Rule of Universal Specification).

Rule 4:If an open statement p(a) is proved to be true for any x chosen from a set S,
then the quantified statement ∀x ∈ S, P(x)” is true.(This is known as the Rule of
Universal Generalization).
Logical Equivalence
Two quantified statements are used to be logically equivalent whenever they have the
same truth values in all possible situations
i) ∀x,[(P (x) ∧ Q(x)] ⇔(∀x,(P (x)) ∧ (∀x, Q(x))
ii) ∃x,[(P (x) V Q(x)] ⇔ (∃x,(P (x)) V (∃x, Q(x))
iii) ∃x, [(P (x) → Q(x)] ⇔ ∃x, [¬(P (x)) V Q(x)]

In some situations, there arise quantified statements of the form “∀x, ¬P (x)”. Such a
statement is taken to be logically equivalent to the statement “For no x, p(x)”.
Thus ∀x, ¬P (x) ⇔ For no x, p(x).

Ex: The stmt “for every integer x, x2 is non negative” is logically equivalent to the
statement “For no integer x, x2 is negative”.
Negations of Quantified Statements

Rule -5: To construct the negation of a quantified statement, change the quantifier from
universal to existential and vice versa, and also replace the open statement by its negation.

(i). ¬ {"x,P (x)} ⇔ {∃x,{¬P (x)}


(ii). ¬{∃x, P (x)} ⇔ "x, {¬P (x)}.
NOTE:$x is the negation of "x and
"x is the negation of $x .

Example: Let P (x) denote the statement “x is a professional athlete” and let Q(x) denote the
statement “x plays soccer”. The domain is the set of all people.

a) Write each of the following proposition in English.


(x)(P (x) → Q(x)
(∃x)(P (x) ∧ Q(x))
(x)(P (x) ∨ Q(x))
b) Write the negation of each of the above propositions, both in symbols and in words.
Negations of Quantified Statements
P(x): x is a professional athlete
Q(x) :x plays soccer.
The domain is the set of all people.
a) Write each of the following proposition in English.
(x)(P (x) → Q(x)
(∃x)(P (x) ∧ Q(x))
(x)(P (x) ∨ Q(x))
(i). For all x, if x is an professional athlete then x plays soccer.“All professional athletes
plays soccer” or “Every professional athlete plays soccer”.

(ii). There exists an x such that x is a professional athlete and x plays soccer.
“Some professional athletes plays soccer”.

(iii). For all x, x is a professional athlete or x plays soccer.


“Every person is either professional athlete or plays soccer”.
b. (i). In symbol: We know that
¬"(x)(P (x) → Q(x)) ⇔ (∃x)¬(P (x) → Q(x)) ⇔ (∃x)¬(¬(P (x)) ∨ Q(x))
⇔ (∃x)(P (x) ∧ ¬Q(x))
There exists an x such that, x is a professional athlete and x does not play
soccer.
In words: “Some professional athlete do not play soccer”.

(ii). ¬(∃x)(P (x) ∧ Q(x)) ⇔ (x)(¬P (x) ∨ ¬Q(x))


In words: Every people is neither a professional athlete nor plays soccer or All
people either not a professional athlete or do not play soccer.

(iii). ¬(x)(P (x) ∨ Q(x)) ⇔ (∃x)(¬P (x) ∧ ¬Q(x)).


In words: Some people are not professional athlete and do not play soccer.
Let p(x) be the open statement x2=2x & q(x) be the open statement x3=4x with the
set of all integers as the universe.
Write down the truth values of the following quantified statements.
i) ∀x, p(x) F
ii) ∃x, q (x) T
iii) ∀x, ¬p(x) F
iv) ∃x, ¬q (x) T
v) ∀x, p(x) ∧ q (x) F
vi) ∃x, p(x) ∧ q (x) T
vii) ∀x, p(x) v q (x) F
viii)∃x, p(x) v q (x) T
Write down the following propositions in symbolic form and find its negation:
Ex-1: “All integers are rational numbers and some rational numbers are not integers”
Let,
p(x): x is a rational number q(x): x is an integer
And
Z: set of all integers R: set of all rational numbers
Symbolic form: {∀x ∈ Z, p(x)} ∧ {∃x ∈ R, ¬q(x)}
Negation is: {∃x ∈ Z, ¬p(x)} ∧ {∀x ∈ R, q(x)}
(Some integers are not rational numbers or every rational number is an integer)
Ex-2: If all triangles are right angled, then no triangle is equiangular
Symbolic form: {∀x ∈ T, p(x)} → {∀ x ∈ T, ¬q(x)}
Negation is: {∀x ∈ T, p(x)} ∧ {∃ x ∈ T, q(x)}
all triangles are right angled and some triangles are equiangular
Write down the converse, inverse and contra positive of each of the following
statements and indicate truth value
i) ∀x , [(x>3)→ (x2>9)]
Converse: ∀x , [(x2>9) →(x>3)], False
Inverse: ∀x , [(x<=3) → (x2<=9), False
Contra positive: ∀x , [(x2<=9) → (x<=3)], true

ii) ∀x, [{(x2+4x-21)>0} →{(x>3) V(x<-7)}]


Converse: ∀x , [{(x>3) V(x<-7)} → {(x2+4x-21)>0}] , true
Inverse: ∀x , [{(x2+4x-21)<=0} →{(x<=3) ∧ (x>=-7)}] , true
Contra positive: ∀x , [{(x<=3) ∧ (x>=-7)} →{(x2+4x-21)<=0}], true
•Let the universe consist of integers 1, 2, 4, 8, 16, 32
Let P( x ): x is an even integer.
Q( x ): x is divisible by 8.
R( x , y ): x is divisible by y .

Find the truth value of


(i) P(8) (ii) Q(4) (iii) R(1, 16) (iv) R(16, 1)
(v) P(8)  R(8, 4) (vi) R(1, 8) → Q(4)
Solution:
(i) P(8):
P( x ): x is even integer.
Here x is 8. 8 is an even integer. Therefore P(8) is true.
(ii) Q(4):
Q( x ): x is divisible by 8.
Here x is 4. But 4 is not divisible by 8. Therefore Q(4) is
false.
(iii)R(1, 16):
R( x , y ): x is divisible by y .
Here R(1, 16) is : 1 is divisible by 16, which is not true.
Hence its truth value is false
(iv) R(16, 1):
The meaning is ’16 is divisible by 1’ And its truth value is true.
(v) P(8)  R(8, 4):
(vi) P(8) is true.
R(8, 4) is ‘8 is divisible by 4’ And it is true.
(vi) R(1, 8) → Q(4)
R(1, 8) is ‘ 1 is divisible by 8’ and it is false Q(4) is false ( found in (ii))
Using definition of conditional statement

R(1, 8) Q(4) R(1, 8) → Q(4)


F F T
•Ex: Negate the statement, ‘If x is odd then x2 -1 is even’
•Let p( x ): x is odd
q( x ): x2 -1 is even
The given statement is, ‘If x is odd then x2 -1 is even’ and it can be denoted as
"x  p(x)  q(x)) .
The negation of this statement is determined as follows
 ["x  P(x)  Q(x))]
$x [ P(x)  Q(x))] Negation of universal quantifier "x is the essential quantifier $x
 $x [P(x)  Q(x)) ]Conditional equivalence P  Q  P  Q
 $x [P(x))  Q(x)] Demorgan’s laws
 $x [P(x)  Q(x)] Law of double negation

Hence the negation is, “There exists an integer x such that x is odd and x2 -1 is not even (odd)”.
(The truth value of this statement is false).
Logical Implications involving Quantifiers
A quantified statement P is said to logically imply a quantified statement Q if Q is
true whenever P is true. Then we write P Q
Given a set of quantified statements P1,P2,P3…Pn and Q.
we say that Q is a valid conclusion from the premises P1,P2,P3…Pn or
(P1 ∧ P2 ∧P3… ∧ Pn) → Q is a valid argument if Q is true,
or equivalently if (P1 ∧ P2 ∧P3… ∧ Pn)  Q.
The validity of an argument involving quantified statement is analyzed on the basis
of the Laws Of Logic & the Rules Of Inference.
Ex: Prove the following
i) ∀x, P(x) ∃x, P (x)
∀x, P(x) P (x) is true for every x ∈ S
P (x) is true for x = a∈ S
P (x) is true for some x ∈ S
∃x, P (x)

ii) ∀x, [P(x)V Q(x)] ∃x, P (x) V ∃x ,Q(x)


∀x, [P(x)V Q(x)] P (x) V Q(x) is true for every x ∈ S
{ P (x) is true for every x ∈ S} V {Q(x) is true for every x ∈ S}
∀x, P(x) V Q(x) is true for a ∈ S
∃x, P (x) V ∃x ,Q(x)
INFERENCE THEORY FOR PREDICATE CALCULUS

As discussed earlier, the validity of an argument is checked in inference


theory. When the premises and the conclusion are propositions, the validity
of the arguments are proved using the equivalence laws and the valid
inferences
When the propositions are quantified statements with predicates, the
inferences and the equivalence laws are not sufficient to check their validity.
Hence along with those laws and inferences we use the following for deriving
the conclusion from the premises.
INFERENCE THEORY FOR PREDICATE CALCULUS
Some more Equivalence laws and inferences:

1. $x) A x)  B  x))  $x) A x)  $x) B  x)

2.  x)  A x)  B  x))   x) A x)   x) B  x)

3. $x) A x)   x) A x)

4.  x) A x)  $x)A x)

5.  x) A x)   x) B  x)   x)  A x)  B  x))

6. $x) A x)  B  x))  $x) A x)  $x) B  x)


As before the proof is either a direct proof or an indirect proof. Rule P, rule
T and rule CP are also used here with the same meaning.
In the inference theory of predicate calculus the arguments contain either
the universal quantifier  x) or "x or the existential quantifier [$x].
We either use these additional laws and inferences to derive the
conclusion or we remove the quantifiers to get forms generalized to
predicates.
 Then we use the ordinary equivalence laws and inferences to get the
conclusion.
If the conclusion is a quantified statement we introduce quantifiers to get
the desired result. The additional laws and inferences involving quantifiers
can also be used in any stage as required.
Additional Rules of Inference(Inference Theory of the Predicate calculus):
1. If the statement ∀x, P(x) is assumed to be true then P(y) is also true. Where y is an
arbitrary member of the domain of the discourse(universe). This rule is called as
Universal Specification(US).
"xPx)
Rule US: (x)P(x) ⇒ P(y)
Py)
From (x)P(x), one can conclude P(y).

2. If P(y) is true where is y is an arbitrary member of the domain of the


discourse(universe) then ∀x, P(x) is to be true. This rule is called Universal
Generalization(UG). Py) for an arbitrary y
Rule UG: P(y) ⇒ (x)P(x) "xP x)
From P(y), one can conclude (x)P(x).
3. If the statement ∃x, P(x) is assumed to be true then P(y) is also true for some
member of the domain of the discourse(universe). This rule is called as Existential
Specification(ES). $xPx)
Rule ES: (∃x)P(x) ⇒ P(y)  Py) for some element ‘y'
From (∃x)P(x), one can conclude P(y).

4. If P(y) is true ∃x, P(x) is also true. This rule is called as Existential
Generalization(EG).
Py) for some element ‘y '
Rule EG: P(y) ⇒ (∃x)P(x) $xP x)
From P(y), one can conclude (∃x)P(x).
Example: Verify the validity of the following arguments:
“All men are mortal. Socrates is a man. Therefore, Socrates is mortal”.
or Show that (x)[H(x) → M(x)] ∧ H(s) ⇒ M(s).
Solution: Let us represent the statements as follows:
H(x) : x is a man M(x) : x is a mortal s : Socrates

Thus, we have to show that (x)[H(x) → M(x)] ∧ H(s) ⇒ M(s).

{1} (1) (x)[H(x) → M(x)] Rule P


{1} (2) H(s) → M(s) Rule US, (1)
{3} (3) H(s) Rule P
{1, 3} (4) M(s) Rule T, (2), (3), and I11
Example: Show that (x)(P (x) → Q(x)) ∧ (x)(Q(x) → R(x)) ⇒ (x)(P (x) → R(x)).
Solution:

{1} (1) (x)(P (x) → Q(x)) Rule P


{1} (2) P (y) → Q(y) Rule US, (1)
{3} (3) (x)(Q(x) → R(x)) Rule P
{3} (4) Q(y) → R(y) Rule US, (3)
{1, 3} (5) P (y) → R(y) Rule T, (2), (4), and I13
{1, 3} (6) (x)(P (x) → R(x)) Rule UG, (5)
Prove that $x) p  x)  q  x)))  $x) p  x)  $x)q  x)) .

Step Proposition Justification


1. $x) p  x)  q  x)) Rule P

2. py)qy) Rule ES

3. py) Rule T conjunctive simplification and step (3)

4. qy) Rule T conjunctive simplification and step (3)

5. $xp  x) Rule EG and step (4)

6. $xq  x) Rule EG and step (5)

7. $x) p  x)  $x) q  x) Rule T and step (6) and step (7)


4. Check the validity of the argument
"x)P  x)  Q  x)), "x)R  x)  Q  x))  "x)R  x)  P  x))
Solution:
Since the conclusion involves the conditional connective we use the rule CP for proving it.

Step Proposition Justification


1. "x)P  x)  Q  x)) Rule P

2. "x)R  x)  Q  x)) Rule P

3. R  x)  Q  x ) Rule US & (2)

4. Rx) Rule P (assumed)

5. Q  x) (3), (4) & modus polens

6. P  x)  Q  x) Rule US & (1)

7. P  x) (5), (6) and modus tollens

8. R  x)  P  x ) Rule CP, (4) & (7)

9. "x)R  x)  P  x)) Rule UG and (9)


Example: Show that (x)(P (x) ∨ Q(x)) ⇒ (x)P (x) ∨ (∃x)Q(x). (May. 2012)
Solution: We shall use the indirect method of proof by assuming ¬((x)P (x)∨(∃x)Q(x)) as an additional premise.
{1} (1) ¬((x)P (x) ∨ (∃x)Q(x)) Rule P (assumed)
{1} (2) ¬(x)P (x) ∧ ¬(∃x)Q(x) Rule T, (1) ¬(P ∨ Q) ⇔ ¬P ∧ ¬Q
{1} (3) ¬(x)P (x) Rule T, (2), and I1
{1} (4) (∃x)¬P (x) Rule T, (3), and ¬(x)A(x) ⇔ (∃x)¬A(x)
{1} (5) ¬(∃x)Q(x) Rule T, (2), and I2
{1} (6) (x)¬Q(x) Rule T, (5), and ¬(∃x)A(x) ⇔ (x)¬A(x)
{1} (7) ¬P (y) Rule ES, (5), (6) and I12
{1} (8) ¬Q(y) Rule US, (6)
{1} (9) ¬P (y) ∧ ¬Q(y) Rule T, (7), (8)and I9
{1} (10) ¬(P (y) ∨ Q(y)) Rule T, (9), and ¬(P ∨ Q) ⇔ ¬P ∧ ¬Q
{11} (11) (x)(P (x) ∨ Q(x)) Rule P
{11} (12) (P (y) ∨ Q(y)) Rule US
{1, 11} (13) ¬(P (y) ∨ Q(y)) ∧ (P (y) ∨ Q(y)) Rule T, (10), (11), and I9
{1, 11} (14) F Rule T, and (13)
which is a contradiction. Hence, the statement is valid.
Exercises
1. Establish the validity of the following argument:
”All integers are rational numbers. Some integers are powers of 2. Therefore,
some rational numbers are powers of 2”.
Solution: Let P (x) : x is an integer
R(x) : x is rational number
S(x) : x is a power of 2
Hence, the given statements becomes
(x)(P (x) → R(x)), (∃x)(P (x) ∧ S(x)) ⇒ (∃x)(R(x) ∧ S(x))
2. Show that (∃x)M(x) follows logically from the premises (x)(H(x) → M(x)) and
(∃x)H(x).
3. Show that from (∃x)[F (x) ∧S(x)] → (y)[M(y) → W (y)] and (∃y)[M(y) ∧ ¬W (y)] the
conclusion (x)[F (x) → ¬S(x)] follows.
Exercise -1: Establish the validity of the following argument:‖All integers are
rational numbers. Some integers are powers of 2. Therefore, some rational
numbers are powers of 2‖.
Solution:
Let P (x) : x is an integer
R(x) : x is rational number
S(x) : x is a power of 2
Hence, the given statements becomes
(x)(P (x) → R(x)), (∃x)(P (x) ∧ S(x)) ⇒ (∃x)(R(x) ∧ S(x))
Solution:
(x)(P (x) → R(x)), (∃x)(P (x) ∧ S(x)) ⇒ (∃x)(R(x) ∧ S(x))
{1} (1) (∃x)(P (x) ∧ S(x)) Rule P

{1} (2) P (y) ∧ S(y) Rule ES, (1)

{1} (3) P (y) Rule T, (2) and P ∧ Q ⇒ P

{1} (4) S(y) Rule T, (2) and P ∧ Q ⇒ Q

{5} (5) (x)(P (x) → R(x)) Rule P


{5} (6) P (y) → R(y) Rule US, (5)
{1, 5} (7) R(y) Rule T, (3), (6) and P, P → Q ⇒ Q

{1, 5} (8) R(y) ∧ S(y) Rule T, (4), (7) and P, Q ⇒ P ∧ Q


{1, 5} (9) (∃x)(R(x) ∧ S(x)) Rule EG, (8)
Hence, the given statement is valid.
Exercise-2: Show that (∃x)M(x) follows logically from the premises
(x)(H(x) → M(x)) and (∃x)H(x).
Solution:

{1} (1) (∃x)H(x) Rule P

{1} (2) H(y) Rule ES, (1)

{3} (3) (x)(H(x) → M(x)) Rule P


{3} (4) H(y) → M(y) Rule US, (3)

{1, 3} (5) M(y) Rule T, (2), (4), and I11

{1, 3} (6) (∃x)M(x) Rule EG, (5)


Let p(x) be the open statement x2=2x & q(x) be the open statement x3=4x with the
set of all integers as the universe.
Write down the truth values of the following quantified statements.
i) ∀x, p(x) F
ii) ∃x, q (x) T
iii) ∀x, ¬p(x) F
iv) ∃x, ¬q (x) T
v) ∀x, p(x) ∧ q (x) F
vi) ∃x, p(x) ∧ q (x) T
vii) ∀x, p(x) v q (x) F
viii)∃x, p(x) v q (x) T
Write down the following propositions in symbolic form and find its negation:
Ex-1: “All integers are rational numbers and some rational numbers are not integers”
Let,
p(x): x is a rational number q(x): x is an integer
And
Z: set of all integers R: set of all rational numbers
Symbolic form: {∀x ∈ Z, p(x)} ∧ {∃x ∈ R, ¬q(x)}
Negation is: {∃x ∈ Z, ¬p(x)} ∧ {∀x ∈ R, q(x)}
(Some integers are not rational numbers or every rational number is an integer)
Ex-2: If all triangles are right angled, then no triangle is equiangular
Symbolic form: {∀x ∈ T, p(x)} → {∀ x ∈ T, ¬q(x)}
Negation is: {∀x ∈ T, p(x)} ∧ {∃ x ∈ T, q(x)}
all triangles are right angled and some triangles are equiangular
Write down the converse, inverse and contra positive of each of the following
statements and indicate truth value
i) ∀x , [(x>3)→ (x2>9)]
Converse: ∀x , [(x2>9) →(x>3)], False
Inverse: ∀x , [(x<=3) → (x2<=9), False
Contra positive: ∀x , [(x2<=9) → (x<=3)], true

ii) ∀x, [{(x2+4x-21)>0} →{(x>3) V(x<-7)}]


Converse: ∀x , [{(x>3) V(x<-7)} → {(x2+4x-21)>0}] , true
Inverse: ∀x , [{(x2+4x-21)<=0} →{(x<=3) ∧ (x>=-7)}] , true
Contra positive: ∀x , [{(x<=3) ∧ (x>=-7)} →{(x2+4x-21)<=0}], true
•Let the universe consist of integers 1, 2, 4, 8, 16, 32
Let P( x ): x is an even integer.
Q( x ): x is divisible by 8.
R( x , y ): x is divisible by y .

Find the truth value of


(i) P(8) (ii) Q(4) (iii) R(1, 16) (iv) R(16, 1)
(v) P(8)  R(8, 4) (vi) R(1, 8) → Q(4)
Solution:
(i) P(8):
P( x ): x is even integer.
Here x is 8. 8 is an even integer. Therefore P(8) is true.
(ii) Q(4):
Q( x ): x is divisible by 8.
Here x is 4. But 4 is not divisible by 8. Therefore Q(4) is
false.
(iii)R(1, 16):
R( x , y ): x is divisible by y .
Here R(1, 16) is : 1 is divisible by 16, which is not true.
Hence its truth value is false
(iv) R(16, 1):
The meaning is ’16 is divisible by 1’ And its truth value is true.
(v) P(8)  R(8, 4):
(vi) P(8) is true.
R(8, 4) is ‘8 is divisible by 4’ And it is true.
(vi) R(1, 8) → Q(4)
R(1, 8) is ‘ 1 is divisible by 8’ and it is false Q(4) is false ( found in (ii))
Using definition of conditional statement

R(1, 8) Q(4) R(1, 8) → Q(4)


F F T
•Ex: Negate the statement, ‘If x is odd then x2 -1 is even’
•Let p( x ): x is odd
q( x ): x2 -1 is even
The given statement is, ‘If x is odd then x2 -1 is even’ and it can be denoted as
"x  p(x)  q(x)) .
The negation of this statement is determined as follows
 ["x  P(x)  Q(x))]
$x [ P(x)  Q(x))] Negation of universal quantifier "x is the essential quantifier $x
 $x [P(x)  Q(x)) ]Conditional equivalence P  Q  P  Q
 $x [P(x))  Q(x)] Demorgan’s laws
 $x [P(x)  Q(x)] Law of double negation

Hence the negation is, “There exists an integer x such that x is odd and x2 -1 is not even (odd)”.
(The truth value of this statement is false).
Automatic Theorem Proving
The shortcomings of procedures used in the process of derivation are :
•Rule P allows the introduction of a premise at any point in the derivation. But, it does
not suggest either the premise or the step at which it should be introduced.
•Rule T allows the introduction of any formula, obtained from the previous formulas.
But, there is neither definite choice of such formula nor any guidance for the use of any
particular implication and/or equivalence.
•Rule CP does not tell anything about the stages at which an antecedent has to be
introduced as an assumed premise. It does not indicate the stage, at which it is again
incorporated into the conditional.
Because of the above disadvantages, the process of derivation requires skill,
experience and intelligence to make the right decision at every step.
So, the process can not carried out mechanically.
Hence, a new set of rules and procedure is required to construct each
step of derivation in a specified manner and finally to show whether the
conclusion follows from the given premises.
The new formulation is based on the work of Hao Wang and consists of :
•10 rules,
•An axiom schema,
•Rules of well-formed sequents and formulas.

1.Variables: The upper-case letters A, B, …, P, Q, …, Z are used as


statement variables and also as statement formulas.
2. Connectives: The connectives, , L, V, , and ⇄ appear in the formulas
with same order of precedence. The concept of well-formed formulas is
the same.
3. String of Formulas: A string of formulas is defined as follows :
1.Any formula is a string of formulas.
2.If a and b are strings of formulas, then a, b and b, a are strings of formulas.
3.Only those strings which are obtained by steps (a) and (b) are strings of formulas, with the exception
of the empty string, which is also a string of formulas.
Note: The order in which the formulas appear in any string is not important.
4. Sequents: If a and b are strings of formulas, then a→ b is called a sequent in which a is called as
antecedent and b as consequent of the sequent.
A sequent a → b is true iff either at least one of the formulas of the antecedent is false or at
least one of the formulas of the consequent is true.
Thus A, B, C → D, E, F is true iff A L B L C  D V E V F is true. So, the symbol → is a
generalization of the connective  to strings of formulas.

Similarly, the symbol ⇒ applied to strings of formulas as a generalization of the symbol


.
Thus A  B means “A implies B” or “A  B is a tautology” and a ⇒ b means a → b is true
Sometimes the sequents may have empty strings of formulas as antecedent or consequent. The empty
antecedent is interpreted as logical constant “true” or T and empty consequent as the logical constant
“false” or F

5. Axiom Schema: Let a and b are strings of formulas, each formula containing a
variable only, then the sequent a → b is an axiom iff a and b have at least one variable
in common. Ex : A, B, C → P, B, R, where A, B, C, P, and R are variables, is an axiom.
c
Note : If a → b is an axiom then a ⇒ b.

6.Theorem: The following sequents are theorems of the system.


a. Every axiom is a theorem.
b. If a sequent a is a theorem and a sequent b results from a by using one of the 10
rules given below, then b is also a theorem.
c. Sequents obtained by (a) and (b) are the only theorems.
7. Rules: The following rules are used to combine formulas within strings
by introducing connectives.
For each of the connective there are two rules :
1.The introduction of the connective in the antecedent.
2.The introduction of the connective in the consequent.
In the description of these rules,
a, b, γ, … are strings of formulas, and
X and Y are formulas to which the connectives are applied.
Antecedent Rules:
c c
1. Rule  : If a, b ⇒ X, γ, then a, X, b ⇒ γ.
c c
2. Rule L : If X, Y, a, b ⇒ γ, then a, X L Y, b ⇒ γ.
c c c
3. Rule V : If X, a, b ⇒ γ and Y, a, b ⇒ γ, then a, X V Y, b ⇒ γ.
c c c
4. Rule  : If Y, a, b ⇒ γ and a, b ⇒ X, γ, then a, X  Y, b ⇒ γ.
c c c
5. Rule ⇄ : If X, Y, a, b ⇒ γ and a, b ⇒ X, Y, γ, then a, X ⇄ Y, b ⇒ γ.
Consequent Rules:
c c
6. Rule  : If X, a ⇒ b, γ, then a ⇒ b, X, γ.
c c c
7. Rule L : If a ⇒ X, b, γ and a ⇒ Y, b, γ, then a ⇒ b, X L Y, γ.
c c
8. Rule V : If a ⇒ X, Y, b, γ, then a ⇒ b, X V Y, γ.
c c
9. Rule  : If X, a ⇒ Y, b, γ, then a ⇒ b, X  Y, γ.
c c c
10. Rule ⇄ : If X, a ⇒ Y, b, γ and Y, a ⇒ X, b, γ, then a ⇒ b, X ⇄ Y, γ.
Note: In the above rules, the order in which the formulas and strings of formulas appear
in a string is unimportant. But for computer implementation of the process, some kind of
order is necessary
In the method of derivation, we show that a conclusion C follows from the premises
H1, H2, …, Hm, by introducing the premises at various stages by rule P and the last step
was C.

The above method means showing


H1, H2, …, Hm  C (1)
Another way of stating (1) is
H1  (H2  (H3  … (Hm  C) … )) (2) is a tautology

The new formulation is premise-free, so that in order to show that C follows from H1,
H2, …, Hm, we establish that
c
→ H1  (H2  (H3  … (Hm  C) … )) (3) is a theorem.
We must show that
c
⇒ H1  (H2  (H3  … (Hm  C) … )) (4)
New procedure involves showing (3) to be a theorem. For this, (4) is assumed as true
and then show that this assumption is or is not justified.
This can be accomplished by working backward from (4), using the rules and showing
that (4) holds if some simple sequent is a theorem.

Note : A simple sequent is a sequent in which some connective is


eliminated in one of the formulas appearing in the antecedent or the
consequent.

Working backward continues till the simple possible sequents i.e., those
which do not have any connectives are obtained.
If these sequents are axioms then our assumption of (4) is justified.
If at least one of the simplest sequents is not an axiom, then the
assumption of (4) is not justified and C does not follow from H1, H2, …, Hm.
Ex 1: Show that P V Q follows from P.
Solution: We need to show that
C
(1) ⇒ P  (P V Q)
C
(1) If (2) P ⇒ P V Q () [ X, a ⇒ Y, b, γ, then a ⇒ b, X  Y, γ.]
c
(2) If (3) P ⇒ P, Q (V) [a ⇒ X, Y, b, γ, then a ⇒ b, X V Y, γ.]

The connective  is eliminated in (1) by using the rule  and the resulting P ⇒ P V Q is
named as (2).
Similarly (3) is obtained from (2) by using the rule V.
Finally (3) is a theorem, because it is an axiom.

Note: “(1) if (2)” means “if (2) then (1)” or “(1) holds if (2)”
The actual derivation is reversal of these steps in which (3) is an axiom that leads
to ⇒ P  (P V Q) as shown
c

a) P ⇒ P, QAxiom
c

b) P ⇒ P V Q Rule (V), (a)


c

c) ⇒ P  (P V Q) Rule (), (b)


Ex 3: Does P follows from P V Q?
We investigate whether → (P V Q)  P is a theorem. Let us assume

(1)⇒ (P V Q)  P
(1)If (2) P V Q ⇒ P ()

(2)If (3) P ⇒ P and (4) Q ⇒ P (V)


[X, a, b ⇒ γ and Y, a, b ⇒ γ, then a, X V Y, b ⇒ γ]

Here, (3) is an axiom, but (4) is not. Hence P does not follow from P V Q.
c
Ex 2: Show that ⇒ (Q L (P  Q))  P.
Solution:
c
(1) ⇒ (Q L (P  Q))  P

(1) If (2) Q L (P  Q) ⇒ P ()


c
(2) If (3) Q, P  Q ⇒ P (L)

(3) If (4) P  Q ⇒ P, Q ()

(4) If (5) Q ⇒ P, Q and (6) ⇒ P, P, Q ()


[Y, a, b ⇒ γ and a, b ⇒ X, γ, then a, X Y, b ⇒ γ.]

(5) If (7) P, Q ⇒ Q ()

(6) If (8) P ⇒ P, Q ()

Since (7) and (8) are axioms, the theorem (1) follows.
Ex 4: Show that S V R is tautologically implied by (P V Q) L (P  R) L (Q  S)
Solution :
c
(1). ⇒ ((P V Q) L (P  R) L (Q  S))  (S V R)

(1)If (2) (P V Q) L (P  R) L (Q  S) ⇒ (S V R) ()

(2)If (3) (P V Q) L (P  R) L (Q  S) ⇒ S, R (V)

(3)If (4) (P V Q), (P  R), (Q  S) ⇒ S, R (L twice)

(4) If (5) P, (P  R), (Q  S) ⇒ S, R


and (6) Q, (P  R), (Q  S) ⇒ S, R (V)
(5)If (7) P, R, Q  S ⇒ S, R and (8) P, Q  S ⇒ P, S, R ()
(7)If (9) P, R, S ⇒ S, R and (10) P, R ⇒ S, R, Q ()
(8) If (11) P, S ⇒ P, S, R and (12) P ⇒ P, S, R, Q ()
(6)If (13) Q, R, Q  S ⇒ S, R and (14) Q, Q  S ⇒ S, R, P ()
(13)If (15) Q, R, S ⇒ S, R and (16) Q, R ⇒ S, R, Q ()

(14)If (17) Q, S ⇒ S, R, P and (18) Q ⇒ S, R, P, Q ()

Now, (9) to (12) and (15) to (18) are all axioms; therefore the result follows.

You might also like