0% found this document useful (0 votes)
32 views72 pages

3-Ordering and Uniqueness of Normal Forms-07!08!2024

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views72 pages

3-Ordering and Uniqueness of Normal Forms-07!08!2024

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 72

Module - 2

Introduction
• Definition.
• Need of normal forms.
• Elementary sum.
• Elementary product.
• Factor.
• Types of Normal Norms:
a) DNF
b) CNF
Normal Forms
• Drawbacks with truth table:
– Very tedious and difficult as the number of entries
increases very rapidly as number of statement
variables (n) increases.
• Solution: Transform the statement formulas to
some standard forms (simple in nature).
• The standard forms are called canonical forms
or normal forms.
Definition
• Let A (P1, P2, … Pn) be a statement formula where P1,
P2, ... Pn are the primitive variables.
1. If A has the truth value ‘T’ for atleast one combination of
truth values assigned to P1, P2, … Pn then A is said to be
staisfiable.
2. If A has the truth value ‘T’ for all possible assignments to
the truth values assigned to P1, P2, … Pn then A is said to
be identically true or tautology.
3. If A has the truth value ‘F’ for all possible assignments to
the truth values assigned to P1, P2, … Pn then A is said to
be identically false or contradiction.
Need of reduction to normal forms
• Decision problem: It is the process of finding
whether a given statement formula is a tautology
or a contradiction or atleast satisfiable.
• (-) If more no.of variables involved then it is
difficult with decision problem. Therefore we are
in need of other procedures known as reduction
to normal forms.
• NOTE: use the word "product" in place of
"conjunction" and "sum" in place of
"disjunction".
Elementary product
• A product of the variables and their negations
in a formula is called an elementary product.
(product means conjunction (AND)).
• Example: Let P and Q be any two atomic
variables.
• Then P,˥PQ,˥QP, P˥P and Q˥P are
elementary products.
Elementary sum
• A sum of the variables and their negations in a
formula is called an elementary sum. (Sum
means disjunction (OR)).
• Example: Let P and Q be any two variables.
• Then P, ˥PQ, ˥QP, P˥P and Q˥P are
elementary sums.
Factor
• Any part of an elementary sum or product, which is itself
an elementary sum or product is called a factor of the
original elementary sum or product.
• Example: ˥Q, P˥P, and ˥Q  P are some of the factors of
˥Q  P ˥P.
• Note 1: A necessary and sufficient condition for an
elementary product to be identically false is that it
contains atleast one pair of factors in which one is
negation of the other example P˥P ↔ F
• Note 2: A necessary and sufficient condition for an
elementary sum to be identically true is that it contains
atleast one pair of factors in which one is negation of the
other example P˥P ↔T.
Normal Form
• We can convert any proposition in two normal
forms −
1. Disjunctive Normal Form (DNF)
2. Conjunctive Normal Form (CNF)
DNF and CNF
a) Disjunctive Normal Form (DNF)
• A compound statement is in disjunctive
normal form if it is obtained by operating OR
among variables (negation of variables
included) connected with ANDs.
• Example: (PQ) (˥P ˥Q) (P˥Q˥R)
• NOTE:
1. DNF is not unique for a given formula.
2. A given formula is false if every product in DNF is
identically false.
Procedure to obtain DNF
1. Replace the connectives “” and by ,,˥
in the given statement formula.
2. Apply De Morgan’s law, if negation is applied
in the formula.
3. Apply Distributive law is some part of the
formula contains product of sum (POS).
Example - 1
• Obtain DNF of P (PQ) .
• Solution:
P (PQ)
 P (˥PQ) (use PQ  ˥PQ)
 (P˥P)(PQ) (use distributive law)
