Understanding Propositional Logic Basics
Understanding Propositional Logic Basics
Propositional Logic:
Statement (Proposition) : A declarative sentence to which
truth values “true” or “false” can be assigned but not both.
We call such sentences Propositions (Statements).
Ex. Sun rises in the east.
2+3 = 4
Man is mortal.
12+9 = 3-2
It is raining.
Mumbai is the capital of india.
London is a city.
Narendra Modi is the 14th prime minister of india.
1+1=2
The logic that depends on the analysis of
proposition/statements is known as Propositional Logic
The following sentences are not statements(propositions)
What is your name?
Close the door.
A is less than 2
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
Used to combine two atomic statements. In proposition
logic we have generally 5 connectives.
Or, and, negation, if-then, if and only if
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
F T
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
F F
T T F
T F T
T
Disjunction ( Or ) pq
If p and q are two propositions, then the disjunction of p
and q is the statement p q which is read as “ p or q”.
The statement pq has the truth value F only when both p
and q have truth value F; otherwise it has the truth value T.
p q pq
F F F
F T T
T F T
T T T
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 T
F T T
T F F
T T T
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 T
F T F
T F F
T 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.
Truth tables
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.
If there are ‘n’ distinct components in a statement formula,
we need nto consider 2 possible combinations of truth
values in order to obtain the truth table.
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
Truth tables - Examples
Ex : 2 Construct the truth table for (PQ) P
P Q PQ P (PQ) P
F F F T T
F T T T T
T F T F T
T T T F T
Some examples:
P ^ ~Q
P (QR)
(P^Q) (P
Q)
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
P Q PQ ( P Q ( P Q ) (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
P P P
P P T
P P F
R ( P P ) R
R ( P P ) R
R ( P P ) T
R ( P P ) 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
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)
Implications , Arguments, Inferences
Premise: It is a proposition on the basis of which we would
able to draw a conclusion . It can be evidence or assumptions.
Initially we assume something is true and on the basis of
that assumption, we draw some conclusion.
Conclusion: It is a proposition that is reached from given set
of premises.
if premise then conclusion
Inference (Argument): Sequence of statements that ends
with a conclusion or set of 1 or more premises and a
conclusion.
or
From a set of premises (called Hypotheses) {H1, H2, …., Hn }
a conclusion C follows logically
iff H1 H2 …. Hn C.
Implications ,Arguments,Inferences
• The rules of inference are criteria for determining the
validity of an argument.
.. p
• It is an Invalid argument
Rules of inference:
Fallacies:
1. The fallacy of affirming the Consequent (or affirming
the converse):
PQ
Q
_________
P Fallacy
Examples
1. Obtain Disjunctive Normal Form of P (P Q).
P (P Q) P (~P Q)
(P ~P) (P Q)
[Link] Disjunctive Normal Form of ~(P Q) (P Q).
~(P Q) (P Q)
(~(P Q) (P Q)) ((P Q) ~(P Q))
since [R S (R S) (~R ~S)]
~(P Q) (P Q)
(~P ~Q P Q) ((P Q) (~P ~Q)
Examples
1. Obtain Conjunctive Normal Form of P (P Q).
P (P Q) P (~P Q)
[Link] Conjunctive Normal Form of ~(P Q) (P
Q).
~(P Q) (P Q)
(~(P Q) (P Q)) ((P Q) ~(P Q))
since [R S (R S) (S R)]
~(P Q) (P Q)
((P Q) (P Q)) (~(P Q) (~P ~Q)
((P Q P) (P Q Q))
((~P ~Q) (~P ~Q)
(P Q P) (P Q Q)
(~P ~Q ~P) (~P ~Q ~Q)
[Link] Conjunctive Normal Form of Q (P ~Q) (~P
~Q).
Q (P ~Q) (~P ~Q)
Q ((P ~P) ~Q)
(Q (P ~P)) (Q ~Q)
(Q P ~P) (Q ~Q)
1. DNF of P {(P Q) ~(~Q ~ P))
2. DNF,CNF of ~{P(QR)}
3. DNF of (~P ~ Q) (P ~ Q)
4. CNF of (P (Q R))(~P (~Q ~ R))
5. DNF (~P ~ Q) (P ~ Q)
Principal Disjunctive Normal Forms
Let P and Q be two statement variables.
Let us construct all possible formulas which consists of
conjunctions of P or its negation and conjunctions of Q or its
negation.
None of the formulas should contain both a variable and its
negation.
Ex: either P Q or Q P is included but not both.
For two variables P and Q , there are 22 such formulas given by
P Q, P ~ Q , ~ P Q and ~ P ~ Q
these formulas are called minterms.
From the truth tables of these minterms, it is clear that no two
minterms are equivalent
Each minterm has the truth value T for exactly one
combination of the truth values of the variables P and Q.
For a given formula , an equivalent formula consisting of
disjunction of minterms only is known as its principal
disjunctive normal form.
Also called sum-of –products canonical form.
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 2 2 such formulas given
by
PQ, PQ, PQ, PQ
These formulas are called ‘min terms’.
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 T T T T F
PQ (PQ) (PQ) (PQ)
P Q (PQ) (PQ) (PQ)
(PQ) (PQ) (PQ) (PQ)
Ex. Obtain the Principal Disjunctive normal form of the following
P {(PQ) (P Q)}
P Q PQ P Q {(PQ) A
(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 )
{(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
A (PQ R) (PQ R) (PQ R) = (m1, m6, m7)
Principal Conjunctive normal forms (Product of
Sums canonical forms)
Max terms: For a given number of variables, the max term
consists of disjunctions in which each variable or its
negation, but not both, appears only once.
For two variables P and Q, there are 22 such formulas
given by
(P Q), (P Q), (P Q), (P Q).
These formulas are called ‘max terms’.
For three variables P,Q and R, there are 23 such formulas
given by
PQR, P Q R, P Q R, P Q R,
P Q R, P Q R, P Q R, P Q R
These max terms are denoted by M0, M1 , …, M7
respectively.
In general, there are 2n Max terms for n variables.
PCNF (Contd.,)
Mi = mi
M0 = m0
= (PQ R) = (P Q R)
M1 = m1
= (PQ R) = (P Q R)
M2 = m2
= (PQ R) = (P Q R)
Principal Conjunctive normal form (Product of Sums
canonical form) : For a given formula, an
equivalent formula consisting of conjunctions of max
terms only is known as Principal Conjunctive normal
form.
Principal Conjunctive Normal Forms
Let us construct all possible formulas which consists of
conjunctions of P or its negation and conjunctions of Q or
its negation.
None of the formulas should contain both a variable and its
negation.
Ex: either P Q or Q P is included but not both.
For two variables P and Q , there are 22 such formulas
given by
P Q, P ~ Q , ~ P Q and ~ P ~ Q
these formulas are called maxterms.
For a given formula , an equivalent formula consisting of
conjunctions of maxterms only is known as its principal
conjunctive normal form.
Also called products-of-sums canonical form.
Ex. Obtain the Principal Conjunctive normal forms of the following
PQ , P Q, (PQ)
F F T F T F
F T T F F T
T F F F F T
T T T T T F
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 PQ 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
The PCNF of A = (0,2,4,5)
A (P Q R) (P Q R) (P Q R) (P Q R)
Contd.,
The PDNF of A = (1,3,6,7)
A (PQ R) (PQ R) (PQ R) (PQ R)