0% found this document useful (0 votes)
24 views114 pages

Chapter - 1 - Logic - Induction and Reasoning - Part - 1

The document outlines a course on Discrete Structures, focusing on fundamental concepts in discrete mathematics relevant to computer science, including logic, proofs, sets, relations, functions, counting, and probability. The course aims to provide students with knowledge in discrete mathematics and finite state automata, emphasizing an algorithmic approach. Evaluation will be based on attendance, assignments, exams, and presentations, while the document also includes a disclaimer regarding the originality of the content.

Uploaded by

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

Chapter - 1 - Logic - Induction and Reasoning - Part - 1

The document outlines a course on Discrete Structures, focusing on fundamental concepts in discrete mathematics relevant to computer science, including logic, proofs, sets, relations, functions, counting, and probability. The course aims to provide students with knowledge in discrete mathematics and finite state automata, emphasizing an algorithmic approach. Evaluation will be based on attendance, assignments, exams, and presentations, while the document also includes a disclaimer regarding the originality of the content.

Uploaded by

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

Course Instructor

ANUJ GHIMIRE
Course Overview and
Objective
About Discrete Structure
 It is one of the fundamental course of Computer
science.
 Will help to understand how mathematical models are
essential in computer science and computation.
 The course covers fundamental concepts of discrete
structure like logic, proofs, sets, relations, functions,
counting, and probability, with an emphasis on
applications in computer science.
Objectives of Discrete Structure
 The main objective of the course is :
 To gain knowledge in discrete mathematics and finite
state automata in an algorithmic approach.
 To gain fundamental and conceptual clarity in the area
of Logic, Reasoning, Algorithms, Recurrence Relation,
Graph Theory, and Theory of Automata.
Syllabus
Syllabus
Syllabus
Syllabus
Evaluation Process
 Attendance
 Assignments
 Term Examinations
 MCQ
 Presentations or Report Submissions
DISCLAIMER
 This document does not claim any originality and
cannot be used as a substitute for prescribed textbooks.
 The information presented here is merely a collection
from various sources as well as freely available material
from internet and textbooks.
 The ownership of the information lies with the
respective authors or institutions.
Chapter 1: Logic, Induction and
Reasoning
 Logic is the generation of idea to solve any
problem.
 Logic is study of reasoning and is concerned
whether the reasoning is correct or not.
 Logic is a basis or language for reasoning
(mathematical and automated).
 Since logic can helps us to reason the
mathematical models it needs some rules
associated with logic so that we can apply those
rules for mathematical reasoning.
The rules of logic give precise meaning to
mathematical statements and are used to
distinguish between valid and invalid mathematical
arguments.

Types of Logic
 Propositional Logic
 Predicate Logic
 Fuzzy Logic ( Studied in AI……)
Proposition
 A declarative statement that is either true or
false but not the both are called propositions
 Eg: Today is Friday.
2+2=5
Pashupati Nath lies in Kaski district.
However following are not propositions
What is your name? (this is a question)
Please keep silence. (this is a request)
X is even number. (depends on what X represents)
Variables are used to represent the
propositions.
Eg:
P: Today is Friday.
Q: Kathmandu is capital city of Nepal.
R: It is raining
Here P,Q and R are variables.
Propositional Logic
Logic that deals with propositions for
reasoning is called propositional logic.

The truth and falsehood of propositions is


called its truth value
P: Today is Friday.
P can be either True(T) or False(F) which is the
truth values of P.
 A truth table shows how the truth or falsity of
a compound statement depends on the truth
or falsity of the simple statements from which
it's constructed.
 Truth table are sometimes used for proving
logical questions.
 Simple Propositions
 Compound Propositions

 Simple Propositions are those which contains


only one statements.
 When multiple propositions are combined
together to form a single propositions, then
the resulting propositions are called
compound propositions.
 To form a compound propositions different
connectives are used.
 Thus when a connective is applied to
propositions, then resulting proposition is a
compound proposition
 In propositional logic following connectives
are used
◦ Negation (¬ or ∼ )
◦ Conjunction ( ∧ )
◦ Disjunction ( ∨ )
◦ Implication ( → )
◦ Double Implication ( ↔ )
 Let ‘P’ be a proposition then negation of ‘P’ is