Example - 2
• Obtain DNF of ˥(PQ) (PQ)
Exercises
• Obtain a disjunctive normal form of the
following;
1. P((P  Q)˥(˥Q ˥P))
2. P(˥(Q  R)) (((PQ)  ˥R)  P)
3. (Q (P  R)) (P  R)  Q)
4. (P(Q  R)) ((˥ P  ˥ Q)  ˥ R))
5. (˥ P  ˥ Q) (˥ P  R)
6. (˥ P  ˥ Q) (PQ)
b) Conjunctive Normal Form (CNF)
• A compound statement is in conjunctive normal form
if it is obtained by operating AND among variables
(negation of variables included) connected with ORs.
• Examples:
– 1. (P  Q) (Q  R)
– 2. (˥P  Q  R)  (S  R)
• NOTE:
1. CNF is not unique for a given formula.
2. A given formula is true if every elementary sum in CNF is
identically true.
Example-1
• Obtain a conjunctive normal form P(PQ)
• Solution:
P(PQ)  P(˥P  Q)
Example-2
• Obtain a conjunctive normal form ˥(PQ)  (PQ)
• Solution:
˥(PQ)  (PQ) (Use RS  (R  S)  (S  R)
 (˥(PQ) (PQ))  ((PQ)  ˥(PQ)) ( Use R  S  ˥(RS))
Û ((PQ)  (PQ) )  (˥ (PQ)  ˥(PQ))
Û ((PQ)  (PQ) )  ((˥ P  ˥ Q)  (˥P ˥ Q)) (Use distributive law)
Û (PQ P)  (P  Q  Q)  (˥ P  ˥ Q  ˥ P)  (˥P ˥ Q ˥ Q)
Example-3
• Show that the formula Q  (P˥ Q) (˥P ˥Q) is
tautology, by obtaining a CNF, of the formula.
Exercises
• Obtain CNF for the followings;
1. Q (P˥Q) (˥P˥Q)
2. (P(QR))(˥ P  ˥ Q  ˥ R))
3. P ((P  Q)  ˥(˥Q  ˥P))
4. (Q (P  R))  ˥((P  R)  Q)
PDNF and PCNF
Principal Disjunctive Normal Form (PDNF) or
sum-of-products canonical (normal) form.
• Min terms (product term or boolean conjunction):
– If there are two statement variables, P and Q, then
minterm will contain (22) 4 possible formulas that have
conjunctions() of P and Q or its negation will be:
• PQ, P˥Q, ˥PQ, ˥P˥Q
– In general, there are 2n such formulas given by n statement
variable.
– If there are three variables P, Q R, then
• 23 = 8
• (P ∧ Q ∧ R), (P ∧ Q ∧ ˥R), (P ∧ ˥Q ∧ R), (P ∧ ˥Q ∧ ˥R), (˥P ∧ Q ∧
R), (˥P ∧ Q ∧ ˥R), (˥P ∧ ˥Q ∧R), (˥P ∧ ˥Q ∧ ˥R).
Min terms of P and Q
• No two minterms are equivalent. For example, PQ or QP is
included but not both.
• P˥P and Q˥Q are not allowed.
• Each minterm has the truth value T for exactly one
combination of the truth values of the variables P and Q.
PDNF - Definition
• For a given formula, an equivalent formula
consisting of disjunctions of minterms only is
known as its PDNF. Such a normal form is also
called the sum-of-products canonical (normal)
form.
• Example:
(PQ)  (˥PQ)  (˥P˥Q)
Method – 1
(Obtain PDNF with Truth table)
• Obtain the PDNF of the formulas: PQ, PQ,
and ˥(PQ) and the associated truth tables are
given below.
Solution
• Obtain a PDNF P Q using Truth Table:
P Q P Q Min Terms
T T T P∧Q
T F F
F T T ˥P∧Q
F F T ˥P ∧ ˥Q

• Finally; PQ  (PQ) (˥P  Q) (˥P  ˥Q)


• Similarly;
How to obtain PDNF without truth table?

1. Replacing  and  with equivalent formulas using only logical


operators (,,˥).
2. Applying negations to variables using De Morgan's laws.

3. Utilizing distributive laws to structure the formula.

4. Removing any contradictory elementary products.

5. Introducing missing factors to create min-terms in the


