0% found this document useful (0 votes)
226 views105 pages

Unit - I Discrete Mathematics: Dr. Krishna Keerthi Chennam

Uploaded by

Parinita Marella
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)
226 views105 pages

Unit - I Discrete Mathematics: Dr. Krishna Keerthi Chennam

Uploaded by

Parinita Marella
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/ 105

Unit – I

Discrete Mathematics

Dr. Krishna Keerthi Chennam


Normal Forms
• If a given statement formula A(p1, p2, ...pn) involves n atomic
variables, we have 2*n possible combinations of truth values of
statements replacing the variables.
• The formula A is a tautology  if A has the truth value T for all
possible assignments of the truth values to the variables p1,
p2, ...pn  and 
• A is called a contradiction if A has the truth value F for all possible
assignments of the truth values of the n variables.
•  A is said to be satisfiable if A has the truth value T for atleast one
combination of truth values assigned to p1, p2,...pn.
• The problem of determining whether a given statement formula is a
Tautology, or a Contradiction or at least satisfiable is called a
decision problem.
• The construction of truth table involves a finite number of steps,
but the construction may not be practical. We therefore reduce the
given statement formula to normal form and find whether a given
statement formula is a Tautology or Contradiction or atleast
satisfiable.
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)
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. Similarly, a sum of the variables and their
negations in a formula is called an elementary sum.
Let P and Q be any atomic variables. Then P , ¬P ∧Q, ¬Q∧P∧ ¬P , P ∧ ¬P , and Q ∧
¬P are some examples of elementary products. 
On the other hand, P , ¬P ∨ Q, ¬Q ∨ P ∨ ¬P , P∨ ¬P , and Q ∨ ¬P are some examples of
elementary sums.
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. Thus ¬Q,P∧ ¬P , and ¬Q ∧ P are some of the factors of
¬Q ∧ P ∧ ¬P .

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.

Example: (p Ù q) Ú (p Ù Ø q) Ú (Ø p Ù q) Ú (Ø p Ù Ø q)
Example 1: Obtain disjunctive normal forms of
(a) P ∧ (P → Q); (b) ¬(P ∨ Q) ↔ (P ∧ Q).
Solution: (a) We have
P ∧ (P → Q) ⇔ P ∧ (¬P ∨ Q)
⇔ (P ∧ ¬P ) ∨ (P ∧ Q)
(b) ¬(P ∨ Q) ↔(P ∧ Q)
⇔ (¬(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 ) ∨ ((P ∨ Q) ∧ ¬Q)
⇔ (¬P ∧ ¬Q ∧ P ∧ Q) ∨ (P ∧ ¬P ) ∨ (Q ∧ ¬P ) ∨ (P ∧ ¬Q) ∨ (Q ∧ ¬Q) which
is the required disjunctive normal form.
Note: The DNF of a given formula is not unique.
Example-6: Obtain the Disjunctive Normal Form of
(p ® q) ® (Ø r Ù q )
Let us consider (p ® q) ® (Ø r Ù q ) [ by p ®q ó Ø p Ú q]
ó (Ø p Ú q) ® (Ø r Ù q )
ó Ø(Ø p Ú q) Ú (Ø r Ù q )
ó (p Ù Ø q) Ú (Ø r Ù q)
Now it is the required DNF
Conjunctive Normal Form (CNF)
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.
The method for obtaining conjunctive normal form of a given
formula is similar to the one given for disjunctive normal form.
Again, the conjunctive normal form is not unique.
Example-7: Obtain the Conjunctive Normal Form of
Ø ((Ø p ® Ø q )Ù Ø r )
From the truth tables of these minterms of P and
Q, it is clear that

1. no two minterms are equivalent


2. Each minterm has the truth value T for exactly one combination of the
truth values of the variables P and Q.
Methods to obtain PDNF of a given formula
I. By Truth table:
1. Construct a truth table of the given formula.
2. 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.
3. The disjunction of these minterms will then be equivalent to the given
formula.

II. Without constructing the truth table:


In order to obtain the principal disjunctive normal form of a given
formula is constructed as follows:

1.First replace →, by their equivalent formula containing only ∧, ∨ and ¬.


2. Next, negations are applied to the variables by De Morgan‘s laws
followed by the application of distributive laws.
3. 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 conjunctive normal form of the
formula (¬P→R)∧(Q↔P) Solution:
(¬P → R) ∧ (Q ↔ P )
⇔ [¬(¬P ) ∨ R] ∧ [(Q → P ) ∧ (P → Q)]
⇔ (P ∨ R) ∧ [(¬Q ∨ P ) ∧ (¬P ∨ Q)]
⇔ (P ∨ R ∨ F ) ∧ [(¬Q ∨ P ∨ F ) ∧ (¬P ∨ Q ∨ F )]
⇔ [(P ∨ R) ∨ (Q ∧ ¬Q)] ∧ [¬Q ∨ P ) ∨ (R ∧ ¬R)] ∧ [(¬P ∨ Q) ∨ (R ∧ ¬R)]
⇔ (P ∨ R ∨ Q) ∧ (P ∨ R ∨ ¬Q) ∧ (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) which is
required principal conjunctive normal form.

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)
Exercise 5​
Without using our rules of logic, we can determine its truth value one of
two ways.
1.Surmising the fallacy of each premise, knowing that the conclusion is
valid only when all the beliefs are valid.
2.Construct a truth table and verify a tautology.