denoted as ‘¬P’ or ‘∼P’ and read as:
“not ‘P’.” or “It is not the case that ‘P’.”
P: Today is Friday.
¬P : Today is not Friday.
or
It is not the case that today is Friday.
P ¬P
T F
F T

Fig: Truth table of Negation


Let ‘P’ & ‘Q’ be propositions then
conjunction of P,Q is denoted as ‘P∧Q’ and
read as:
“P and Q”
P: Today is Friday.
Q: It is raining
P∧Q: Today is Friday and it is raining.
The truth value of conjunction is true if all the
constituent propositions are true otherwise
false. P Q P∧Q
T T T

Fig: Truth table of Conjunction T F F


F T F
F F F
 Let ‘P’ & ‘Q’ be propositions then disjunction
of P,Q is denoted as ‘P∨Q’ and read as:
“P or Q”
P: Today is Friday.
Q: It is raining
P∨Q: Today is Friday or it is raining.
The truth value of disjunction is true if any of
the constituent propositions is true otherwise
false. P Q P∨Q
T T T

Fig: Truth table of Disjunction T F T


F T T
F F F
 Let ‘P’ & ‘Q’ be propositions then implication of P and Q
is denoted as ‘P→Q’ and read as:
“ if P then Q ” or “P implies Q”

Hypothesis Conclusion
(necessary condition) (sufficient condition)
Some variety of implications
 P only if Q
 Q if P
 Q when P
 Q whenever P
 Q is necessary for p
 Q provided that P
 if P,Q
 Q follows from P
 a sufficient condition for Q is P.

All above statements are denoted as P→ Q .


 How "if p then q" and "p only if q" can be same?
 Example: "I will stay at home only if I'm sick."
Let p = "I will stay at home" and
q = "I'm sick"
Above statement is of the form p only if q.
According to the above statement, becoming sick
is the necessary condition that will make you stay
at home.
This means "if you're not sick then, you cannot
stay at home at any cost."
Eg: If you get a degree then you can get a job.
P: You get a degree.
Q: You can get a job.
P is hypothesis or necessary condition.
Q is conclusion or sufficient condition.

The implication statement will be true if true


hypothesis leads to correct conclusion
otherwise false .
Eg.: If you get a degree then you can get a job.
P: You get a degree.
Q: You can get a job
So P→Q will be in truth table as:

P Q P→Q
T T T
T F F
F T T
F F T
Indirect approach
Fig: Truth table of implication
Let ‘P’ & ‘Q’ be propositions then implication
of P and Q is denoted as ‘P↔Q’ and read as:
“P if and only if Q”
Here P and Q both are sufficient and necessary
conditions
P Q P↔Q
T T T
T F F
F T F
F F T

Fig: Truth table of double implication


 Construct the truth table for the following
compound propositions
 (P→Q)∧(Q→P)
 (P→¬Q)↔(¬P∨Q)
 (¬P↔R)∨[(¬Q∧P)→¬R]
(P→Q)∧(Q →P)

P Q P→Q Q→P (P→Q)∧(Q →P)

T T T T T
T F F T F
F T T F F
F F T T T
(P→¬Q)↔(¬P∨Q)
P Q ¬P ¬Q P→¬Q ¬P∨Q (P→¬Q) ↔(¬P∨Q)

T T F F F T F
T F F T T F F
F T T F T T T
F F T T T T T
(¬P↔R)∨[(¬Q∧P)→¬R]
P Q R ¬P ¬Q ¬R ¬P↔R ¬Q∧P (¬Q∧P) (¬P↔R)∨[(¬Q∧P)→¬R]
→¬R

T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F
(¬P↔R)∨[(¬Q∧P)→¬R]
P Q R ¬P ¬Q ¬R ¬P↔R ¬Q∧P (¬Q∧P) (¬P↔R)∨[(¬Q∧P)→¬R]
→¬R

T T T F F F F F T T
T T F F F T T F T T
T F T F T F F T F F
T F F F T T T T T T
F T T T F F T F T T
F T F T F T F F T T
F F T T T F T F T T
F F F T T T F F T T
 These terms are defined in terms of conditional
statements
 Let P→Q be an implication (conditional) statement
then:
Inverse :
An inverse of the conditional statement is the negation
of both the hypothesis and the conclusion.

The inverse of P→Q is ¬P→¬Q .

Eg. The inverse of “If she smiles then she is happy” is


