Discrete Structures and Graph Theory: Unit-1
Discrete Structures and Graph Theory: Unit-1
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 T F
T F F
T T T
p q pq
F F F
F T T
T F T
T 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 T
F T T
T F F
T 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 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.
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.
Ex. (PQ) , (PQ) , (P (PQ) ) , (P (Q R)) and
(PQ) (PQ) are well formed formulas.
Ex. PQ , (PQ )Q ) and (P Q ) (Q) are not well formed
formulas.
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.
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
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
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:
(PQ) {(PQ) (QP)}
Tautology and Contradiction
Tautology : A propositional function (Statement formula) whose value
is true for all possible values of the propositional variables is called a
Tautology ( A Universally valid formula or a logical truth).
Ex: P P is a tautology.
Ex. ( P P ) Q is a tautology.
Contradiction (Absurdity): A propositional function whose truth value
is always false is called a Contradiction
Ex. P P is a Contradiction .
Ex. ( P P ) Q is a Contradiction
Contingency: A propositional function that is neither a tautology nor a
contradiction is called a Contingency.
Ex. P Q , P Q , P Q, ….
Logical Equivalence & Tautological Implication
Two propositional functions P and Q are logically equivalent, if they
have same truth tables. Then we write
P Q or P Q
Ex: (P ) P
Ex: ( P Q ) ( P Q ).
Note : The symbol is not a connective
A Statement P is said to tautologically imply a Statement Q if and only
if PQ is a tautology.We shall denote this as P Q.
Here, P and Q are related to the extent that, Whenever P has the truth
value T then so does Q.
Every logical implication is an implication, but all implications are not
logical implications.
More on Implications
If P Q and Q P , then PQ.
If PQ then PQ is a tautology.
Ex: Show that ( P Q ) ( P Q )
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 ) 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:
PQQP
PQQP
Asociative laws:
(PQ)RP(QR)
(PQ)RP(QR)
Distributive laws:
P(QR)(PQ)(PR)
P(QR)(PQ)(PR)
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)
Implications ,Arguments,Inferences
Inference (Argument): From a set of premises (called Hypotheses) {H1,
H2, …., Hn } a conclusion C follows logically
iff H1 H2 …. Hn C.
• 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.
• 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.
Rules of Inference (Logical Implications)
1) Simplification rules:
a) (P Q) P
(P Q) P is a tautology.
P logically follows from (P Q)
b) (P Q) Q
(P Q) Q is a tautology.
Q logically follows from (P Q)
Contd.,
2) Addition rules:
• a) P (P Q)
P (P Q) is a tautology
(P Q) logically follows from P
b) Q ( P Q )
Q (P Q) is a tautology
(P Q) logically follows from Q
Rules of Inference (contd.,)
3) P (P Q)
P (P Q) is a tautology
(P Q) logically follows from P
4) Q ( P Q)
Q (P Q) is a tautology
(P Q) logically follows from Q
Contd.,
5) (P Q) P
(P Q) P is a tautology (or)
P follows from (P Q)
6) (P Q ) (Q)
(P Q ) (Q) is a tautology
Q logically follows from (P Q)
Rules of Inference (Contd.,)
7) Disjunctive syllogism
{P, P Q} Q
{(P Q) P } Q is a tautology.
Examples
1. Obtain Disjunctive Normal Form of P (P Q).
P (P Q) P (~P Q)
(P ~P) (P Q)
2.Obtain 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)
2.Obtain 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)
3.Obtain 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. P {(P Q) ~(~Q ~ P))
2. ~{P(QR)}
3. (~P ~ Q) (P ~ Q)
4. (P (Q R))(~P (~Q ~ R))
5. (~P ~ Q) (P ~ Q) (CNF)
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 22 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