From the above example,


if we know that both premises “If Marcus is a poet, then he is poor” and
“Marcus is a poet” are both true, then the conclusion “Marcus is poor”
must also be true.
And using a truth table validates our claim as well.
Thus, the given set of premises leads to a contradiction and hence it is
inconsistent.
Exercise 6
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 predicates in any statement is  called
“Predicate Calculus”.
• Let us consider
 the statement : “ x is a student”  This statement has two
parts.
i. First part : “x” is called the
subject/object/variable of
the statement.
ii. Second part : “ is a student” is called
the predicate.
• Predicate refers to a property that the subject of the
statement
can
have.
• We can denote the statement “ x is a student” by S(x), where S  denotes the
predicate “is a student” and x is the variable. S(x) is  called the propositional
• Suppose we can take the statement “p is Q” where
“is Q” is a predicate
p is the subject/object
The above statement can be denoted by Q(p).
• A simple statement function of one variable is defined to be an
expression consisting of a predicate symbol and an individual
variable.
• Example: H(x): x is a man
M(y): y is mortal
• A compound statement function is obtained by combining one
or more simple statement functions and logical connectives.
• Example: H(x) M(y), H(x)  M(y), H(x)  M(y),
• Let us consider the compound statement :
“ Amulya is a student and this painting is blue”
where “ is a student” is the predicate.
“Amulya” is the subject/object
“is blue” is the predicate”
“this painting” is the
subject/object.
The above compound statement can be denoted by
S(a)  B(p)
• The other connectives can also be used to form the
compound
statements such as
S(a)  B(p),
B(p),
S(a)  B(p) etc…
• Let us consider the compound statement :
“ Naveen is taller than Amul” where
“ is taller than” is the predicate.
“Naveen” is the subject/object
“Amul” is the subject/object
The above compound
statement can be denoted by
T( n, a)
• 1-place predicate means the
predicate belongs to one object.
Example: Amulya is a student
where the predicate “is a student” belongs to one object
called Amulya
• 2-place predicate means the predicate belongs to two
objects.
Example: Naveen is taller than Amul
• m-place predicate means the predicate belongs to m objects
Quantifiers:
Certain statements containing the words such as “all”,
“every”, “some” , “there exists”, “none” , “there is at least”
are associated with the idea of quantity. Such word are called
Quantifiers.
Consider the following examples:
1. some men are tall.
2. All birds have wings
3. No air balloon is perfectly round
4. There is a real number less than 11.
Universal Quantifier:
i.The quantifier “all”, “every”, “each” and “every thing”
is called the Universal Quantifier.
ii. we denote it by the symbol ∀
iii. Universal quantifier(∀) represents each of the
following
phrases, all phrases have the same meaning.
for all x
for every x
for each x
every
thing x is
such that
each thing
x is such
that
Existential Quantifier:
i. The quantifier
“some”, “there
exist” and
“there is
atleast” is
PREDICATE FORMULA
• Suppose we are taking n-place predicate, n-place predicate
symbol must me followed by n object variables. Such
variables are called objects or individual variables and are
denoted by lowercase letters.
• Example: P(x1,x2,x3,.......,xn) denotes an n-place predicate
formula in which the letter P is an n-place predicate and
x1,x2,x3,.......,xn are individual variables.
• P(x1,x2,x3,......., xn) will be called atomic formula of predicate
calculus.
• Examples of atomic formula of predicate calculus are
Q(x), P(x, y), A(x,y,z), P(a,y) and A(x,a,z)
• A well-formed formula of predicate calculus is obtained
by using the following rules.
1. An atomic formula is a well-formed formula.
2.if A is a well-formed formula, then A is a well-formed
formula
3. if A and B are well-formed formulas, then (A  B),
(A 
B) ,(A  B) and (A  B) are also well-formed formulas.
4. if A is a well-formed formula and x is any variable,
then
(∀x)A and (∃x)A are well-formed formulas.
5. Only those formulas obtained by using rules 1 to
4 are
well-formed formulas.
FREE AND BOUND VARIABLES
• 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 a formula is called a
bound occurrence of x.
• Free Variable:
An occurrence of a variable x that is not bounded by any
quantifier such as (∀x)P(x) or (∃x) P(x) is called a “Free
variable”.
• Bounded Variable:
An occurrence of a variable x that is bounded by a
quantifier such as (∀x)P (x) or (∃x) P(x) is called a “Bounded
variable”
• Scope of the quantifier:
The scope of a quantifier is the predicate formula
immediately
following the quantifier.
(OR)
The part of the logical expression or
S.NO predicate formula
PREDICATE BOUND FREE SCOPE OF THE
FORMULA VARIABLE VARIABLE QUANTIFIER
1 to
(∀x)P(x ,y ) x y P(x,y)
which a quantifier is applied is called the “scope of
2 (∀x)(I(x) R(x)) x I(x) R(x)
the quantifier”.
3 (∀x)((P(x) E (y)Q (x , y)) x P(x) E(y)Q (x , y)

4 (∀x)(P(x)  Q(x))  (∀y)R(y) x P(x)  Q(x)

y R(y)

5 ∃x R(x)  P(x) First x Second x R(x)


Example: For the universe of all integers,
let  p(x): x>0,
q(x): x is even
r(x): x is a 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:  1. At least one integer is even: (∃x) q(x)
ii) There exist a positive integer that is even: (∃x) (p(x)  q(x))
3.Some even integers are divisible by 3: (∃x) (q(x) 
s(x))  
4. Every integer is either even or odd: (∀x)(q(x)   q(x))
v) If x is even and a perfect square, then x is not divisible
by 3:
(∀x)[(q(x)  r(x))   s(x)]
• Example-2: Now consider the following Statements. Represent
them in symbolic form.
i. All monkeys have tails
ii. No monkey has a tail.
iii. Some monkeys have tails
iv. Some monkeys have no tails.
Sol: let us consider M(x): x is a monkey
T(x): x has a tail
i. All monkeys have tails: (∀x)[M(x)  T(x)]
ii. No monkey has a tail: (∀x)[M(x)   T(x)]
iii. Some monkeys have tails: (∃x) [M(x)  T(x))
iv. Some monkeys have no tails: (∃x) [M(x)   T(x))
• Example-3: Write the following sentences in symbolic
form.
i. Some people who trust others one rewarded.
ii. If any one is good then john is good.
iii. Some one is teasing
iv.It is not true that all roads lead to
Rome. 
 Sol: Let us consider