“If she doesn’t smile then she is not happy”.
Converse :
The converse of the conditional statement is
computed by interchanging the hypothesis and the
conclusion. If the statement is “If p, then q”, the
converse will be “If q, then p”.

The Converse of P→Q is Q→P.

Eg. The converse of “If she smiles then she is happy”


is “If she is happy then she smiles”.
Contra-positive :
The contra-positive of the conditional is computed by
interchanging the hypothesis and the conclusion of the
inverse statement. If the statement is “If p, then q”, the
contra-positive will be “If not q, then not p”.

The contra-positive of P→Q is ¬Q→¬P.

Eg. The contra-positive of “If she smiles then she is


happy” is “If she is not happy then she doesn’t smile”.
In Conclusion:
 Let P→Q be an implication statement then:
 A statement Q→P is called its converse.
 A statement ¬P→¬Q is called its inverse.
 A statement ¬Q →¬P is called its contra-positive.

“If you do your homework, you will not be punished.” (Implication)


"If you will not be punished, you do your homework”. (converse)
“If you do not do your homework, you will be punished.” (inverse)
"If you are punished, you did not do your homework”. (contra-positive)
 Compound statements can be classified
according to truth table as:
 Tautology
 Contradiction
 Contingency
 A compound statement is said to be
tautology if its truth values are always true no
matter what the truth values of their
constituent propositions.
 Irrespective to the truth values of constituent
propositions, the truth values of compound
propositions are always true.
 Eg. P∨¬P is a tautology
P ¬P P∨¬P
T F T
F T T
 Show that following compound propositions
are tautology:
◦ P→(P∨Q)
◦ [P∧(P→Q)]→Q
 P→(P∨Q)

P Q P∨Q P→(P∨Q) P Q P∨Q P→(P∨Q)


T T T T T T
T F T F T T
F T F T T T
F F F F F T
◦ [P∧(P→Q)]→Q
P Q P→Q P∧(P→Q) [P∧(P→Q)]→Q
T T
T F
F T
F F

P Q P→Q P∧(P→Q) [P∧(P→Q)]→Q


T T T T T
T F F F T
F T T F T
F F T F T
 [(P→Q)∧(Q→R)] →(P→R) show this
compound proposition is a tautology using
truth table.
 A compound proposition whose truth values
are always false are called contradiction.
 Eg. P∧¬P is a contradiction

P ¬P P∧¬P
T F F
F T F
 Contingency is a compound proposition
whose truth values are combination of both
true and false.
 Eg. ¬P∨Q is a contingency

P Q ¬P ¬P∨Q
T T F T
T F F F
F T T T
F F T T
 Let P and Q be two compound propositions
then P and Q are said to be logically
equivalent if their truth values are always
same under same condition of truth values of
constituent propositons.
 Eg.
Implication and its contra-positive are
logically equivalent.
i.e: P→Q ≡¬Q→¬P
P→Q ≡¬Q→¬P

P Q ¬P ¬Q P→Q ¬Q→¬P
T T F F T T
T F F T F F
F T T F T T
F F T T T T
 Show that following compound propositions
are logically equivalent using truth table.
 P↔Q ≡ [(P→Q)∧(Q→P)]
 [P∨(Q∧R)] ≡ [(P∨Q)∧(P∨R)]
 There are simple three steps to translate the
sentences into propositional logic statements
 Identify all the individual sentences in the given
sentence and represent them by different variables.
 Identify all the connectives used in given sentence.
 Write an expression in terms of variables and
connectives.
Note: we assume there is no negative statements in the
given sentences
 Obtained compound propositional will be the
required statement of propositional logic.
 Eg:. You can access the college internet only if you are a
computer science student or you are not a fresher.
Solution
 Individual sentences are:
 P: You can access the college internet
 Q: You are a computer science student
 R: You are a fresher
 Connectives are:
 You can access the college internet only if you are a
computer science student or you are not a fresher.
 Only if i.e implication (→)
 Or i.e disjunction (∨)
 Not i.e negation(¬)
 Propositional Logic representation:
P →(Q∨¬R)
Hiking is safe along the trail if and only if berries are ripe along
the trail and bears have not been seen along the trail.
Solution
 Individual sentences are:
 P: Hiking is safe along the trail
 Q: Berries are ripe along the trail
 R: Bears have been seen along the trail.
 Connectives are:
