Professional Documents
Culture Documents
Computer Science
Mathematical logic
Set theory
Algebraic Structures
Elementary Combinatorics
Recurrence relations
Graph theory
Mathematical logic
Statement (Proposition) : A declarative sentence to which it is
meaningful to assign one and only one of the truth values “true”
or “false”. We call such sentences Propositions (Statements).
Ex. London is a city. Ex. 2+3 = 4
The following sentences are not statements.
What is your name?
Close the door
For definiteness let us list our assumptions about propositions.
The law of excluded middle: For every proposition p,
either p is true or p is false.
The law of contradiction: For every proposition p, it is not the
case that p is both true and false.
Atomic and Compound statements
Atomic statement : A statement which can not be divided
further, is called atomic statement (Simple statement or
primary statement).
These statements are denoted by p,q,r,s,……
Ex. Milk is white Ex. 2+3 = 5
Compound Statement : Two or more simple statements can be
combined to form a new statement. These new statements are
called Compound statements or Molecular Statements or
Propositional function or Statement formulas.
Ex. It is raining today and there are 20 tables in this room.
Compound statements can be formed from atomic statements
through the use of following sentential connectives.
not, and , or , if …then and if and only if .
Connectives
Negation: If p is a statement, then the negation of p, written as
~p and read as “ not p ” is a statement.
Ex. p : London is a city.
~p : London is not a city.
The truth table for not p is given below.
p ~p
T
F
Conjunction (and) pq
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 pq
F F
F
T T
T F
T
p q pq
F F
F T
T F
T T
Disjunctive syllogism: If p q is true and p is false, then q is true.
Implication (Conditional) pq
If p and q are two propositions, then the statement pq
which is read as “ if p, then q ” or “ p implies q “.
The statement pq has truth value F only when p is true
and q is false; otherwise it has a truth value T.
p q pq
F F
F T
T F
T T
A false antecedent p implies any proposition q.
A true consequent q is implied by any proposition q
Biconditional (if and only if) pq
Biconditional : If p and q are two propositions, then the
statement pq, which is read as “p if and only if q” is called a
biconditional statement.
The statement pq has the truth value T whenever both p and
q have identical truth values.
p q pq
F F
F T
T F
T T
More on Implication
The opposite of pq is p q
The converse of pq is qp
The contra positive of pq is q p
Note : pq is logically equivalent to q p
i.e., pq q p
or pq 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 pq is true then it’s converse q p need not be true.
If pq is true then it’s opposite p q need not be true.
Well formed formulas
A well formed formula can be generated by the following rules.
1. A statement variable standing alone is a well formed formula.
2. If P is a well formed formula, then ~P is a well formed formula.
3. If P and Q are well formed formulas, then (PQ) , (PQ) , (PQ)
and (PQ) are well formed formulas.
4. A string of symbols containing the statement variables,connectives
and parenthesis is a well formed formula, iff it can be obtained by
finitely many applications of the rules 1,2 and 3.
P Q Q P Q
F F T
F T F
T F T
T T F
Truth tables - Examples
F F F T T
F T T T T
T F T F T
T T T F T
Truth tables - Examples
Ex.3 Construct the truth table for (PQ) (QP)
F F T T T
F T T F F
T F F T F
T T T T T
Note:
P Q PQ P PQ
F F T T T
F T T T T
T F F F F
T T T F T
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
Ex. Show that (PQ) (Q P)
P Q PQ ( 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
Equivalences
Commutative laws:
P Q Q P
P Q Q P
Asociative laws:
( P Q ) R P ( Q R )
( P Q ) R P ( Q R )
Distributive laws:
P ( Q R ) ( P Q ) ( P R )
P ( Q R ) ( P Q ) ( P R )
Demorgan’s laws:
( P Q) P Q
( P Q) P Q
More Equivalences
( P ) P (Double negation)
P P P
PP P
PPT
PPF
R(PP)R
R(PP)R
R(PP)T
R(PP)F
P Q ( P Q)
( P Q ) (P Q)
P Q ( Q P )
More Equivalences
• PFP
• PTT
• PFF
• PTP
• P ( Q R) ( P Q ) R
( P Q ) (P Q)
• (P Q ) [( P Q) ( Q P )]
• ( P Q ) [( P Q) ( P Q )]
• Absorption laws
• P(PQ)P
• P(PQ)P
Ex. Without using truth tables, Show that
P ( Q R) ( P Q ) R
Proof:
L.H.S = P (Q R)
P (Q R) (Since A B ( A B))
P (Q R)
(P Q) R (By associative property)
( P Q ) R (By demorgan’s law)
(PQ)R
= R.H.S
Ex. Without using truth tables, Show that
( P Q ) P is a tautology.
Proof:
Consider, ( P Q ) P
( Q P ) P ( By commutative law )
Q (P P ) ( By associative property)
Q T
T
( P Q ) P is a tautology.
Ex. Show that the Statement formula
( P Q ) (PQ) P is a tautology.
Proof : Consider,
{( P Q ) (PQ)} P (Associative law)
{(P Q ) (PQ)} P ( Demorgan’s law)
{P (Q Q)} P (Distributive law)
{P T } P
{P } P
T
( P Q ) (PQ) P is a tautology
Ex. Show that [{( P Q ) ( P Q )} R ] R
Proof: L.H.S = {( P Q ) ( P Q )} R
{T}R (Since P Q ( P Q))
R
= R.H.S
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, By distributive law
{T } R (Since, A A T)
R
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 De morgan’s laws)
[(P Q) {P (Q R)}] {(P Q) (P R)}
(By De morgan’s laws)
[(P Q) {P Q) (P R)}] {(P Q) (P R)}
(By Distributive law)
{(P Q) (P R)} {(P Q) (P R)}
(Since A A A)
T ( Since A A T)
Normal forms
Elementary product:A product of the variables and their
negations in a formula is called an Elementary product.
Ex: P, PQ, PQ, PQ R
Elementary Sum: A Sum of the variables and their negations in
a formula is called an Elementary Sum.
Ex: P, P Q, P Q, P Q R
Disjunctive normal form: A formula which is equivalent to a
given formula and which consists of a sum of elementary
products is called a disjunctive normal form.
Ex: (P ) ( PQ ) (PQ).
Ex: ( PQ ) (PQ) (PQ R ).
Normal forms (contd.,)
Conjunctive normal form: A formula which is equivalent to a
given formula and which consists of a product of elementary
sums is called a conjunctive normal form.
Ex: (P ) ( P Q ) (P Q).
Ex: ( P Q ) (P Q) (P Q R ).
Min terms: Let P and Q are two statement variables. Let us
construct all possible formulas which consist of conjunctions of
P or its negation and conjunctions of Q or its negation.
For two variables P and Q, there are 22 such formulas given by
PQ, PQ, PQ, PQ
These formulas are called ‘min terms’.
Normal forms (contd.,)
For three variables P,Q and R, there are 23 such formulas given
by
PQ R, PQ R, PQ R, PQ R,
PQ R, PQ R, PQ R, PQ R
These min terms are denoted by m0, m1 , …, m7 respectively.
Solution:
P Q PQ PQ PQ (PQ)
F F T F F T
F T T T F T
T F F T F T
T PQ T (PQ)
T (PQ)
T (PQ)
T F
PQ (PQ) (PQ) (PQ)
(PQ) (PQ) (PQ) (PQ)
Ex. Obtain the Principal Disjunctive normal form of the following
P {(PQ) (P Q)}
F F T F F T
F T T F F T
T F F F F F
T T T T T T
A (PQ) (PQ) (PQ)
Which is the PDNF for A .
Ex. Obtain the Principal Disjunctive normal form of the following
(P Q) (Q R) (P R )
Solution: Consider, (P Q) (Q R) (P R )
{(P Q) (R R)}
{(P P) (Q R) }
{(P R ) (Q Q)}
P Q R P Q P (P R) A
F F F T T F F
F F T T T T T
F T F F T F F
F T T F T T F
T F F F F T F
T F T F F T F
T T F T F T T
T T T T F T T
Solution: (P R) (Q P)
(P R) {(PQ) (QP)}
(P R) (P Q) (Q P)
{ (P R) (Q Q) }
{ (P Q) (R R) }
{ (Q P) (R R) }
(P Q R) (P Q R) (P Q R)
( P Q R) (P Q R)
= (0,2,3,4,5)
Which is the required PCNF.
Max terms and Min terms
*
P Q R Min terms mi Max terms Mi
F F F m0 : PQ R M0 : P Q R
F F T m1 : PQ R M1 : P Q R
F T F m2 : PQ R M2 : P Q R
F T T
m3 : PQ R M3 : P Q R
T F F
m4 : PQ R M4 : P Q R
T F T
m5 : PQ R M5 : P Q R
T T F
T T T m6 : PQ R M6 : P Q R
m7 : PQ R M7 : P Q R
Ex. Obtain the Principal Conjunctive normal form and Principal
disjunctive normal form of A, where A = (P Q) (P R )
P Q R P Q P P R A
F F F F T F F
F F T F T T T
F T F F T F F
F T T F T T T
T F F F F F F
T F T F F F F
T T F T F F T
T T T T F F T
(P Q) P is a tautology.
P logically follows from (P Q)
(P Q) Q
(P Q) Q is a tautology.
Q logically follows from (P Q)
Addition rules:
• P (P Q)
P (P Q) is a tautology
(P Q) logically follows from P
Rules of Inference (contd.,)
Q(PQ)
Q (P Q) is a tautology
(P Q) logically follows from Q
P (P Q)
P (P Q) is a tautology
(P Q) logically follows from P
Q ( P Q)
Q (P Q) is a tautology
(P Q) logically follows from Q
(P Q) P
Disjunctive syllogism
{P, P Q} Q
{P ( P Q)} Q is a tautology.
The inference PQ
P
----------------
Q is valid
Modus ponens (Rule of detachment)
{P, PQ} Q
{ P (PQ) } Q is a Tautology
The argument
PQ
P
------------
Q is valid
Ex: The following argument is valid.
A) If today is a Sunday then today is a Holiday
B) Today is Sunday
C : Hence, Today is Holiday
Modus tollens
{ PQ, Q } P
{ (PQ) Q} (P) is a Tautology
The argument
PQ
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
Rule of Transitivity (Hypothetical Syllogism)
{ PQ, QR } (PR)
{ (PQ) (QR} (PR) is a Tautology
The argument
PQ
QR
------------
PR 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
Dilemma
The Inference
PQ
PR
QR
------------
R is a valid Inference.
p : Joe is a Mathematician.
q : Joe is ambitious
r : Joe is an early riser
s : Joe likes oat meal
The symbolic form of the given argument is
Contd.,
H1 : pq ….(1)
H2 : rs ….(2)
H3 : qr …..(3)
From (1) and (3), By the rule of transitivity, we have
pr ……(4)
From (4) and (2), By the rule of transitivity, we have
p s ……(5)
i.e., if Joe is a Mathematician, then he does not like oat meal.
The conclusion logically follows from the premises.
Hence, the argument is valid
Ex: Verify that the following argument is valid by using the rules of
inference (Here, H1 , H2 , …. are premises and C is conclusion) :
A : A works hard.
B : B will enjoy himself.
C : C will enjoy himself.
D : D will enjoy himself.
Now, we have to show that, A D follows from
A (B C) , B A and D C
Contd.,
A (B C) ….(1) B A ….(2)
D C ….(3) A …. (4) ( Additional premise)
From, (1) and (4), By modus ponens, We have
(B C) ……(5)
(2) A B …. (6)
From, (4) and (6), By modus ponens, B ….(7) follows.
From (5) and (7), By the rule of Disjunctive Syllogism, we have
C ….(8)
(3) C D …. (9)
From (8) and (9), By modus ponens, D follows
Hence, By CP rule, A D follows