DM Ma8351 U1
DM Ma8351 U1
DM Ma8351 U1
2
Please read this disclaimer before proceeding:
This document is confidential and intended solely for the educational purpose of
RMK Group of Educational Institutions. If you have received this document
through email in error, please notify the system manager. This document
contains proprietary information and is intended only to the respective group /
learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender
immediately by e-mail if you have received this document by mistake and delete
this document from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in reliance on
the contents of this information is strictly prohibited.
3
DISCRETE MATHEMATICS
(MA8351)
DEPARTMENT CSE/IT
BATCH/YEAR 2019-2023/II
DATE 29.07.20
4
Table of Contents
5
Course Objectives:
S.NO TOPIC
6
PREREQUISITES
7
MA8351 DISCRETE MATHEMATICS ENGINEERING LTPC30
UNIT II COMBINATORICS 12
Graphs and graph models – Graph terminology and special types of graphs – Matrix
representation of graphs and graph isomorphism – Connectivity – Euler and
Hamilton paths.
8
COURSE OUTCOMES
S.NO TOPIC
9
Course Outcome mapping with POs / PSOs
MA8351 - DISCRETE MATHEMATICS
POs
PO PO PO PO PO PO PO PO PO PO PO PO PSO PSO PSO
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3
COs
CO1 2 1 - - - - - - - - - - 2 - -
CO2 3 2 - - - - - - - - - - - -
CO3 3 3 2 - - - - - - - - - 3 - -
CO4 2 1 - 1 - - - - - - - - 2 - -
CO5 3 2 1 - - - - - - - - - 2 - -
CO5 3 3 2 1 - - - - - - - - 2 - -
10
UNIT I
LOGIC AND PROOFS
11
Lecture plan
Actual
S. Topics to No of Proposed Taxonomy Mode of
Lecture CO
No. be covered periods date level Delivery*
Date
Introduction
to
1 Propositional 1 22.06.20 22.06.20 CO1 K1 PPT
logic,
Connectives
Introduction
2 Tautology, 1 22.06.20 22.06.20 CO1 K1 PPT
Contradiction
Propositional
3 equivalences, 1 23.06.20 23.06.20 CO1 K1 PPT
Implications
PCNF and
4 1 23.06.20 23.06.20 CO1 K1 PPT
PDNF
Predicate
and
5 quantifiers, 1 24.06.20 24.06.20 CO1 K1 PPT
Nested
quantifiers
Rules of
inference,
6 1 24.06.20 24.06.20 CO1 K2 PPT
Statement
calculus
Rules of
inference-
7 1 25.06.20 25.06.20 CO1 K2 PPT
Predicate
calculus
8 Problems 1 25.06.20 25.06.20 CO1 K1 PPT
Introduction
9 1 26.06.20 26.06.20 CO1 K2 PPT
to Proofs
10 Problems 1 26.06.20 26.06.20 CO1 K1 PPT
12
ACTIVITY BASED LEARNING
Activity based learning helps students express and embrace their curiosity.
Once the students become curious, they tend to explore and learn by themselves.
To evoke curiosity in students, Practice quiz is designed .
13
Unit I - LOGIC AND PROOFS
INTRODUCTION
Logic is the discipline that deals with the methods of reasoning. One of the aims of
logic is to provide rules by which we can determine whether a particular reasoning
or argument is valid. Logical reasoning is used in many disciplines to establish valid
results. Rules of logic are used to provide proofs of theorems in mathematics, to
verify the correctness of computer programs and to draw conclusions from scientific
experiments.
1.1 PROPOSITIONS
A declarative sentence (or assertion) which is either true or false, but not both, is
called a proposition (or statement). Sentences which are exclamatory, interrogative
or imperative in nature are not propositions. Lower case letterssuch as p, q, r . . .
are used to denote propositions. For example, we consider the following sentences:
l. Chennai is the capital of Tamilnadu.
2. How beautiful is Rose?
3.2+2=4
4. What time is it?
5. x+y=z
In the given statements, (2) and (4) are obviously not propositions as they are not
declarative in nature. (l) and (3) are propositions, but (5) is not, since (1) is true,
(3) is true and (5) is neither true nor false as the values of x, y and z are not
assigned.
If a proposition is true, we say that the truth value of' that proposition is true,
denoted by T or 1. If a proposition is false, the truth value is said to be false,
denoted by F or 0.
14
Truth table:
A truth table is a table that displays the relationships between the truth
values of sub-propositions and that of compound proposition constructed
from them. The truth value of a compound proposition depends on those
of sub propositions and the way in which they are combined using
connectives.
1.2 CONNECTIVES
p q p q
Definition-Conjunction
When p and q are any two propositions, the proposition T T T
"p and q" denoted by p q and called the conjunction T F F
of p and q is defined as the compound proposition that
F T F
is true when both p and q are true and is false
F F F
otherwise.
Above table is the truth table for the conjunction of two propositions p and
q viz., "p and q”.
Definition-Disjunction
When p and q are any two propositions, the propositions
"p or q" denoted by p q and called the disjunction of p p q pq
and q is defined as the compound proposition that is false T T T
when both p and q are false and is true otherwise.
T F T
Above table is the truth table for the disjunction of two F T T
propositions p and q, viz., "p q". F F F
Definition-Negation
15
Conditional Statement: [If…........then]
Let p and q be any two statements. Then the statement p q is
called a conditional statement (read as if p then q). p q has a P q pq
truth value F if p has the truth value T and q has the truth value F. T T T
In all the remaining cases it has the truth value T.
T F F
Example:
F T T
p: Ram is a Computer Science student F F T
q: Ram study DS
pq: If Ram is a Computer Science student, then he will study DS.
The different situations where the conditional statements applied are listed below.
a) If p then q
b) p only if q
c) q whenever p
d) q is necessary for p
e) q follows from p
f) q when p
g) p is sufficient for q
h) p implies q
Definition: Converse, Contrapositive & Inverse Statements
If p q is a conditional statement, then
a. q p is called converse of pq
b. ¬q¬p is called contrapositive of p q
c. ¬p¬q is called inverse of pq
Example: Write are the contrapositive, the converse and the inverse of the implication
"The home team wins whenever it is raining".
Solution: Let p: It is raining q: The home team wins
p q : If it is raining then the home team wins.
Contra positive (¬q ¬p ) : If the home team does not win then it is not raining.
Converse (q p) : If the home team wins then it is raining.
Inverse (¬p¬q) : If it is not raining then the home team does not win.
16
BICONDITIONAL PROPOSITION
Example:
p↔q: You can take the flight if and only if you buy a ticket
Examples:
1. The automated reply can be sent when the file system is full.
R: Ram takes C ++
The Truth values of the given formula are all true for every possible
Truth value of p and q. Therefore, the Truth value of the given formula
is independent of their components.
18
Solution:
p q pq ⌐p q Ans
T T T T T
T F F F T
F T T T T
F F T T T
The Truth values of the given formula are all true for every possible Truth value
of p and q. Therefore, the Truth value of the given formula is independent of
their components.
19
1.3 TAUTOLOGY AND CONTRADICTION
A statement formula which is always true regardless of the truth values
of the variables in it is called a Tautology (or) universally valid formula.
If a given formula is a tautology then its truth values are all T whatever
be the truth values of components. Therefore the last column of the truth
table of the given formula has truth values T only.
Example :A ¬A is always a Tautology.
A statement formula which is false always for the truth values of the components
is called a contradiction.
Example: A ¬A is always a contradiction.
The last column of the truth table of the contradiction has only the truth value F
for all cases.
Well-formed formula
Fortunately, the syntax of propositional logic is easy to learn. It has only three
rules:
20
Problems:
1. Prove that (p q) (p q) is a tautology
Proof:
p q pq p q (p q)(p q)
T T T T T
T F F T T
F T F T T
F F F F T
Since the truth value of given formula are all, true, the given formula is tautology.
Since the truth value of given formula are all, true, the given formula is
tautology.
Since the truth value of given formula are all, FALSE the given formula is
contradiction.
21
4. Prove that (¬pq)(qp) is neither a tautology not a contradiction.
Proof:
p q (¬pq) qp (¬pq)(qp)
T T T T T
T F T T T
F T T F F
F F F T T
Since the last column is neither all false nor true therefore the given formula is
neither a tautology nor a contradiction.
Since all the truth values of given formula is all true then it is a tautology.
22
7. Prove that ¬ (p q) (¬p ¬q) is a tautology
Proof:
T F T T T
F T T T T
F F T T T
T F F T T
F T T T T
F F T T T
23
1.4 LOGICAL EQUIVALENCES / TAUTOLOGICAL EQUIVALENCES
24
3. Prove that p ↔ q (p q) (¬p ¬q)
Proof:
ii) ¬ (p q) ¬p ¬q
Proof: i) ¬ (p q) ¬p ¬q
p q ¬ (p q) ¬p ¬q
T T F F
T F F F
F T F F
F F T T
ii) ¬ (p q) ¬p ¬q
25
p q p q ¬(p q) ¬p ¬q
T T F F F
T F F T T
F T F T T
F F T T T
DUALITY LAW
The dual of a compound proposition that contains only the operators , and ~
is the proposition obtained by replacing each by , each by , each T by F
and each F by T, where T and F are special variables representing compound
propositions that are tautologies and contradictions respectively. The dual of a
proposition A is denoted by A*.
DUALITY THEOREM
If A(p1,p2,…pn )≡ B(p1,p2,…pn )where A and B are compound
propositions, then A*(p1,p2,…pn) ≡B*(p1,p2,…pn)
LAWS OF LOGIC
2 p (q r) (p q) r p (q r) (p q) r Associative laws
3 p ( q r) (p v) (p r) p (q r) (p r) (p r) Distributive laws
4 ¬ (p q) ¬p ¬q ¬ (p q) ¬p ¬q De Morgan’s laws
Absorption law
6 p (p q) p p (p q) p
Identity law
7 p F p p T p
Dominant law
8 p T T p F F
Complement law
9 p ¬p T p ¬p F
Double Negation
10 ¬(¬p) p law
26
Problems:
27
5. Show that a) ¬(p q) (¬p (¬p q)) (¬p q)
Proof:
a) ¬(p q) (¬p (¬p q)) ¬ (¬(p q)) (¬p (¬p q))
(T q) (q ¬p)
T (q ¬p)
¬p q
(1) Implies, (p q) (¬p (¬p q)) ¬p q, Applying duality, we get
6. Show that ((p q) (¬ (¬p (¬q ¬r))) (¬p ¬q) (¬p ¬r) is
tautology.
¬p ¬ (q r)
(p q) (p (q r))
(p q) (p q) (p r)
(p q) (p r)
(p (q r) ---------------- (2)
p (q r) ¬ (p (q r))
T
28
7. Show that p(qp) ¬ p(pq) by truth table method.
29
Equivalences Involving Conditional
1. p q ≡¬p q
2. p q≡¬q¬p
3. p q ≡¬pq
4. p q ≡¬(p¬q)
5. ¬(pq)≡p ¬q
6. (pq) (p r) ≡p(q r)
7. (pq) (p r) ≡(p q)r
8. (pq) (p r) ≡p(q r)
9. (pr) (q r) ≡(p q)r
Implications
1. p q => 𝑝
2. p q => 𝑞
3. p => p q
4. ¬p => 𝑝 q
5. 𝑞 => 𝑝 q
6. ¬ (p q )=>p
7. ¬ (p q )=>¬q
8. p (p q) => 𝑞
9. ¬ q ( p q) => ¬p
10. ¬ p ( p q) => 𝑞
11. (p q) (p r) => 𝑝 r
12. (p q) (p r) (q r ) => 𝑟
Problems
1. Prove that (p q) => (p q)
Proof:To Prove: (p q) (p q) is a tautology.
p q p q p q (p q)(p q)
T T T T T
T F F T T
F T F T T
F F F F T
30
The last column shows that (p q) (p q) is a tautology.
Therefore, (p q) =>(p q)
p q p q pq (p q)(pq)
T T T T T
T F F F T
F T F T T
F F F T T
31
4. Prove that p (q r) => (pq) (pr)
Proof:Let the formula S: p (q r) ((p q) (p r))
To Prove: S is a tautology.
The truth values of (p (q r)) ((p q) (p r)) are all T
32
1.6 NORMAL FORMS:
It will be suitable to use the word product in the place of conjunction and sum in the
place of disjunction.
33
Problems
1. Find PDNF and PCNF of the following compound proposition using truth
table and Laws of proposition: (p q ) (p q ).
Solution: Using Truth Table: Let A= (p q ) (p q ).
p q p q p q p q A Min Max
terms terms
T T F F F F T p q -
T F F T T T T p q -
F T T F T T T p q -
F F T T T F F - p q
PCNF of A is ( A) ( p q ) (p q).
35
5. Without constructing the truth table obtain the product-of-sums canonical form of
the formula (P R ) (Q P ). Hence find the sum-of products canonical form.
Solution: Let
S (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 ) (Q P R ) (Q P R )
( P Q R ) ( P Q R )
PCNF of
S (P Q R ) (P Q R ) (P Q R ) (P Q R ) (P Q R )
PCNF of S (P Q R ) (P Q R ) (P Q R )
PDNF of S (PCNF of S ) (P Q R ) (P Q R ) (P Q R ) .
36
1.7 RULES OF INFERENCE (OR)THEORY OF INFERENCE
.
View the video lecture on YouTube: https://www.youtube.com/watch?v=lh-
iZDxmXPg&list=PLJvIzs_rP6R7v-k_4htOEA8WmqmZzVK4z&index=6
Introduction
Proofs in mathematics are valid arguments that establish the truth of mathematical
statements. By an argument, we mean a sequence of statements that end with a conclusion.
By valid, we mean that the conclusion, or final statement of the argument, must follow from the
truth of the preceding statements, or premises, of the argument. Rules of inference are our
basic tools for establishing the truth of statements.
Here, we will show how rules of inference for propositions and for quantified statements
can be combined. These combinations of rule of inference are often used together in complicated
arguments.
Definition:
An argumentin propositional logic is a sequence of propositions. All but the final
proposition in the argument are called premisesand the final proposition is called the
conclusion. An argument is validif the truth of all its premises implies that the conclusion is
true.
Table 1:
37
p q
5. Addition p ,q pq
p q p q
pq pq p
6. Simplification pq
p q
q
p
7. Conjunction q p ,q pq
p q
pq
8. Resolution p r p q, p r qr
q r
1) State which rule of inference is the basis of the following argument. “It is below freezing
now. Therefore, it is either below freezing or raining now”.
Solution:
Let p be the proposition ‘It is below freezing now’ and q be the proposition ‘It is
raining now’. Then the argument is of the form
p
i.e., Addition rule.
p q
2) State which rule of inference is the basis of the following argument. “It is below freezing and
raining now. Therefore, it is below freezing now”.
Solution:
Let p be the proposition ‘It is below freezing now’ and q be the proposition ‘It is
raining now’. Then the argument is of the form
pq
i.e., Simplification rule.
p
38
3)State which rule of inference is used in the argument: If it rains today, then we will
not have a barbecue today. If we do not have a barbecue today, then we will have a
barbecue tomorrow.Therefore, if it rains today, then we will have a barbecue
tomorrow.
Solution: Let p: It is raining today;
q: We will not have a barbecue today and
r : We will have abarbecue tomorrow.” Then thisargument is of the form
p q
q r
p r
Hence, this argument is a hypothetical syllogism.
When a conclusion is derived from a set of premises by using the accepted rules
of reasoning, then such a process of derivation is called a direct proof.
39
3. Show that S R is tautologically implied by P Q P R Q S .
(or)
Prove that P Q P R Q S S R.
Solution:
Premises: P Q , P R , Q S .
Conclusion: S R
1 PQ Rule P
2 P Q Rule T: P Q P Q
3 QS Rule P
5 P R Rule P
8 RS Rule T: R S R S
S R is a valid conclusion.
1 P M Rule P
2 M Rule P
40
4 PQ Rule P
R P Q is a valid conclusion.
1 P Q R S Rule P
4 Q M S N Rule P
7 P R Rule P
10 M N Rule P
41
12 N M Rule T: Commutative law {11}
13 N M Rule T: P Q P Q {11}
P is a valid conclusion.
6. Show that the following argument is valid. If today is Tuesday, I have a test in
Mathematics or Economics. If my Economics professor is sick, I will not have a test
in Economics. Today is Tuesday and my Economics professor is sick. Therefore I
have a test in Mathematics.
Solution: Let the proposition be
P: Today is Tuesday
q: I have a test in Mathematics
r: I have a test in Economics
r : I have not a test in Economics
s: My Economics professor is sick
Premises: p q r , s r, p s
Conclusion: q
4 p q r Rule P
6 s r Rule P
42
7. Show that the following hypotheses ‘It is not sunny this afternoon and it is colder
than yesterday’, ‘We will go swimming only if it is sunny’. If we do not go swimming,
then we will take a canoe trip’ and ‘if we take a canoe trip, then we will be home by
sunset’ lead to the conclusion ‘we will be home by sunset’.
Solution: Let the proposition be
P: It is sunny this afternoon
p : It is not sunny this afternoon
q: Iit is colder than yesterday
r: We will go swimming
r : We will not go swimming
s: We take a canoe trip
t: We will not take a canoe trip
Premises: p q, r p, r s and s t
Conclusion: t
Steps Premise Reason
1 p q Rule P
5 r s Rule P
7 s t Rule P
Working Rule:
Introduce Negation of desired conclusion as a new premise.
43
From the new premise together with the given premises derive a
contradiction.
Assert the desired conclusion as a logical inference from the premises.
1 PQ Rule P
2 Q R Rule P
3 P R Rule T: Hypothetical Syllogism {1,2}
4 R S Rule P
5 P S Rule T: Hypothetical Syllogism {3,4}
6 S R Rule P
8 PS Rule P
9 P Rule T: Simplification {8}
10 S Rule T: Simplification {8}
44
Solution:To prove inconsistency we have to derive a contradiction.
4 a b c Rule P
Rule T: Modus Ponens
5 bc {2,4 }
6 d b c Rule P
Rule T: Modus Ponens
7 b c {3,7 }
8 b Rule T: Simplification {7}
9 c Rule T: Simplification {7}
Rule T: Modus Ponens
10 c
{8,5}
c c Rule T: Conjunction
11
{9,10}
12 F Rule T: Negation law {11}
45
Steps Premise Reason
1 pq Rule P
2 qr Rule P
3 p r Rule T: Hypothetical Syllogism {1,2}
4 s r Rule P
5 r s Rule T: Contra-Positive {4}
6 p s Rule T: Hypothetical Syllogism {3,5}
7 ps Rule P
8 p Rule T: Simplification {7}
9 s Rule T: Simplification {7}
10 s Rule T: Modus Ponens {7,9}
11 s s Rule T: Conjunction {9,10}
12 F Rule T: Negation law {11}
1 ps Rule P
46
3 s Rule T: Simplification {1}
4 p q r Rule P
6 s r Rule P
9 q p Rule P
11 p Rule P
p s is a valid conclusion.
12 . Show that R S can be derived from the premises
P Q S , R P and Q.
2 R P Rule P
5 P Q S Rule P
47
7 Q Rule P
9 R S Rule CP
∴ 𝑅 → 𝑆 is a valid conclusion.
13.Show that the hypothesis ’ If you send me an e-mail message then I will finish
writing the program’, If you do not send me an e-mail message, then I will go to
sleep early’ and if I go to sleep early, then I will wake feeling refreshed’ lead to the
conclusion ‘if I do not finish writing the program, then I will wake feeling refreshed’.
Solution: Let the proposition be
P: you send me an e-mail message
p : you do not send e-mail message
q: I will finish writing the program
q : I will not finish writing the program
r: I will go to sleep early
s: I will wake up feeling refreshed
Premises: p q, p r, r s
Conclusion: q s
Additional premises: q
2 pq Rule P
4 p r Rule P
Rule T: Modus Ponens {3,4}
5 r
6 r s Rule P
Rule T: Modus Ponens {5,6}
7 s
8 q s Rule CP
q s is a valid conclusion.
48
14.Show that the following argument is valid. If Mohan is a lawyer then he is ambitious. If
Mohan is early riser then he does not like idlies. If Mohan is ambitious, then he is an
early riser. Then ‘if Mohan is a lawyer, then he does not likeidlies.
P: Mohan is a lawyer
q: Mohan is ambitious
Premises: p q, r s, q r
Conclusion: p s
Additional premises: p
2 pq Rule P
4 qr Rule P
6 r s Rule P
8 p s Rule CP
49
1.9 PREDICATES AND QUANTIFIERS
View the Video Lecture on YouTube:
https://www.youtube.com/watch?v=JpnsHllI7hE&list=PLJvIzs_rP6R7v-
k_4htOEA8WmqmZzVK4z&index=7
Introduction
In mathematics and computer programs, we encounter statements
involving variables such as " x >10", "x = y + 5" and "x + y = z". These
statements are neither true nor false, when the values of the variables are not
specified.
The statement " x is greater than 10" has 2 parts. The first part, the variables
x, is the subject of the statement. The second part “is greater than 10” which
refer to the property that the subject can have, is called predicate. We can
denote the statement “x is greater than 10” by the notationP(x) where P
denotes the predicate “is greater than 10” and x is a variable.
Predicate
A part of a declarative sentence that attributes a property to the subject.
In otherwords, A predicate is a sentence depending on variables which
becomes a statement upon substituting values in the domain.
Propositional function
The combination of a variable and a predicate is called propositional
function and it is denoted by P(x)
Once a value has been assigned to a variable x then P(x) becomes a
proposition and has a truth value.
Example 1. Let P(x) denote the statement " x >3 ". What are the truth values
of P(4) and P(2)
Solution P(x) : x >3
P(4) : 4 >3 which is true
P(2) : 2 >3 which is false
Example 2. Let Q(x, y) denote "x = y + 3" what are the truth values of the
proposition Q(1,2) and Q(3,0)
Solution Q(x, y) : x = y + 3
Q(1,2) : 1 = 2 + 3 ⟹1 = 5 which is false
Q(3,0) : 3 = 0 + 3 ⟹3 = 3 which is true
50
Example 3. Let R(x, y, z) denote "x + y = z" what are the truth values for the
proposition R 1,2,3 , R(0,1,1), R(−2, −1,4)
Solution R(x, y, z) : x + y = z
R(1, 2, 3) : 1+ 2 = 3 ⟹ 3 = 3 which is true
R(0,1, 1) : 0+ 1 = 1 ⟹ 1 = 1 which is true
R(−2, −1, 4) : −2 − 1 = 4⟹ − 3 = 4which is false
Note: The logic based on the analysis of predicates in any statement is called
predicate logic or predicate calculus.
Universe of discourse
The universe of discourse is a particular domain which specifies the possible
values of the variable x
Quantification
To create a proposition from a propositional function is called a quantification
There are two types namely (i) Universal quantification and (ii) Existential
quantification
51
The notation ∃xP(x) denote existential quantification of P(x). In English the
word some, few, there is, there exist atleast one are used in universal
quantification
Example1.Consider “all scents have pleasant fragrance”.
Solution: x S(x)
Let S(x) : x is a scent.
F(x) : x has pleasant fragrance.
∀x S x ⟶ F x .
Therefore the universe for this proposition is the set of all people.
Negation of a Quantified Expression
If P x is the statement “x has taken a course in Calculus”, Then ∀xP x
means that “every student in the class has taken a course in Calculus”. The
negation of this statement is “It is not the case that every students in the class
has taken a course in Calculus” or equivalently “There is a student in the class
who has not taken a course in Calculus” which is denoted by ∃x ~ P x . Thus
we see that ~∀xP x ≡ ∃x ~ P x
Similarly, ∃x P x means that “there is a student in the class who has
take a course in Calculus”. The negation of this statement is “Every student in
this class has not taken a course in Calculus” which is denoted by ∀x ~ P x .
Thus we get ~ ∃x P x ≡ ∀x~P x
52
Thus the negation of a Quantified Expression is
(i) ~∀xP x ≡ ∃x ~ P x and (ii) ~ ∃x P x ≡ ∀x~P x
Nested Quantifiers
Two quantifiers are nested if one is within the scope of the other such as ∀x ∃y x +
y =0
53
Problem 3.Translate the following into logical expression (symbolic form)
(i) Some student in this class has visited Mexico
(ii) Every student in this class has visited either Canada or Mexico
Solution
S x : x is a student in this class
M x : x has visited Mexico
C x : x has visited Canada
Symbolic form (i) ∃x S x ∧ M x
(ii) ∀x S x → C x ∨ M x
Free and Bounded Variables
54
1.10 INFERENCE THEORY OF PREDICATE CALCULUS
Derivations of formal proof in predicate calculus are done mostly in the same
way as in statement calculus, using implications and equivalences, provided that the
statement formulas are replaced by predicate formulas. Also the three basic rules P, T
and CP of Inference theory used in statement calculus can also be used in predicate
calculus. Moreover, the indirect method of proof can also be used in predicate
calculus.
Apart from the above rules of inference, we require certain additional rules to
deal with predicate formulas involving quantifiers. If it becomes necessary to eliminate
the quantifiers during the course of derivation, we require two rules of specification,
called US and ES rules. Once the quantifiers are eliminated, the derivation is similar to
that in statement calculus. If it becomes necessary to quantify the desired conclusion,
we requir two rules of generalisation, called UG and EG rules
Rules of Inference for Quantified Statement
S.
Rule Inference
No
∀x P(x)
1 Universal Specification (US) ∴ 𝑃 c for an arbitrary ′c′
∃x P(x)
2 Existential Specification (ES) ∴ 𝑃 c for some element ′c′
Problems:
1. Show that “All men are mortal”, “Socrates is a man” . Therefore Socrates is a mortal
Solution
Let us use the notations H(x) : x is a man
55
M(x) : x is a mortal
s : Socrates
With these symbolic notations, the problem becomes
∀x ((H(x) → M(x)) ∧ H(s) ⟹ M(s)
The derivation of the proof is as follows:
Step Statement Reason
1 ∀x ((H(x) → M(x)) Rule P
2 H(s) → M(s) 2, US
3 H(s) Rule P
4 M(s) T,2,3, Modus ponens
56
3. Prove that ∀x P x → Q y ∧ R x , ∃xP x ⟹ Q y ∧ ∃x P x ∧ R x
Solution
Step Statement Reason
1 ∀x P x → Q y ∧ R x Rule P
2 P z → Q y ∧R z 1, US
3 ∃xP x Rule P
4 Pz 3, ES
5 Q y ∧R z 2,4, Modus ponens
6 Qy 5, Simplification
7 Rz 5, Simplification
8 P z ∧R z 4, 7, conjunction
9 ∃x P x ∧ R x 8, EG
10 Q y ∧ ∃x P x ∧ R x 6,9, conjunction
5 ~ ∀y R y → S y 4, negation equivalence
6 ∃x P x ∧ Q x → ∀y R y → S y Rule P
7 ~ ∃x P x ∧ Q x 5,6, modus tollens
8 ∀x ~ P x ∧ Q x 7, negative equivalence
9 ~ P b ∧Q b 8, US
10 ~P b ∨ ~Q b 9, De Morgan’s law
11 P b → ~Q b 10, equivalence
12 ∀x P x → ∼ Q x 11, UG
57
5. Show that the premises “Everyone in this discrete mathematics class has taken
a course in computer science” and “ Mala is a student in this class imply the
conclusion “ Mala has taken a course in computer science”
Solution
P x : x is a student in this discrete mathematics class
P c : Mala is a student in this class
C x : x has taken a course in computer science
C c : Mala has taken a course in computer science
Given premises ∀x P x → C x , P c
Conclusion: C c
Step Statement Reason
1 ∀x P x → C x Rule P
2 P c → C c 1, US
3 P c Rule P
4 C c 2,3, Modus ponens
1 ∀x P x ⟶ Q(x) Rule P
3 ∀x Q x ⟶ R(x) Rule P
6 ∀x P x ⟶ R(x) 5, UG
58
7. Using CP or otherwise obtain the following implication
∀x P x ⟶ Q(x) , ∀x R x ⟶∼ Q(x) ⟹ ∀x R x ⟶∼ P(x)
Solution
Step Statement Reason
1 ∀x P x ⟶ Q(x) Rule P
2 P a ⟶ Q(a) 1, US
3 ∀x R x ⟶∼ Q(x) Rule P
4 R a ⟶∼ Q(a) 3, US
5 Q a ⟶∼ R(a) 4, contrapositive
6 P a ⟶∼ R(a) 2,5, Hypothetical Syllogism
7 R a ⟶∼ P(a) 6, contrapositive
8 ⟹ ∀x R x ⟶∼ P(x) 7, UG
2 H a 1, ES
3 ∀x H x ⟶ M(x) Rule P
4 H a ⟶ M(a) 3, US
5 M(a) 2,4, modus ponens
6 ∃x M x 5, EG
59
9. Prove that ∃x P x ⋀ Q(x) ⟹ ∃x P x ∧ ∃x Q x
Solution
Step Statement Reason
1 ∃x P x ⋀Q(x) Rule P
60
11. By indirect method, prove that ∀x P(x) → Q(x) , ∃x P(x) ⟹ ∃x Q(x)
Solution
We assume that contrary and come to contradiction
Assume ∼ (∃x Q(x))
Step Statement Reason
1 ∃x P(x) Rule P
2 P(a) 1,ES, a is particular
3 ∼ (∃x Q(x)) Rule P
4 ∀x~Q(x) 3, negation
equivalence
5 ~Q(a) 4,US
6 ∀x P(x) → Q(x) Rule P
7 P(a) → Q(a) 6, US
8 P(a)⋀~Q(a) 2,5, conjunction
9 ~ ~P(a ∨ Q(a)) 8, demorgan law
10 ∼ (P(a) → Q(a)) 9, logical equivalences
11 (P a → Q a ) ∧∼ (P(a) 7,10, conjunction
→ Q(a))
12 False 11, negation law
Thus we come to a contradiction.
12. Show that the premises “ One student in this class knows how to write programs in
Java” and “everyone who knows how to write programs in Java can get high paying job”
imply the conclusion someone in this class can get a high paying job.
Solution
Let 𝐶 x : x is in the class
𝐽 x : x knows Java programming
𝐻 x : x can get a high paying Job
Then the given premises are ∃x C(x ⋀ J(x)) and ∀x J(x → H(x))
Therefore the conclusion is ∃x C(x ⋀ H(x))
61
Step Statement Reason
1 ∃x C(x ⋀J(x)) Rule P
2 C a ⋀ J(a) 1, ES
3 C(a) T,2, Simplification
4 J(a) T,2, Simplification
5 ∀x J(x → H(x)) Rule P
13. Show that ~𝑃 𝑎, 𝑏 follows logically from ∀𝑥∀𝑦 𝑃(𝑥, 𝑦) → 𝑊(𝑥, 𝑦) and
~𝑊 𝑎, 𝑏
Solution
62
15. To show that the premises “ A student in this class has not read the book” and
“Everyone in this class passed the first exam” imply the conclusion “Someone
Who passed the first exam has not read the book”
Solution
2 P c ∧ Q(c) 1, ES
3 P c 2, Simplification
5 P(c) → R(c) 4, US
7 Q(c) 2, Simplification
9 ∃x R(x ∧ Q(x)) 8, EG
63
1.11 INTRODUCTION TO PROOFS
1.11.4 Trivial Proof: A proof of 𝑝 → 𝑞 that uses the fact 𝑞 is true is called a
trivial proof
64
Problems
Solution:𝑝 : 2 is irrational
65
3. Prove that square of an even number is an even number by (i) direct method
(ii) indirect method and (iii) proof by contradiction
Solution:
Direct proof: (p q)
Let n be even i.e. n = 2k, where k is an integer.
n2 = (2k) 2 = 4k2 = 2 (2k2) = an even number.
Indirect proof: ( q p )
To prove that if n is odd then n2 is odd
Let n be odd. i.e. n = 2k – 1
n = (2k – 1)2 = 4k2 – 4k + 1
2
5. Let P(n) be “If a and b are positive integers with a ≥ b, then a𝑛 ≥ b𝑛 . Show
that the proposition P 0 is true
Solution: Proposition P(0) is the implication “If a ≥ b, then a0 ≥ b0
Since a0 = b0 = 1, the conclusion of P(0) is true. Hence P(0) is true (using
trivial proof)
66
1.12 PROOF METHODS AND STRATEGY
(b) non constructive existence proof : A proof that an element with a specified
property exists that does not explicitly find such an element.
(v) Uniqueness Proof: A proof that there is exactly one element satisfying a
specified properly.
The two parts of uniqueness proof are Existence and Uniqueness. In
Existence we need to show that an element x with the desired property
exists and In Uniqueness we need to show that if y ≠x, the y does not have
desired property
67
Problems
1. Prove that if 𝑛 is an integer, then 𝑛2 ≥ 𝑛
Solution: Consider three cases 𝑖 𝑛 = 0, 𝑖𝑖 𝑛 ≤ −1, 𝑖𝑖𝑖 𝑛 ≥ 1
Case 𝒊 : 𝒏 = 𝟎
02 = 0 so 02 ≥ 0 It follows 𝑛2 ≥ 𝑛 is true
Case 𝒊𝒊 : 𝒏 ≤ −𝟏
𝑛2 ≥ 0 It follows 𝑛2 ≥ 𝑛 is true
Case 𝒊𝒊𝒊 : 𝒏 ≥ 𝟏
𝑛. 𝑛 ≥ 1. 𝑛 ⟹ 𝑛2 ≥ 𝑛 It follows 𝑛2 ≥ 𝑛 is true
Since 𝑛2 ≥ 𝑛 holds good for all three cases, we can conclude that if 𝑛 is an
integer, then 𝑛2 ≥ 𝑛
2. Prove that 𝑛 + 1 3
≥ 3𝑛 if 𝑛 is a positive integer with 𝑛 ≤ 4
Solution:Using Exhaustive proof we can verify for 𝑛 = 1, 2, 3, 4
𝑛 =1, 1+1 3
≥ 31 gives 8 ≥ 3 which is true
𝑛 =2, 2+1 3
≥ 32 gives 27 ≥ 9 which is true
𝑛 =3, 3+1 3
≥ 33 gives 125 ≥ 81 which is true
Therefore, 𝑛 + 1 3
≥ 3𝑛 if 𝑛 is a positive integer with 𝑛 ≤ 4
3. Show that there is apositive integers that can be written as the sum of cubes
of positive integers in two different ways
Solution:
Using constructive existence proof, we have 1729 = 103 + 93 = 123 + 13
4. Show that there exist irrational numbers x and y such that x 𝑦 is rational
Solution:We know that 2 is irrational
2 2 2
Consider 2 , if 2 is irrational then let x = 2 and 𝑦 = 2
2
2 2
So that x 𝑦 = 2 = 2 =2
68
5. To prove that 3 is irrational
Solution:We know that 3 is irrational
Assume𝑝: 3 is irrational
To start a proof by contradiction (ie) 𝑝 is true (ie) 3 is rational
Now we have to show that 𝑝 is true leads to a contradiction
a
If 3 is rational there exist integers′a′ and ′b′ the 3 = → (1)
b
where a and b do not have common factor
a 2
Now 3 = squaring (1)
b
3b2 = a2
Since 3 is a factor of a2 , 3 is a factor of a
Further more, since 3 is a factor of a
9 is a factor of a2 which means 9 is a factor of 3b2
⟹ 3 is a factor of b2 (ie) 3 is a factor of b
This makes 3 is a factor of both a and b, which is a contradiction to (1).
∴ our assumption that 3 is rational is wrong. Hence 3 is irrational.
Hence to prove 3 is irrational we have adapted the existing proof 2 is irrational
Generally, 𝑛 is irrational whenever 𝑛 is a positive integer that is not a perfect
square
69
1.13 PRACTICE QUIZ
a. a v b → b ∧c
b. a ∧ b →( b v c)
c. a v b → (b → c)
d. None of these
a. True
b. False
a. (A ∧ B)∧ ¬(B ∧ C)
b. ¬(A ∧ B) v ( B v C)
c. ¬(A →B) →(¬B ∧ C)
d. None of the mentioned
s
70
6) What is the contrapositive of the conditional statement? “The home team
misses whenever it is drizzling?”
a. If it is drizzling, then home team misses
b. If the home team misses, then it is drizzling
c. If it is not drizzling, then the home team does not misses
d. If the home team wins, then it is not drizzling
8) P → (Q → R) is equivalent to
a. (P ^ Q) → R
b. (P v Q) → R
c. (P v Q) → ˥R
d. None of these
71
1.14 ASSIGNMENT 1 Statement Calculus
P Q, Q R, P M , M .
2. Establish the validity of the argument “All integers are rational numbers. Some
integers are of powers of 3. Therefore, some rational numbers are powers of 3”
3. Verify the validity of the argument. “Every living thing is a plant or an animal.
John’s gold fish is alive and it is not a plant. All animals has hearts. Therefore ,
John’s Gold fish has a heart
4. Verify the validity of the argument. If one person is more successful than
another, then he has worked harder to deserve success. Ram has not worked
harder than Siva. Therefore, Ram is not more successful than Siva
5. Verify the validity of the argument. “Every living thing is a plant or an animal.
John’s gold fish is alive and it is not a plant. All animals has hearts. Therefore ,
John’s Gold fish has a heart.
6. Use the rules of inference to show that the hypothesis "If it does not rain or if it
is not foggy , then the sailing race will be held and the lifesaving demonstration
will go on", " If the sailing race is held , then the trophy will be awarded " and "
The trophy was not awarded " imply the conclusion " It rained".
72
Part A – Q & A (with K level and CO)
𝑝 𝑞 ~𝑝 ~𝑞 𝑝∧𝑞 ∽ 𝑝 ∧∽ 𝑞 𝑝 ∧ 𝑞 ∨ ∽ 𝑝 ∧∽ 𝑞
T T F F T F T
T F F T F F F
F T T F F F F
F F T T F T T
73
S.N Question & Answer K C
o Leve O
l
6. Define Direct Proof. K1 CO
Solution: When a conclusion is derived from a set of 1
premises by using the equivalence rule and implication rule,
then the process of derivation is called a direct proof.
i.e If 𝐻1 , 𝐻2 , 𝐻3 … … 𝐻𝑚 are premises and 𝐶 is the conclusion
the principle involved in direct proof
𝐻1 ∧ 𝐻2 ∧ 𝐻3 ∧ … … ∧ 𝐻𝑚 ⇒ 𝐶.
7. “If the Labour market is perfect, then the wages of all K2 CO
person in a particular employment are equal. But it is 1
a case that wages for such persons are not equal.
Therefore the Labour market is not perfect”. Test the
validity of the argument.
Solution: Let P : Labour market is perfect.
𝑄 ∶ Wages of all persons in a particular
employment
Premises: 𝑃 → 𝑄 , ~𝑄 Conclusion: ~𝑃
Steps Premises Reason
1. 𝑃→𝑄 Rule P
2. ~𝑄 Rule P
3. ~𝑃 Rule T, {1,2},Modus Tollens
74
S.N Question & Answer K C
o Leve O
l
10. Define Conditional proof. K1 CO
Solution:If the conclusion is of the form of 𝑃 → 𝑄, then set 1
Additional Premise :P and derive the conclusion : 𝑄
75
S.No Question & Answer K CO
Level
14. Let S(x) be the predicate “x is a student”, F(x) the K2 CO1
predicate “x is a faculty member” and A(x, y) the
predicate “x has asked y a question” where the universe
of discourse is the set of all people associated with your
school. Use quantifiers to express each of the following
statements. (a) Some student has not asked any faculty
member a question. (b) There is a faculty member who
has asked every other faculty member a question.
Solution:
(a) ∃𝑥 𝑆(𝑥 ∧ ∀𝑦 𝐹(𝑦) → 𝐴(𝑥, 𝑦)
(b) ∃𝑥 𝐹(𝑥 ∧ ∀𝑦 𝐹 𝑦 ∧ 𝑦≠𝑥 → 𝐴(𝑥, 𝑦
76
1.16 PART B (QUESTIONS)
77
S.No Part B (Question) K CO
Level
9. Show that the premises “one student in this class knows how K2 CO1
to write programs in JAVA” and “Everyone who knows how to
write programs in JAVA can get a high paying job” imply the
conclusion “Someone in this class can get a high-paying job”.
78
Supportive online Certification Courses
https://nptel.ac.in/courses/106/106/106106094/#
79
Real life applications of discrete mathematics in day
today life and to industry
Discrete Mathematics is part of everyone’s life. In every instant of life everyone has
Computers
Now a day’s Computer is part of everyone’s day today’s life. Along with the various
uses, arithmetic operation is one of basic part of computer machine. It’s a good
can be implementing in computer coding language. It’s very easy to analyze and
understand how a computing machine works when you understand the discrete
and design in market by using discrete mathematics which is generally used for
Computers run software and store files. The software and files are both stored as
Electronic health care records are kept as parts of databases, and there is a lot
Compact discs store a lot of data, which is encoded using a modified Reed-
Solomon code (a binary code, and thus discrete math) to automatically correct
transmission errors.
80
CONTENT BEYOND THE SYLLABUS
The topic Propositional Logic in Artificial Intelligence is the content beyond the
sylabus for the course Algebra and Number Theory.
View the lecture on YouTube:
https://youtu.be/tpDU9UXqsUo
Value Added Courses:
81
PRESCRIBED TEXT BOOKS & REFERENCE BOOKS
82
Thank you
Disclaimer:
This document is confidential and intended solely for the educational purpose of RMK Group of
Educational Institutions. If you have received this document through email in error, please notify the
system manager. This document contains proprietary information and is intended only to the
respective group / learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender immediately by e-mail if you
have received this document by mistake and delete this document from your system. If you are not
the intended recipient you are notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.
83