Hiking is safe along the trail if and only if berries are ripe
along the trail and bears have not been seen along the trail.
 If and only if i.e double-implication (↔)
 and i.e conjunction (∧)
 Not i.e negation(¬)
 Propositional Logic representation:
P ↔(Q∧¬R)
 Arguments:
◦ An argument in propositional logic is the sequence
of propositions.
◦ The last statement is the conclusion and all its
preceding statements are called premises (or
hypothesis).
◦ The argument is valid if the premises imply the
conclusion
 A valid argument is one where the conclusion
follows from the truth values of the premises.
 To deduce new statements from the statements
whose truth that we already known, Rules of
Inference are used.
 Rules of Inference in propositional logic are:
 Addition
 Simplification
 Modus Ponens
 Modus Tollens
 Hypothetical Syllogism
 Disjunctive Syllogism
 Conjunction
 Resolution
Addition:
 If P is a premise, we can use Addition rule to derive
P∨Q

Example: P: “I will study DS.”


Q: “I will study Maths.”

“I will study DS” is true

So, I will study DS or I will Study Maths.” is true.


Simplification:
 If P∧Q is a premise, we can use simplification rule to
derive P.

Example:
“He studies very hard and he gets best grade”: P∧Q
P: He studies very hard.
Q: He gets best grade

So, “He studies very hard.” P is true.


“He gets best grade.” Q is true.
Modus Ponens:
 If P→Q and P are two premises, we can use
Modus Ponens to derive Q.

Example:“If it snows today, then we will go skiing”.


P→Q
The hypothesis “ it snows today,” P
Then by modus ponens, “We will go skiing.”Q is true
Modus Tollens:
 If P→Q and ¬Q are two premises, we can use
Modus Tollens to derive ¬P.

“If you have a password, then you can log on to


facebook.” P→Q
“You cannot log on to facebook.” ¬Q
Therefore − “You do not have a password .” ¬P
Disjunctive Syllogism:
 If ¬P and P∨Q are two premises, we can use
Disjunctive Syllogism to derive Q.

"The ice cream is not vanilla flavored“. ¬P


"The ice cream is vanilla flavored or chocolate
flavored“. P∨Q
Therefore "The ice cream is chocolate flavored”. Q
Hypothetical Syllogism :
 If P→Q and Q→R are two premises, we can use
Hypothetical Syllogism to derive P→R

Example:
"If it rains, I will not go to school”, P→Q
“If I don't go to school, I won't need to do homework”.
Q→R
Therefore − “If it rains, I won't need to do homework.” P→R
Conjunction :
 If P and Q are two premises, we can use
conjunction to derive P∧Q

Example:
“He is good at study”, P
“He gets highest marks in DS”. Q
Therefore − “He is good at study and he gets highest
marks in DS.” P∧Q
Resolution :
 If P∨Q and ¬Q∨R are two premises, we can use
resolution to derive P∨R

P∨Q
¬Q∨R

∴ P∨R

“I will study DS or I will study Maths II.” P∨Q


“I will not study Math II or I will study Drawing.” ¬Q∨R
Therefore, “I will study DS or I will study Drawing.”
P∨R
In Conclusion, rules of Inference are tabulated as:
Rules Name Rules Name

Addition Conjunction

Simplification Disjunctive
Syllogism

Hypothetical
Modus Ponens Syllogism

Modus Tollens Resolution


 Using rules of inference show the following
hypothesis :
◦ It is not sunny this afternoon and it is colder than
yesterday.
◦ We will go swimming only if it is sunny.
◦ If we don’t go swimming , then we will go for a
canoe trip.
◦ If we go for a canoe trip, then we will be home by
sunset.
Leads to conclusion:
◦ We will be home by sunset.
 Solution Steps:
 Convert the given sentences into propositional
logic statement.
 Identify the hypothesis and conclusion.
 Use rules of inference in hypothesis to prove
the conclusion.
Identifying individual statements
 p : It is sunny this afternoon.
 q : It is colder than yesterday.
 r : We will go swimming .
 s : we will go for a canoe trip.
 t : We will be home by sunset.

 Identifying and writing hypothesis and conclusion in propositional logic