disjunctions.
6. Eliminating duplicate min-terms.
Method-2
(Obtain PDNF without Truth table)
• Given; P ((P  Q)  ˥(˥Q ˥P))
• Solution:
P ((P  Q)  ˥(˥Q  ˥P))
[Using P  Q ˥PQ and De Morgan’s law]
 P ((˥PQ)  (Q  P)) [Using P  Q ˥PQ ]
 ˥ P  ((˥PQ)  (Q  P))
 ˥ P  ((˥P  (Q  P))  Q  ((Q  P))
 ˥ P  (P  Q)  (P  Q)
 ˥ P  (P  Q) [Q is missing]
 (˥ P  (Q  ˥ Q))  (P  Q)
Finally P ((P  Q)  ˥(˥Q ˥P))  (˥ P  Q)  (˥ P  ˥ Q)  (P  Q)
Example -1
• Obtain the PDNF of ˥PQ without truth table
• Solution:
˥PQ  (˥P(Q  ˥ Q))  (Q(P  ˥ P))
[using P  ˥ P T and P T P]
 (˥PQ)  (˥P Q)  (QP)  (Q  ˥ P)
[using Distributive law ]
 (˥PQ)  (˥P Q)  (PQ)  (˥ P Q)
[using Commutative law P  P  P]
Finally;
˥PQ  (˥PQ)  (˥P Q)  (PQ)
Example-2
• Obtain the PDNF of (PQ)  (˥PR)  (QR) without using truth
table.
• Solution:
 (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)  (PQR)  (˥ P  Q 
R)
Finally;
(PQ)  (˥PR)  (QR)  (PQ R)  (PQ ˥ R))  (˥PQR) 
(˥P˥QR)
Example - 3
• Show that the following are equivalent formulas.

• Solution: We write the PDNF of each formula &


compare these normal forms.
PCNF
Principal Conjunctive Normal Form (PCNF)
or Product-of-sums canonical (normal)
form
• Maxterm (sum term or boolean disjunction):
– If there are two statement variables, P and Q, then
maxterm will contain (22) 4 possible formulas that have
disjunctions () of P and Q or its negation will be:
• P  Q, P  ˥Q, ˥P  Q, ˥P  ˥Q
– In general, there are 2n such formulas given by n statement
variable.
– If there are three variables P, Q R, then
• 23 = 8
• (P  Q  R), (P  Q  ˥R), (P  ˥Q  R), (P  ˥Q  ˥R), (˥P  Q  R), (˥P  Q
 ˥R), (˥P  ˥Q  R), (˥P  ˥Q  ˥R).
Maxterms of P and Q
Minterms Maxterms

P Q PQ P  ˥Q ˥P  Q ˥P  ˥Q ˥P  ˥Q ˥P  Q P˥Q PQ

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

Minterm should evaluate ‘T’ for each combination of P and Q, whereas the
maxterm is the complement of the minterm. i.e., evaluate ‘F’ for each
combination of P and Q.
Minterms: PQ, P˥Q, ˥PQ, ˥P˥Q
Maxterms: ˥P  ˥Q, ˥P  Q, P  ˥ Q, P  Q
Minterms and Maxterms of P and Q

P Q Minterms Maxterms

