0% found this document useful (0 votes)
38 views60 pages

DM Lecture 2 Logic and Proofs 13102021 031322pm

This document provides an outline for a lecture on logic and proofs in discrete mathematics. It introduces propositional logic, including definitions of propositions, truth tables, and logical operators like negation, conjunction, disjunction, implication, and biconditional. It also discusses the relationships between statements, including the converse, inverse, and contrapositive. The document lists examples and provides context to illustrate these logical concepts.

Uploaded by

balajkhan1965
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)
38 views60 pages

DM Lecture 2 Logic and Proofs 13102021 031322pm

This document provides an outline for a lecture on logic and proofs in discrete mathematics. It introduces propositional logic, including definitions of propositions, truth tables, and logical operators like negation, conjunction, disjunction, implication, and biconditional. It also discusses the relationships between statements, including the converse, inverse, and contrapositive. The document lists examples and provides context to illustrate these logical concepts.

Uploaded by

balajkhan1965
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/ 60

Lecture 02

Logic and Proofs/


Propositional Logic

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

Natural language is Ambiguous

Converse, Inverse, Contrapositive


4
Chapter 1 :”the foundation :Logic and Proof”
Book: “DISCRETE MATHEMATICS AND ITS
APPLICATIONS” BY Kenneth H Rosen. 7TH ED

Introduction to Preposition
Logics

5
Topic 1: Logic and Proofs
How do computers think?

Logic: propositional logic, first order logic

Proof: induction, contradiction

Artificial intelligence, database, circuit, algorithms


6
Logic

• Logic is the study of the principles and


methods that distinguishes between a valid
and invalid argument.
Example of mathematical
• argument
Proposition
Examples
Proposition
• A statement is a declarative sentence
• It is Sunday today (OK)
• The sun rises from east (OK)
• Open the door (an order; not a statement)
• Are you hungry? (Interrogative; not a statement)
• A proposition is a statement which is either true or false but not
both
• 2+2 = 4
• It is Sunday today
• The sun rises from east

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

𝑥 > 2 provided that 𝑥 = 1


• Bill Gates is an American. He is very rich.
• “He is very rich” is now a proposition with truth-value TRUE
1
TEST
• Are these propositions?
– Are you hungry?
–𝑥+𝑦 = 3
– I am happy
– It is raining

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

• It was first developed systematically by


the Greek philosopher Aristotle more
than 2300 years ago

1
Truth Table
• If a proposition is true, we say that it has a truth
value of “true”

• If a proposition is false, its truth value is


“false”

• The truth values “true” and “false” are, respectively,


denoted by the letters T and F

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)

• The methods to produce new propositions (from those


that we already have) were discussed by the English
mathematician George Boole in 1854 in his book The
Laws of Thought
The conjunction operator
Examples

• p: It is raining q: It is windy
𝑝 ∧ 𝑞?

• I am thirsty I am hungry
Conjunction?

• It is cold but sunny.


Conjunction truth table
The Disjunction Operator
Disjunction Truth Table
29
Inclusive OR vs. Exclusive OR
“Students who have taken calculus or computer science
can take this class.”
(Inclusive or)

“Students who have taken calculus or computer science,


but not both, can enroll in this class.”

Students who have taken either calculus or computer


science, can enroll in this class.
(exclusive or)
The Exclusive-Or operator
Truth table of Exclusive-Or
“Inclusive or” or “Exclusive or”

“Tonight I will stay home or go out to a


movie.”

Which will be used?


Natural language is ambiguous
The implication operator /
Conditional Implication
Implication truth table
A conditional statement is
also called an implication.
Other Notations

■𝑝 ⇒ 𝑞
■𝑝 ⊃𝑞
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.

In the conditional statement p → q, p is called the


hypothesis (or antecedent or premise)
and q is called the conclusion (or consequence).
Implication Example
• “If Maria learns discrete mathematics, then she
will find a good job.”
There are many other ways to express this
conditional statement in English. Among the most
natural of these are:
– “Maria will find a good job when she learns discrete
mathematics.”
– “For Maria to get a good job, it is sufficient for her to
learn discrete mathematics.”
– “Maria will find a good job unless she does not learn
discrete mathematics.”
𝒑 ⟶ 𝒒 Example

p: you get 100% on the final


q: you will get an A

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?”

• p → q = “If it is raining, then the home team wins.”

• ¬ q→¬ p =“If the home team does not win, then it is not raining.”
(contrapositive)

• q → p = “If the home team wins, then it is raining.” (converse)

• ¬𝒑 → ¬𝒒 = “If it is not raining, then the home team does not win.”
(inverse)
Truth Table
Condition Inver Conver Contraposit
al se se ive
𝑝 𝑞 𝑝 𝑞 𝑝  𝑞 𝑝  𝑞𝑝 𝑞 
𝑞 𝑝
𝑇 𝑇 𝐹 𝐹 𝑇 𝑇 𝑇 𝑇
𝑇 𝐹 𝐹 𝑇 𝐹 𝑇 𝑇 𝐹
𝐹 𝑇 𝑇 𝐹 𝑇 𝐹 𝐹 𝑇
𝐹 𝐹 𝑇 𝑇 𝑇 𝑇 𝑇 𝑇

■ Conditional≡ Contrapositive (𝑝 → 𝑞≡ ¬𝑞 → ¬𝑝)


■ Inverse ≡ Converse (¬𝑝 → ¬𝑞≡ 𝑞 → 𝑝)
Bi conditional
Let p and q be propositions. The biconditional statement p
↔ q is the proposition
“p if and only if q.”
• The biconditional statement p ↔ q is true when p and q
have the same truth values, and is false otherwise.
• Biconditional statements are also called bi- implications.

• “p is necessary and sufficient for q” “if p then q, and


conversely” “p if q.” “p exactly when q.”
• “You can take the flight if and only if you buy a ticket.”
Truth Table

■ p ↔ q has exactly the same truth value


as (p → q) ∧ (q → p)
Example
p: “You can take the flight”
q: “You buy a ticket”
p ↔ q:
• You can take the flight if and only if you buy a
ticket
• You can take the flight iff you buy a ticket
• The fact that you can take the flight is necessary
and sufficient for buying a ticket
p: You can take flight q: You buy a
ticket
𝑝↔ 𝑞
You can take flight if and only if you buy a ticket What is the
truth value when:
■ you buy a ticket and you can take the flight ??
■ 𝑇 ↔ 𝑇 ≡𝑇
■ you don’t buy a ticket and you can’t take the flight ??
■ 𝐹 ↔ 𝐹≡𝑇
■ you buy a ticket but you can’t take the flight ??
■ 𝑇 ↔ 𝐹 ≡𝐹
■ you can’t buy a ticket but can take the flight ??
■ 𝐹 ↔ 𝑇 ≡𝐹 5
Precedence of Logical Operators
Truth Tables of Compound Proposition

P Q
Exercise

■ Can you complete the following truth table


without asking me any question in class?
p q r (𝒑 ∧ 𝒒) ∨ 𝒓

p, q and r are parameters in this


exercise
Applications of Propositional
Logic
• Translating English sentences
(Formalization)
• System Specifications
• Boolean Searches
• Logic circuits
• …
56
Logic and Bit Operations
Exercise
• Solve the question from question #1 –
question # 40

58
References

■ Kenneth Rosen Discrete Mathematics and Its


Applications – Chapter # 01

59
60

You might also like