statements

 Hypothesis are: Hypothesis:


 ¬ p∧q  It is not sunny this afternoon and it is colder
 r→p than yesterday.
 ¬r →s We will go swimming only if it is sunny.
 s→t If we don’t go swimming , then we will go for a
Conclusion:

canoe trip.
t
If we go for a canoe trip, then we will be home
by sunset.
Conclusion:
We will be home by sunset.
Hypothesis are: ¬ p∧q
r→p
¬r →s
s→t
Conclusion: t
 Proof:
S.No. Steps Reasons
1 ¬ p∧q Given hypothesis

2 ¬p Using simplification on 1.

3 r→p Given hypothesis

4 ¬r Using modus tollens on 2 and 3.

5 ¬r →s Given hypothesis

6 s Using modus ponens on 4 and 5.

7 s→t Given hypothesis

8 t Using modus ponens on 6 and 7

Hence the given hypothesis leads to the conclusion.


 Using rules of inference show the following
hypothesis :
◦ If you send me an email message then I will finish
writing the program.
◦ If you don’t send me an email message then I will
go to sleep early
◦ If I go to sleep early then I will wake up feeling
refreshed.
Leads to conclusion:
◦ If I don’t finish writing the program then I will wake
up feeling refreshed.
 Solution Steps:
 Convert the given sentences into propositional
logic statement.
 Identify the hypothesis and conclusion.
 Use rules of inference in hypothesis to prove
the conclusion.
Identifying individual statements
 p : you send me an email message .
 q : I will finish writing the program.
 r : I will go to sleep early
 s : I will wake up feeling refreshed.
 Identifying and writing hypothesis and conclusion in
propositional logic statements
Hypothesis:
 Hypothesis are:  If you send me an email message then I
 p→q will finish writing the program.
 ¬p→r If you don’t send me an email message
 r →s then I will go to sleep early
 Conclusion: If I go to sleep early then I will wake up
 ¬q→s feeling refreshed.
Conclusion:
If I don’t finish writing the program them
I will wake up feeling refreshed.
Hypothesis are: p→q
¬p→r
r →s
Conclusion: ¬q→s
 Proof:

S.No. Steps Reasons


1 p→q Given hypothesis

2 ¬q→¬p Using contra-positive on 1.

3 ¬p→r Given hypothesis

4 ¬q→r Using hypothetical syllogism on 2 and 3.

5 r→s Given Hypothesis

6 ¬q→s Using hypothetical syllogism on 4 and 5.

Hence the given hypothesis leads to the conclusion.


Using rules of inference show the following
hypothesis:
 If Clinton does not live in France, then he does not
speak French.
 Clinton does not drive a Datsun.
 If Clinton lives in France, then he rides a motorcycle.
 Either Clinton speaks French or he drives a Datsun.
Leads to the conclusion
 Clinton ride a motorcycle.
Show that the premises “If my cheque book is
in office, then I have paid my phone bill”, “I
was looking for phone bill at breakfast or I
was looking for phone bill in my office”, “If
was looking for phone bill at breakfast then
my cheque book is on breakfast table” , “If I
was looking for phone bill in my office then
my cheque book is in my office”, “I have not
paid my phone bill” imply the conclusion “My
cheque book is on my breakfast table”
Consider the following two statements:
 Every BE-IT student must study MFCS.
 Pratik is BE-IT student.
 It looks “logical” to derive:
 Pratik must study MFCS.
 However, this cannot be expressed by
propositional logic because we already notice
that none of the logical operators we have
learnt are applicable here.
 i.e Propositional Logic is not expressive.
Consider the statements containing variables as:
a) x>5
b) x=y+2
 These statements are neither true nor false
when the value of variables are not specified.
 The statement x is greater than 5 has two
parts:
 the variable x which is subject of statement.
 the second part “is greater than” is a predicate which is
the property of subject of statement.
 To express such statements we need powerful
logical tool called predicate logic.
 It is also known as First Order Propositional
Logic (FOPL).
 Predicate logic is an extension of Propositional
logic.
 It adds the concept of predicates and
quantifiers to better capture the meaning of
statements that cannot be expressed by
propositional logic.
Moving back to statement: x>5.
We can denote x is greater than 5 as:
P(x), where P is a predicate which denotes “is greater
than 5” and x is a variable
 The statement P(x) is also said to be value of
propositional function P at x.
 When the value of variable i.e. x is assigned the