F F m0 = P  Q M0 =˥P  ˥Q
F T m1 = P  ˥Q M1 =˥P  Q
T F m2 = ˥P  Q M2 = P  ˥ Q
T T m3 =˥P  ˥Q M3 = P  Q
PCNF - Definition
• For a given formula, an equivalent formula consisting
of conjunctions of the maxterms only is known as its
PCNF. This normal form is called the product-of-sums
canonical (normal) form.
• Example:
(P  Q)  (˥P  Q)  (˥P  ˥Q)
i. PCNF from PDNF
ii. PDNF from PCNF
Example -1
(Find PCNF from PDNF )
• Find PCNF from PDNF with the formula S  (PQ)(˥PQ)
• Solution:
i. Write ˥S i.e., disjunction of the remaining (missing)
minterms:
• The minterms of P and Q are PQ, P˥Q, ˥PQ, ˥P˥Q.
• Given terms: PQ, ˥PQ
• Remaining (missing) terms: (P˥Q), (˥P˥Q)
• ˥S  (P˥Q)  (˥P˥Q)
ii. Apply duality principle to find ˥(˥S) :
• ˥ (˥S)  ˥ [ (P˥Q)  (˥P˥Q) ]
• Finally, S  [ (˥ P  Q)  (P  Q) ] is the PCNF.
Example-2
(Find PCNF from PDNF )
• Find PDNF from the PCNF with the given formula
S(PQ)(˥PQ)
• Solution:
i. Write ˥S i.e., conjunction of the remaining maxterms.
• The maxterms of P and Q are PQ, P  ˥Q, ˥P  Q, ˥P  ˥Q.
• Given: P  Q, ˥P  Q
• Remaining term: (P  ˥Q), (˥P  ˥Q)
• ˥S  (P  ˥Q)  (˥P  ˥Q)
ii. Apply duality principle to find ˥(˥S) :
• ˥ (˥S)  ˥ [(P  ˥Q)  (˥P  ˥Q) ]
• Finally, S  [ (˥ P  Q)  (P  Q) ] is the PDNF.
Example-3
a) Obtain PCNF with the given formula
S  (PQ)  (˥PQ)  (˥ P˥Q)  (P˥ Q)
b) Obtain PDNF with the given formula
S  (P  Q)  (˥P  Q)  (˥ P  ˥Q)  (P  ˥ Q)
• Solution:
a) ˥S  There is no remaining minterms.
PCNF  No PCNF for the given formula.
b) ˥S  There is no remaining maxterms.
PCNF  No PDNF for the given formula.
Method-1
with truth table
Method - 1
(With truth table)
• Obtain the PDNF of PQ. Also find PCNF.
• Solution:
• Let S  PQ  ˥PQ
P Q ˥P S  ˥PQ Minterm Maxterm
T T F T PQ --
T F F F -- ˥PQ
F T T T ˥PQ --
F F T T ˥P˥Q --

• PDNF(Disjunctions of minterms) S  (PQ)(˥PQ)(˥P˥Q)


• PCNF (Conjunction of maxterms) S  ˥PQ
Method-2
without truth table
Method-2
(without truth table)
• Let S  ˥PQ
 (˥PT)  (QT); [Using Q ˥Q T, P ˥P T and
PT  P, ˥QT Q]
 (˥P(Q ˥Q))  (Q(P ˥P));
 (˥PQ) (˥P˥Q)  (QP)  (Q˥P); [distributive law]
 (˥PQ) (˥P˥Q)  (QP); [˥PQ  QP]
 (˥PQ) (˥P˥Q)  (PQ); [PQ  QP]
Finally PDNF; S  (˥PQ) (˥P˥Q)  (PQ)
• The minterms of P and Q are PQ, ˥PQ, P˥Q, ˥P˥Q
• ˥S is nothing but the remaining minterms.
• ˥S  P˥Q
• ˥ (˥ S)  ˥PQ [Apply duality principle]
• PCNF is S  ˥PQ
Example-4
(with truth table)
Use truth table to obtain the PDNF of PQ. Also find PCNF.
• Solution:
• Let S  PQ
P Q S  PQ Minterm Maxterm
T T T PQ --
T F F -- ˥P  Q
F T F -- P ˥Q
F F T ˥P˥Q --

• PDNF by using minterms: S  (PQ)(˥P˥Q)


• PCNF by using maxterms: S  (˥P  Q)  (P  ˥Q)
Example-4
(without truth table)
• Without using truth table obtain the PDNF of PQ.
Also find PCNF
• Let S  PQ
 (PQ)  (QP)
 (˥P  Q)  (˥QP)
 (˥P  Q)  (P˥Q)
