DM Lecture 2 Logic and Proofs 13102021 031322pm
DM Lecture 2 Logic and Proofs 13102021 031322pm
Aniqa Naeem
Email : [email protected]
1
Course Outline
Logic and Proof (Chapter 1)
Predicated
Rules of inference
Proofs
Sets and set Operation
Functions
Sequence
Induction and Recursion
Counting
Permutation
Relation
Graph and paths
Trees 2
Books
• “DISCRETE MATHEMATICS AND ITS
APPLICATIONS” BY Kenneth H
Rosen. 7TH ED
3
Today’s Outline
What is meant by Logic and proof?
What is Preposition?
Non Preposition
Truth table
Operators
Introduction to Preposition
Logics
5
Topic 1: Logic and Proofs
How do computers think?
1
Examples of non-proposition
Examples
Not Propositions
Propositions
• What time is it?
• Grass is green
• Read this carefully
• 4 +2 =6
• Not declarative
• 4 +2 =7
sentences
• There are four • 𝑥+1=2
fingers in a hand • 𝑥+𝑦=𝑧
• He is very rich
Neither true nor
false 13
Context
• If the sentence is preceded by other sentences that make
the pronoun or variable reference clear, then the
sentence is a statement / proposition
• Example:
𝑥 = 1
𝑥 > 2
• Now 𝑥 > 2 is a proposition with truth-value FALSE
or
1
TEST
• Are these propositions?
– Are you hungry? NO
–𝑥+𝑦 = 3 NO
– I am happy YES
– It is raining YES
1
Propositional logic
• The area of logic that deals with
propositions is called the propositional
logic
1
Truth Table
• If a proposition is true, we say that it has a truth
value of “true”
1
Truth Table
Boolean operator
Symbols for Connectives
The negation operator
Examples
• “My PC runs Linux”
“It is not the case that my PC runs Linux”
“My PC does not run Linux”
• 2+2 = 4
“It is not the case that 2 + 2=4”
2+2≠4
Compound Propositions
• Compound propositions, are formed from existing
propositions using logical operators (also called as
connectives)
• p: It is raining q: It is windy
𝑝 ∧ 𝑞?
• I am thirsty I am hungry
Conjunction?
■𝑝 ⇒ 𝑞
■𝑝 ⊃𝑞
Conditional Statements
Definition 5:
Let p and q be propositions. The conditional statement
p → q is the proposition “if p, then q.” The conditional
statement p → q is false when p is true and q is false,
and true otherwise.
p implies that q.
you get 100% on the final implies that you will get an
A.
If p, then q.
If you get 100% on the final, then you will get an A.
Example Cont.
If you get 100% on the final,
then you will get an A.
■ If you manage to get a 100% on the final, then
you would expect to receive an A.
– 𝑇 ⟶ 𝑞 = 𝑞 (First 2 cases in the truth
table)
■ If you do not get 100% you may or may not receive
an A depending on other factors.
– 𝐹 → 𝑞 = 𝑇 (Last 2 cases)
■ However, if you do get 100%, but the professor
does not give you an A, you will feel cheated.
𝒑 ⟶ 𝒒 Example Cont.
If p, q.
If you get 100% on the final, then you will get an A.
p is sufficient for q.
Getting 100% on the final is sufficient for getting an
A.
q only if p.
you will get an A only if you get 100% on the final. q
unless ¬ p.
you will get an A unless you don’t get 100% on final.
Other forms
• Conditional statements play an essential role in
mathematical reasoning
• Many ways to express an implication (p -> q) :
Examples
• If I fall in a lake, then I’ll get wet.
• If gravity does not exist then I can fly.
• If sun rises from the west then it’ll be the end of our
planet.
• If the moon is made of cheese, then the earth is
rectangular.
Converse, Contrapositive and
Inverse
We can form some new conditional statements starting
with a conditional statement p → q. In particular, there
are three related conditional statements that occur so
often that they have special names.
Inverse: ¬𝒑 → ¬𝒒
Converse: 𝒒 → 𝒑
Contrapositive: ¬𝒒 → ¬𝒑
Converse, Inverse, Contrapositive
• “The home team wins whenever it is raining.” Because “q
whenever p” is one of the ways to express “If it is raining,
then the home team wins.”
• Consequently, the contrapositive of this conditional
statement is “If the home team does not win, then it is not
raining.”
• The converse is “If the home team wins, then it is raining.”
• The inverse is “If it is not raining, then the home team does
not win.”
• Only the contrapositive is equivalent to the original
statement.
Example
• What are the contrapositive, the converse, and the inverse of the
conditional statement
• “The home team wins whenever it is raining?”
• ¬ q→¬ p =“If the home team does not win, then it is not raining.”
(contrapositive)
• ¬𝒑 → ¬𝒒 = “If it is not raining, then the home team does not win.”
(inverse)
Truth Table
Condition Inver Conver Contraposit
al se se ive
𝑝 𝑞 𝑝 𝑞 𝑝 𝑞 𝑝 𝑞𝑝 𝑞
𝑞 𝑝
𝑇 𝑇 𝐹 𝐹 𝑇 𝑇 𝑇 𝑇
𝑇 𝐹 𝐹 𝑇 𝐹 𝑇 𝑇 𝐹
𝐹 𝑇 𝑇 𝐹 𝑇 𝐹 𝐹 𝑇
𝐹 𝐹 𝑇 𝑇 𝑇 𝑇 𝑇 𝑇
P Q
Exercise
58
References
59
60