statement P(x) becomes proposition.
 Here value of x is assigned from domain. Eg:
natural numbers.
Let P(X) denotes “X>5” what is the truth values
of P(2) and P(7) ?
statement P(2) is obtained by assigning
X=2 in “X>5”.
hence “2>5” is false
Similarly
statement P(7) is obtained by assigning
X=7 in “X>5”.
hence “7>5” is true
For statement x=y+2
predicate is defined as P(x,y):“x=y+2”
So,
P(5,3) is true.
P(6,7) is false.
Here x and y are taken from some specific
domain.
Quantifier are used to convert the predicate
logic into propositional logic.
 The process of binding the propositional
variable over given domain is called
quantification.
 Quantification is needed to identify the truth
value of the predicate.
 Two types of Quantification:
 Universal Quantification
 Existential quantification
 Let P(X) be a predicate then universal
quantification of P(X) is denoted by:
∀x P(X)
and read as “for all X P(X)” or “for every X P(X)”
Here ∀ is called universal quantifier.
The truth values of ∀x P(X) is true if P(X) is true for all
the values of the given domain and is false if P(X) is
false for at least one value of the given domain.
Let P(X1,X2,……..Xn) be a predicate such that P(X1),
P(X2)….P(Xn) are different instances.
Then ∀x P(X1,X2,……..Xn) is true if all the above
instances are true and is false if any of the above
instance is false

∀x P(X1,X2,……..Xn)≡ P(X1) ∧ P(X2) ∧ ……………∧P(Xn)


Eg: Let P(X)=X2-1>0, X∈ N What is the truth values of
∀xP(X) ?
Solution,
When X=1, P(1)=12-1>0
=0>0 which is false
So by definition of universal quantification the truth
value of ∀xP(X) is false.

The value of the variable that makes the universally


quantified statement false are called counter example.
Here is this example X=1 is counter example.
 Let P(X) be a predicate then existential
quantification of P(X) is denoted by:
∃x P(X)
and read as “there exist X P(X)” or “for some X P(X)”
Here ∃ is called existential quantifier.
The truth values of ∃x P(X) is true if P(X) is true for at
least one the values of the given domain and is false if
P(X) is false for each value of the given domain.
Let P(X1,X2,……..Xn) be a predicate such that P(X1),
P(X2)….P(Xn) are different instances.
Then ∃x P(X1,X2,……..Xn) is true if all the above
instances are true and is false if any of the above
instance is false

∃ x P(X1,X2,……..Xn)≡ P(X1) ∨P(X2) ∨ …………… ∨ P(Xn)


Eg: Let P(X)=X2-1=0, X∈ N What is the truth values of
∃ xP(X) ?
Solution,
When X=1, P(1)=12-1=0
=0=0 which is true
So by definition of existential quantification the truth
value of ∃ xP(X) is true.

The value of the variable that makes the existentially


quantified statement true are called witness. Here is
this example X=1 is witness.
Show that ∀x(P(x)∧Q(x)) and ∀xP(x)∧∀xQ(x) are
logically equivalent (where the same domain is
used throughout)
o Let ∀x(P(x)^Q(x)) is true.
o This means that if a is in the domain, P(a)^Q(a) is true.
o Hence P(a) is true and Q(a) is true.
o Because P(a) is true and Q(a) is true for every element in
the domain, we can conclude that ∀xP(x) and ∀xQ(x)
are both true.
o This concludes ∀xP(x)^∀xQ(x) is true.
o Let ∀xP(x)^∀xQ(x) is true.
o ∀xP(x) is true and ∀xQ(x) is true.
o Hence, if a is in domain, then P(a) is true and Q(a) is
true.
o It follows that for all a, p(a) ^Q(a) is true.
o ∀x(P(x)^Q(x)) ≡ ∀xP(x) ^ ∀xQ(x)
Consider a statement
Every student in this class has taken TOC.
o Let P(x) be the statement "x has taken TOC“ and
domain consists of the students in this class.
o It can be denoted as: ∀xP(x).
o The negation of this statement is "It is not the
case that every student in this class has taken
TOC".
o This is equivalent to "There is a student in this
class who has not taken TOC".
o And it is the existential quantification of the
negation of the negation of original
propositional function. i.e.
¬∀xP(x) ≡ ∃x¬P(x)
Consider a statement
There is the student in this class who has
taken TOC.
o Let P(x) be the statement "x has taken a course
in TOC“ and domain consists of the students in
this class.
o It can be denoted as: ∃ xP(x).
o The negation of this statement is "It is not the
case that there exist student in this class who
has taken TOC".
o This is equivalent to “Every student in this class
has not taken a course in TOC".
o And it is the universal quantification of the
negation of the negation of original
propositional function. i.e.
¬∃xP(x) ≡ ∀x¬P(x)
Find the negations of following statement:
∀x(x2>x)
∃x(x2 = 2)
 Two quantifiers are said to be nested if one is