P(x): x is a person
T(x): x trusts
others  R(x): x
is rewarded. 
G(x): x is good
Q(x): x is
teasing
ii. If any one is good then john is
good.  (∃x) [ P(x)  G(x)] 
G(john)
iii. Some one is teasing
(∃x) [ P(x)  Q(x)]
iv. It is not true that all roads lead to
Rome.
(∃x) [ S(x)   L(x)]
or (∀x)[S(x)  L(x)]

• Example-4: Write the following


sentences in symbolic form.
i. Every living thing is a plant or
Animal
ii. John’s gold fish is alive and it
is not a plant
H(x): x has heart
P(x): x is a plant
A(x): x is a animal
g : john’s gold
fish.
i. Every living thing is a plant or
Animal (∀x)[(P(x)  A(x)]
ii. John’s gold fish is alive and it is
not a plant
 P(g)
iii. All animals have hearts
(∀x)[A(x) H(x)]
iv. John’s gold fish has a heart
H(g)
• Example-5: Write the following sentences in symbolic form.
i. All integers are rational numbers
ii. Some integers are powers of 3
iii.Some rational numbers are powers of 3
Sol: Let us consider
I(x): x is an integer
R(x): x is rational number
P(x): x is power of 3
i. All integers are rational numbers.
(∀x)[I(x) R(x)]
ii. Some integers are powers of 3.
(∃x) [ I(x)  P(x)]
iii. Some rational numbers are powers of 3
(∃x) [ R(x)  P(x)]
• Example-6: Write the following sentences in symbolic form.
i. All men are mortal
ii. Socrates is a man
iii.Socrates is a mortal
Sol: Let us consider
H(x): x is a man
M(x): x is mortal
S:
Socrates
i. All men are mortal
(∀x)[H(x)
M(x)]
ii. Socrates is a man
H(s)
iii. Socrates is a mortal
Negation of a Quantified Statement
• To construct the negation of a quantified statement, change
the quantifier from Universal to Existential and Existential to
Universal, and replace the predicate statement by its negation.
• Example:
1.  (∃ x)(P(x)  (∀x)  (P(x)
2.  (∀x)(P(x)  (∃x)  (P(x)
3.  (∃ x)[(P(x)  Q(x)] ⇒ (∀ x)[( P(x) 
 Q(x)]
4. (∀x) (A(x)  B(x))  (∃ x) (A(x)  
B(x))
Theory of inference for Predicate
Calculus
• Certain additional rules are required to deal with the formula
involving quantifiers.
• The elimination of quantifiers can be done by using the rules
of specification called US and ES.
• Toprefix the correct quantifier, we need the rules of
generalization called UG and EG.
• Now the rules of generalization and specification
are
1. Rule US(Universal Specification)
2. Rule UG(Universal Generalization)
3. Rule ES(Existential
Specification)
4. Rule EG(Existential Generalization)
• Rule US:(Universal Specification)
If a statement of the form (∀x)(P(x)) is assumed to be true,
then the universal quantifier can be dropped to obtain P(t) is true
for an arbitrary object ‘t’ in the universe.
in symbols, this rule is : (∀x)(P(x))
Therefore P(t) for all t
• Rule UG:(Universal Generalization)
If a statement P(t) is true for each element t of the universe,
then the universal quantifier may be prefixed to obtain (∀x)
(P(x))
in symbols, this rule is : P(t) for all t
Therefore (∀x)(P(x))
• Rule ES:(Existential Specification)
If a statement of the form (∃x)(P(x)) is assumed to be true,
then there is an element t in the universesuch that P(t) is true.
in symbols, this rule is : (∃ x)(P(x))
Therefore
P(t) for some t
• Rule EG:(Existential Generalization)
If a statement P(t) is true for some element t in the universe,
then the Existential quantifier may be prefixed to obtain (∃x)
(P(x)) is true.
in symbols, this rule is : P(t) for some t
Therefore (∃ x)(P(x))
• Example-1: Verify the validity of the following argument..
Every living thing is a plant or Animal. John’s gold fish
is alive and it is not a plant. All animals have hearts.
Therefore
John’s gold fish has a heart
Sol: Let us consider
x is a living
thing H(x): x has
heart P(x): x is a
plant A(x): x is a
animal
g : john’s

gold fish.
Then the inference
[1] (1) (∀x)[(P(x)  ] Rule P
A(x)
[2] (2)  P(g) Rule P
[1] (3) P(g)  A(g) Rule US,(1)
[1,2] (4) A(g) Rule T, (2),(3) and I10
[5] (5) (∀x)[A(x) H(x)] Rule P
[5] (6) A(g) H(g)] Rule US,(5) 1
[1,2,5] (7) H(g) Rule T, (4),
(6) and I1
Hence the conclusion is valid
• Example-2: Verify the validity of the following argument.
All integers are rational numbers
Some integers are powers of 3
Therefore, Some rational numbers are powers of 3
Sol: Let us consider
I(x): x is an integer
R(x): x is rational
number P(x): x is power
of 3
Then the given
inference pattern is:
(∀x)[I(x) R(x)]
(∃x) [ I(x) 
P(x)]
Therefore(∃x) [ R(x) 
[1] (1) (∃x) [ I(x)  Rule P
P(x)] [1] (2) I(g)  P(g) Rule ES,(1)
[1] (3) I(g) Rule T,(2) and I1
[1] (4) P(g) Rule T, (2),I2
[5] (5) (∀x)[I(x) Rule P
R(x)] Rule US,(5)
[5] (6) I(g) Rule T, (3),(6)
R(g) and I11
[1,5] (7) (∃x) [ R(g)
R(x)  P(x)]Rule
RuleT,EG,
(4),(7)
[8] (8) (8)R(g)  P(g) and I9
[9] (9) the conclusion is valid
Hence
which is a contradiction.Hence, the statement is valid.
Statements Involving more than
one Quantifier
• If a predicate formula involves more than one different
variable, then more than one quantifier is needed to
produce the symbolic sentence.
• Example: Consider the statement: P(x , y)
• There are 8 possible combinations of (∀x), (∀y),(∃x),
(∃y) for the statement P(x , y)
i. (∀x) (∀y) P(x , y) ii. (∃x) (∃y) P(x , y)
iii. (∀x) (∃y) P(x , y) iv. (∀y) (∃x) P(x , y)
v. (∀y) (∀x) P(x , y) vi. (∃y) (∀x) P(x , y)
vii. (∃x) (∀y) P(x ,y) viii. (∃y) (∃x) P(x ,
y)

You might also like