Exercises
1. Obtain the principal conjunctive normal form of the formula S given by
(˥P R)  (Q ↔P)
2. Obtain PCNF of the formula:
P →(( P → Q) ∧ ˥(˥ Q ∨ P))​
3. Find the PDNF and the given PCNF of
S: P ∨ (˥P (Q ∨(˥ Q R)))
4. Find PDNF from PCNF of
S:P ∨(˥P (Q ∨(˥ Q R)))
5. The truth table for a formula A is given below, find its disjunctive &
conjunctive normal forms.
Ordering and Uniqueness of
Normal Forms
Need?
• If number of variables (n) increases in the
given formula, then writing minterms
(maxterms) will become a tedious and difficult
task.
Ordering and Uniqueness of Normal Forms
• Given any ‘n’ statement variables , let us first arrange them in
some fixed order. If capital letters are used to denote the
variables, then they may be arranged in alphabetical order. If
subscripted letters are also used
A, B, …….,Z, A1,A2,…….Z1, A2,B2,…Z2
• Example if the variables are P1,Q,R3,S1,T2 and Q3,then they
may be arranged as
Q,P1,S1,T2,Q3,R3
• Once the variables have been arranged in a particular order, it
is possible to designate them as the first variable ,second
variable third variable and so on.
Steps to write minterms with subscript
• Let us assume that ‘n’ variables are given and are arranged in a
particular order.
• Then : 2 n minterms corresponding to the ‘n’
variables.
• Here number of digits in subscript = n.
1. Write subscript of any particular minterm in binary and add an
appropriate number of zeros on the left so that the no.of digits
in the subscript is exactly ‘n’. For example if the statement
variables involved in a formula are P,Q,R then m2 = m010.
2. The first bit indicates the first variable (P) then the second bit for
the second variable (Q) of the given formula and so on.
3. In a binary representation, if 0 appears then negation of the
variable appears otherwise non-negation variable appears in
conjunction forming minterms. For ex, m2 = m010 = ˥P  Q  ˥R.
Truth table
m P Q R Min terms
m0 0 0 0 (˥P ∧ ˥Q ∧ ˥R)
m1 0 0 1 (˥P ∧ ˥Q ∧R)
m2 0 1 0 (P ∧ ˥Q ∧ R)
m3 0 1 1 (˥P ∧ Q ∧ R)
m4 1 0 0 (P ∧ ˥Q ∧ ˥R)
m5 1 0 1 (P ∧ ˥Q ∧ R)
m6 1 1 0 (P ∧ Q ∧ ˥R)
m7 1 1 1 (P ∧ Q ∧ R)
Example
• Let P,Q,R be the variables and the associated
minterms are m0,m1,…..,m7. Then we can write
– Minterm m0: subscript 0 in binary as 000, then m0 is ˥P˥Q
˥R.
– Minterm m5: subscript 5 in binary as 101, then m5 is P˥Q
R.
– Minterm m3: write 11 and append a zero (0) on the left to
get 011, and m3 is ˥PQ R.
• If we have six variables P1, P2,…. P6,then there are
26 = 64 minterms denoted by m0,m1,…., m63.
– Minterms m38 :
• write 38 in binary as 100110,
SOP (Principal disjunctive normal) forms
• Designate the disjunction (sum) of minterms by the
compact notation .
• Use this, the SOP canonical form representing the
disjunction of mi, mj,and mk can be written as i,j,k.
• Example: Obtain PDNF of (PQ) (˥PQ)  (QR)
Û (PQ(R  ˥ R))  (˥PQ(R  ˥ R))  (QR(P  ˥ P))
Û (PQR)  (PQ ˥ R))  (˥PQR)  (˥PQ ˥R)  (PQR)
(˥PQR)
Û 111, 110, 011, 010, 111, 011
Û 7,6,3,1
Û  1,3,6,7
Maxterms
M P Q R Maxterms
M0 0 0 0 (˥P ∧ ˥Q ∧ ˥R)
M1 0 0 1 (˥P ∧ ˥Q ∧R)
M2 0 1 0 (P ∧ ˥Q ∧ R)
M3 0 1 1 (˥P ∧ Q ∧ R)
M4 1 0 0 (P ∧ ˥Q ∧ ˥R)
M5 1 0 1 (P ∧ ˥Q ∧ R)
M6 1 1 0 (P ∧ Q ∧ ˥R)
M7 1 1 1 (P ∧ Q ∧ R)
POS (Principal conjunctive normal) forms
• Obtain PCNF of (PQ) (˥PR).
 ((P  Q)  ˥ P)  ((P  Q)  R)
 (P  ˥ P)  (Q  ˥ P)  (P  R)  (Q R)
 (Q  ˥ P (R  ˥ R))  (P  R  (Q  ˥ Q))  (Q R  (P  ˥ P))
 (Q  ˥ P R)  (Q  ˥ P ˥ 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)  (PQR)  (˥ PQR)