within the scope of the other.
 For example: ∀x∃y P(x,y)
◦ Here ∃ is within the scope of ∀
 Note: Anything within a scope of the
quantifier can be thought of as a
propositional function.
 In ∀x∃yP(x,y), ∃yP(x,y) can be thought as
propositional function P(x).
 So, ∀x∃yP(x,y) can be written as ∀xP(x)
where, P(x)= ∃yP(x,y)
 Different combinations of Nested Quantifiers are:
◦ ∀x∀y P(x,y)
◦ ∀x∃y P(x,y)
◦ ∃x∀y P(x,y)
◦ ∃x∃y P(x,y)
 Order of quantifiers doesn't matter for ∀x∀y P(x,y)
and ∃x∃y P(x,y)
◦ i.e. ∃x∃y P(x,y) ≡ ∃y∃xP(x,y) and ∀x∀y P(x,y) ≡ ∀y∀x
P(x,y)
 Order of quantifiers matters for ∀x∃y P(x,y) and
∃x∀y P(x,y)
◦ i.e. ∀x∃y P(x,y) ≢ ∃x∀y P(x,y)
◦ ∀x∀y P(X,Y)
 Is true if for every pair (x, y), P(x, y) is true, otherwise
false.
◦ ∀x∃y P(X,Y)
 Is true if for every values of x, there is a y such that
P(x, y) is true, otherwise false.
◦ ∃x∀y P(X,Y)
 Is true if there exists a x such that P(x, y) for every y,
otherwise false.
◦ ∃x∃y P(X,Y)
 Is true if for some pair (x, y), P(x, y) is true, otherwise
false.
 Let x and y be the real numbers and P(x, y)
denotes "x + y = 0." Find the truth values of:
◦ ∀x∀y P(x,y)
◦ ∀x∃y P(x,y)
◦ ∃x∀y P(x,y)
◦ ∃x∃y P(x,y)
Solution,
Here P(x, y) denotes "x + y = 0."
Here domain is all real numbers
 ∀x∀y P(x,y) ≡ ∀x∀y (x+y=0)

It can be read as:


"For all real numbers x and y, x+y = 0“.
Is it True?
No
 ∀x∃y P(x,y) ≡ ∀x∃y (x+y=0)
It can be read as:
"For every real number x, there exist a real
number y such that x + y = 0"
Is it True?
YES
You can choose any real number x; there is
always a real number y for that x such that x + y
=0
For example: x = 1 there is y = - 1, for x = - 1
there is y = 1 for x = 1/2 there is y = - 1/2
Find just 1 value of y for each x such that P(x, y)
becomes true.
 ∃x∀y P(x,y) ≡ ∃x∀y (x+y=0)
It can be read as:
"There exist some real number y such that for
every real number x, x + y = 0”.
Is it True?
NO
It is asking us to find a real number y for
which P(x, y) becomes true by plugging in
every real number x.
P(x,y) is x + y = 0
First, take some real number y Lets take y = 1
P(x,1) means x + 1 = 0
Now, plug in all real numbers x.
If we choose x=1/2 then P(1/2, 1) is False and
so on.
 ∃x∃y P(x,y) ≡ ∃x∃y (x+y=0)
It can be read as:
"There exist some real numbers x and y such
that x + y = 0"
Is it True?
YES
Obviously. There exist some combination of real
numbers x and y exist for which x + y = 0
Take x = 1 and y = - 1 (Many such combinations)
 Consider the following Sentences:
 Every student in this class studied DS.
 Some student in this class studied DS.
 All kings are men.
 Some lions are dangerous.
 Everyone loves someone.
 Someone loves somebody.
 Everyone loves everybody.
 Every student in this class studied DS.
◦ Domain: All Student
 P(x):x is the student in the class.
 Q(x): x has studied DS.
∀x[P(x)→Q(x)]
 Some student in this class studied DS.
◦ Domain: All Student
 P(x):x is the student in the class.
 Q(x): x has studied DS.
∃x[P(x)∧Q(x)]
 All kings are men.
 K(x):x is king.
 M(x): x is men.
∀x[K(x)→M(x)]
 Some lions are dangerous.
 L(x):x is lion.
 D(x): x is dangerous.
∃x[L(x)∧D(x)]
 Everyone loves someone.
 Let loves(x,y): x loves y.
∀x∃y,[loves(x,y)]
 Someone loves somebody.
 Let loves(x,y): x loves y.
∃x ∃y,[loves(x,y)]
 Everyone loves everybody.
 Let loves(x,y): x loves y.
∀x∀y,[loves(x,y)]
S.No. Rules Name

1 Universal Instantiation
c∈D

2 Universal Generalization

3 Existential Instantiation

4 Existential Generalization
c∈D
Quantified Statement
Use Instantiation Rule

Statement in Propositional Logic Form


Use Rules of Inference of
propositional Logic

Conclusion in Propositional Form


Use Generalization Rule

Quantified Solution
 Using rules of inference show the following
hypothesis leads to the conclusion:
 All kings are men
 All men are mortal
Therefore all kings are mortal.
Defining Predicates
 K(X): X is a king.
 M(X): X is a man.
 Mo(X): X is mortal.
 Identifying and writing hypothesis and conclusion
in predicate logic statements

 Hypothesis are: Hypothesis


 All kings are men
 ∀x [K(X)→ M(X)]
All men are mortal
∀x [M(X) → Mo(X)]
 Conclusion:
Conclusion:
∀x [K(X) → Mo(X)]
All kings are mortal
Hypothesis:
 ∀x [K(X)→ M(X)]
 ∀x [M(X) → Mo(X)]
Conclusion:
 ∀x [K(X) → Mo(X)]
Proof:
S. No. Steps Reasons
1 ∀x [K(X)→ M(X)] Given Hypothesis
2 K(a)→ M(a), a∈D Using U.I on 1
3 ∀x [M(X) → Mo(X)] Given Hypothesis
4 M(a) → Mo(a), a∈D Using U.I on 3
5 K(a) → Mo(a) Using hypothetical syllogism on 2 and 4
6 ∀x [K(X) → Mo(X)] Using U.G on 5

Hence the given hypothesis leads to the conclusion.


 Using rules of inference show the following
hypothesis leads to the conclusion:
 Every student in the class has passed the exam.
 Some one in the class has not read the book.
Therefore, Someone who has passed the exam has not
read the book.
Defining Predicates
 S(X): X is a student in the class.
 E(X): X has passed the exam.
 B(X): X has read the book
 Identifying and writing hypothesis and conclusion
in predicate logic statements
Hypothesis
 Hypothesis are:  Every student in the class has passed
 ∀x [S(X)→ E(X)] the exam.
∃x [S(X) ∧¬ B(X)]  Some one in the class has not read
the book.
 Conclusion:
Conclusion:
∃x [E(X) ∧¬ B(X)]
Someone who has passed the
exam has not read the book.
Hypothesis:
 ∀x [S(X)→ E(X)]
 ∃x [S(X) ∧¬ B(X)] Conclusion: ∃x [E(X) ∧¬ B(X)]
Proof:
S. No. Steps Reasons
1 ∀x [S(X)→ E(X)] Given Hypothesis
2 S(a)→ E(a), a∈D Using U.I on 1
3 ∃x [S(X) ∧¬ B(X)] Given Hypothesis
4 S(a) ∧¬ B(a) , a∈D Using E.I on 3
5 S(a) Using simplification on 4
6 E(a) Using modus ponens on 2 and 5
7 ¬ B(a) Using simplification on 4
8 [E(a) ∧¬ B(a)] Using conjunction on 6 and 7
9 ∃x [E(X) ∧¬ B(X)] Using E.G on 8

Hence the given hypothesis leads to the conclusion.


Pradip, a student in this class owns a graphing
calculator. Everyone who owns the graphing
calculator understands trigonometric function.
Therefore, some one in the class understands
trigonometric function.

You might also like