Û 100,101,000,010
Û  4,5,0,2
Û  0,2,4,5
For PDNF consider the missing terms i.e., 1,3,6,7. Thus, PDNF is 1,3,6,7
Exercises
Theory of Inference for Statement Calculus
Theory of Inference for Statement Calculus
• Main function of logic: To provide rules of inference
or principles of reasoning.
• Rules of inference: Criteria for finding validity of an
argument and are stated in terms of statements
(premises and conclusion).
• Inference theory: The theory associated with such
rules and it is concerned with the inferring of a
conclusion from certain premises.
• Deduction or formal proof: A process of deriving
conclusion from a set of premises by using the
accepted rules of reasoning.
• Argument: A sequence of statements. The last
statement is the conclusion and all its
preceding statements are called premises.
• Let Premises be p1,p2,…pn and q as a
conclusion, then an argument is denoted by
p1,p2,p3,……..,pn  q
– Premises(assumptions/axioms/hypotheses) - Given set of
propositions.
– Conclusion(consequence): Proposition derived from premises.
• Any conclusion which is arrived by following
the rules is called a valid conclusion and the
argument is called a valid argument.
Validity using Truth Tables
• An argument is valid if the conclusion is true
(‘T’) whenever all the premises are true (‘T’).
• To test the validity of an argument using a
truth table, you can check
– if the critical rows, or rows where all premises are
true, correspond to the value "true" for the
conclusion.(Valid)
– If the truth table has a row where the conclusion
column is false while every premise column is true,
then the argument is invalid.
• When A and B are two statement formulas
then “B is said to logically follow A”, or “B is a
valid conclusion of the premise A”, if AB is
tautology that is, A  B
• Extending, a conclusion C is said to follow
from a set of premises H1,H2,……, Hn if
H1∧H2∧……… ∧Hn  C
• If a set premises(H1,H2,……, Hn ) and a
conclusion(C) are given, it is possible to
determine whether the conclusion follows
from the premises by constructing relevant
truth tables as in the following problems.
Example
• Determine whether the conclusion C follows
logically from the premises H1 and H2.
Solution
• Construct the truth table as follows;
Solution
(Contd…..)
a) H1:(P  Q); H2:P; C:Q
1st row is the only row in which both the
premises H1 and H2 have the value T. The
conclusion (Q) also has the value T in that
row. Hence it is valid.
Solution
(Contd…..)
b) H1: (P  Q); H2 : ˥P; C:Q
H1 and H2 are ‘T’ in the 1st and 3rd row, but C is
not true in 4th row. Hence it is not valid
conclusion.
Solution
(Contd…..)
c) H1:(PQ); H2 :˥(PQ); C: ˥P
H1 and H2 are ‘T’ in the 3rd and 4th row , in
which case C is also true. Hence it is valid.
Solution
(Contd…..)
c) H1:(PQ); H2 :˥(PQ); C: ˥P
H1 and H2 are ‘T’ in the 3rd and 4th row , in
which case C is also true. Hence it is valid.
Solution
(Contd…..)
d) H1: ˥P; H2:(P Q); C: ˥(PQ)
H1 and H2 are true in fourth row , in which
case C is also true. Hence it is valid.
Solution
(Contd…..)
e) H1:(P  Q); H2 :Q; C:P
H1 and H2 are ’T’ in the 1st and 3rd row, but C is
not true in the third row. Hence it is invalid.
Exercises
1. Test the validity of the following argument:
H1: If Canada is a country, then New York is a city.
H2: New York is a city.
C: Canada is a country.
Hint: H1: PQ; H2: Q; C:P
2. Test the validity of the following argument:
“If it rains then it will be cold. If it is cold then I shall stay at home.
Since it rains therefore I shall stay at home”.
Hint: P: it rains.
Q: it will be cold
R: I shall stay at home
The given argument in symbolic form can be written as
[(P  Q)  (Q  R)  P]  R
Exercises

You might also like