SlideShare a Scribd company logo
1 of 58
Propositional Logic
Lecture 1: Sep 2
Content
1. Mathematical proof (what and why)
2. Logic, basic operators
3. Using simple operators to construct any operator
4. Logical equivalence, DeMorgan’s law
5. Conditional statement (if, if and only if)
6. Arguments
2 2 2
a b c+ =
Familiar?
Obvious?
cb
a
Pythagorean theorem
cb
a
(i) a c×c square, and then
(ii) an a×a & a b×b square
Good Proof
b-a
We will show that these five pieces can be rearranged into:
b-a
And then we can conclude that
c
cc
a b
c
b-a
Good Proof
The five pieces can be rearranged into:
(i) a c×c square
cb
a b-a
b-a
Good Proof
How to rearrange them into an axa square and a bxb square?
b
a
a ab-a
74 proofs in http://www.cut-the-knot.org/pythagoras/index.shtml
b
Good Proof
b
Bad Proof
A similar rearrangement technique shows that 65=64…
What’s wrong with the proof?
Mathematical Proof
To prove mathematical theorems, we need a more rigorous system.
http://en.wikipedia.org/wiki/Pythagorean_theoremEuclid’s proof of Pythagorean’s theorem
The standard procedure for proving mathematical theorems is invented by
Euclid in 300BC. First he started with five axioms (the truth of these
statements are taken for granted). Then he uses logic to deduce the truth
of other statements.
1.It is possible to draw a straight line from any point to any other point.
2.It is possible to produce a finite straight line continuously in a straight line.
3.It is possible to describe a circle with any center and any radius.
4.It is true that all right angles are equal to one another.
5.("Parallel postulate") It is true that, if a straight line falling on two straight lines make the interior angles on the same side less than two right angles,
the two straight lines, if produced indefinitely, intersect on that side on which are the angles less than the two right angles.
(Optional) See page 18 of the notes for the ZFC axioms that we now use.
Content
1. Mathematical proof (what and why)
2. Logic, basic operators
3. Using simple operators to construct any operator
4. Logical equivalence, DeMorgan’s law
5. Conditional statement (if, if and only if)
6. Arguments
Now, we have seen the need of a rigorous proof system.
We will proceed to define the basic logic system.
Statement (Proposition)
A Statement is a sentence that is either True or False
Examples:
Non-examples: x+y>0
x2
+y2
=z2
True
False
2 + 2 = 4
3 x 3 = 8
787009911 is a prime
They are true for some values of x and y
but are false for some other values of x and y.
Today is Tuesday.
Logic Operators
NOT::=¬ ¬ P is true if and only if P is false
Logic operators are used to construct new statements from old statements.
There are three main logic operators, NOT, AND, OR.
TF
FT
¬PP
Logic Operators
F
F
F
T
P Q
FF
TF
FT
TT
QP
AND::=∧
F
T
T
T
P Q
FF
TF
FT
TT
QP
OR::=∨
Logic operators are used to construct new statements from old statements.
There are three main logic operators, NOT, AND, OR.
Compound Statement
p = “it is hot” q = “it is sunny”
It is hot and sunny
It is not hot but sunny
It is neither hot nor sunny
We can also define logic operators on three or more statements, e.g. OR(P,Q,R)
More Logical Operators
coffee “or” tea
 exclusive-or
p q p  q
T T F
T F T
F T T
F F F
We can define more logical operators as we need.
P Q R M(P,Q,R)
T T T T
T T F T
T F T T
T F F F
F T T T
F T F F
F F T F
F F F F
majority
Content
1. Mathematical proof (what and why)
2. Logic, basic operators
3. Using simple operators to construct any operator
4. Logical equivalence, DeMorgan’s law
5. Conditional statement (if, if and only if)
6. Arguments
We can define as many new operators as we like.
But we will see how to construct any operator from AND, OR, NOT.
Formula for Exclusive-Or
p q
T T F T F F
T F T T T T
F T T T T T
F F F F T F
Logical equivalence: Two statements have the same truth table
Idea 0: Guess and check
As you will see, there are many different ways to write the same logical formula.
One can always use a truth table to check whether two statements are equivalent.
Exclusive-Or
Is there a more systematic way to construct such a formula?
p q p  q
T T F
T F T
F T T
F F F
Idea 1: Look at the true rowsIdea 1: Look at the true rowsIdea 1: Look at the true rows
Want the formula to be true
exactly when the input belongs
to a “true” row.
The input is the second row exactly if this sub-formula is satisfied
And the formula is true exactly when the input is the second row or the third row.
Exclusive-Or
p q p  q
T T F
T F T
F T T
F F F
Idea 2: Look at the false rows
Want the formula to be true
exactly when the input does
not belong to a “false” row.
The input is the first row exactly if this sub-formula is satisfied
And the formula is true exactly when the input is not in the 1st
row and the 4th
row.
Is there a more systematic way to construct such a formula?
Writing Logical Formula for a Truth Table
Digital logic:
Given a digital circuit, we can construct the truth table.
Now, suppose we are given only the truth table (i.e. the specification,
e.g. the specification of the majority function), how can we construct a
digital circuit (i.e. formula) using only simple gates (such as AND, OR, NOT)
that has the same function?
Writing Logical Formula for a Truth Table
p q r output
T T T F
T T F T
T F T T
T F F F
F T T T
F T F T
F F T T
F F F F
Use idea 1 or idea 2. Idea 1: Look at the true rows
and take the “or”.
The formula is true exactly when the input is one of the true rows.
Writing Logical Formula for a Truth Table
Idea 2: Look at the false rows,
negate and take the “and”.
The formula is true exactly when the input is not one of the false row.
p q r output
T T T F
T T F T
T F T T
T F F F
F T T T
F T F T
F F T T
F F F F
Content
1. Mathematical proof (what and why)
2. Logic, basic operators
3. Using simple operators to construct any operator
4. Logical equivalence, DeMorgan’s law
5. Conditional statement (if, if and only if)
6. Arguments
There are many different ways to write the same logical formula.
As we have seen, one can always write a formula using only AND, OR, NOT.
DeMorgan’s Laws
Logical equivalence: Two statements have the same truth table
Statement: Tom is in the football team and the basketball team.
Negation: Tom is not in the football team or not in the basketball team.
De Morgan’s Law
Why the negation of the above statement is not the following
“Tom is not in the football team and not in the basketball team”?
The definition of the negation is that exactly one of P or ¬P is true, but it
could be the case that both the above statement and the original statement
are false (e.g. Tom is in the football team but not in the basketball team).
DeMorgan’s Laws
Logical equivalence: Two statements have the same truth table
Statement: The number 783477841 is divisible by 7 or 11.
Negation: The number 783477841 is not divisible by 7 and not divisible by 11.
De Morgan’s Law
Again, the negation of the above statement is not
“The number 783477841 is not divisible by 7 or not divisible by 11”.
In either case, we “flip” the inside operator from OR to AND or from AND to OR.
DeMorgan’s Laws
Logical equivalence: Two statements have the same truth table
T T F F
T F T T
F T T T
F F T T
De Morgan’s Law
De Morgan’s Law
Simplifying Statement
(Optional) See textbook for more identities.
DeMorgan
Distributive law
The DeMorgan’s Law allows us to always “move the NOT inside”.
We can use logical rules to simplify a logical formula.
Tautology, Contradiction
A tautology is a statement that is always true.
A contradiction is a statement that is always false. (negation of a tautology)
In general it is “difficult” to tell whether a statement is a contradiction.
It is one of the most important problems in CS – the satisfiability problem.
Checkpoint
Key points to know.
1. Write a logical formula from a truth table.
2. Check logical equivalence of two logical formulas.
3. DeMorgan’s rule and other simple logical rules (e.g. distributive).
4. Use simple logical rules to simplify a logical formula.
Content
1. Mathematical proof (what and why)
2. Logic, basic operators
3. Using simple operators to construct any operator
4. Logical equivalence, DeMorgan’s law
5. Conditional statement (if, if and only if)
6. Arguments
Conditional Statement
If p then q
p is called the hypothesis; q is called the conclusion
“If your GPA is 4.0, then you will have full scholarship.”The department says:
When is the above sentence false?
• It is false when your GPA is 4.0 but you don’t receive full scholarship.
• But it is not false if your GPA is below 4.0.
Another example: “If there is typhoon T8 today, then there is no class.”
When is the above sentence false?
p implies q
IMPLIES::=→
Logic Operator
T
T
F
T
P Q
FF
TF
FT
TT
QP
Convention: if we don’t say anything wrong, then it is not false, and thus true.
Make sure you understand the definition of IF.
The IF operation is very important in mathematical proofs.
Logical Equivalence
If you see a question in the above form,
there are usually 3 ways to deal with it.
(1) Truth table
(2) Use logical rules
(3) Intuition
If-Then as Or
T
T
F
T
P Q
FF
TF
FT
TT
QP Idea 2: Look at the false rows,
negate and take the “and”.
•If you don’t give me all your money, then I will kill you.
•Either you give me all your money or I will kill you (or both).
•If you talk to her, then you can never talk to me.
•Either you don’t talk to her or you can never talk to me (or both).
Negation of If-Then
•If you eat an apple everyday, then you have no toothache.
•You eat an apple everyday but you have toothache.
•If my computer is not working, then I cannot finish my homework.
•My computer is not working but I can finish my homework.
previous slide
DeMorgan
Contrapositive
The contrapositive of “if p then q” is “if ~q then ~p”.
Statement: If you drive, then you don’t drink.
Statement: If you are a CS year 1 student,
then you are taking CSC 2110.
Contrapositive: If you drink, then you don’t drive.
Contrapositive: If you are not taking CSC 2110,
then you are not a CS year 1 student.
Fact: A conditional statement is logically equivalent to its contrapositive.
Proofs
Statement: If P, then Q
Contrapositive: If Q, then P.
F F T
T F F
F T T
T T T
T T T
T F F
F T T
F F T
In words, the only way the above statements are false is when P true and Q false.
Contrapositive
Statement: If P, then Q
Contrapositive: If Q, then P.
Or we can see it using logical rules:
Contrapositive is useful in mathematical proofs, e.g. to prove
Statement: If x2
is an even number, then x is an even number.
Contrapositive: If x is an odd number, then x2
is an odd number.
You could instead prove:
This is equivalent and is easier to prove.
If, Only-If
•You succeed if you work hand.
•You succeed only if you work hard.
R if S means “if S then R” or equivalently “S implies R”
We also say S is a sufficient condition for R.
You will succeed if and only if you work hard.
P if and only if (iff) Q means P and Q are logically equivalent.
R only if S means “if R then S” or equivalently “R implies S”
We also say S is a necessary condition for R.
That is, P implies Q and Q implies P.
Necessary AND Sufficient Condition
IFF::=↔
T
F
F
T
P Q
FF
TF
FT
TT
QP
Note: P Q is equivalent to (P Q) (Q P)
Note: P Q is equivalent to (P Q) ( P Q)
Is the statement “x is an even number if and only if x2
is an even number” true?
Math vs English
Parent: if you don’t clean your room, then you can’t watch a DVD.
C D
This sentence says
In real life it also means
So
Mathematician: if a number x greater than 2 is not an odd number,
then x is not a prime number.
This sentence says
But of course it doesn’t mean
Necessary, Sufficient Condition
Mathematician: if a number x greater than 2 is not an odd number,
then x is not a prime number.
This sentence says
But of course it doesn’t mean
Being an odd number > 2 is a necessary condition for this number to be prime.
Being a prime number > 2 is a sufficient condition for this number to be odd.
Checkpoint
 Conditional Statements
• The meaning of IF and its logical forms
• Contrapositive
• If, only if, if and only if
Content
1. Mathematical proof (what and why)
2. Logic, basic operators
3. Using simple operators to construct any operator
4. Logical equivalence, DeMorgan’s law
5. Conditional statement (if, if and only if)
6. Arguments
Argument
An argument is a sequence of statements.
All statements but the final one are called assumptions or hypothesis.
The final statement is called the conclusion.
An argument is valid if:
whenever all the assumptions are true, then the conclusion is true.
If today is Wednesday, then yesterday is Tuesday.
Today is Wednesday.
Yesterday is Tuesday.
Informally, an argument is valid if the conclusion follows from the assumptions.
Argument
An argument is a sequence of statements.
All statements but the final one are called assumptions or hypothesis.
The final statement is called the conclusion.
An argument is valid if:
whenever all the assumptions are true, then the conclusion is true.
1.It is possible to draw a straight line from any point to any other point.
2.It is possible to produce a finite straight line continuously in a straight line.
3.It is possible to describe a circle with any center and any radius.
4.It is true that all right angles are equal to one another.
5.("Parallel postulate") It is true that, if a straight line falling on two straight lines make the interior angles on the same side less than two right angles,
the two straight lines, if produced indefinitely, intersect on that side on which are the angles less than the two right angles.
This is the formal way to prove theorems from axioms.
Pythagorean’s theorem
Modus Ponens
If p then q.
p
q
p q p→q p q
T T T T T
T F F T F
F T T F T
F F T F F
Modus ponens is Latin meaning “method of affirming”.
assumptions conclusion
If typhoon, then class cancelled.
Typhoon.
Class cancelled.
Rule:
Modus Tollens
If p then q.
~q
~p
p q p→q ~q ~p
T T T F F
T F F T F
F T T F T
F F T T T
Modus tollens is Latin meaning “method of denying”.
assumptions conclusion
If typhoon, then class cancelled.
Class not cancelled.
No typhoon.
Rule:
( ), ( ), ( )P Q Q R R P
P Q R
→ → →
∧ ∧
Equivalence
A student is trying to prove that propositions P, Q, and R are all true.
She proceeds as follows.
First, she proves three facts:
• P implies Q
• Q implies R
• R implies P.
Then she concludes,
``Thus P, Q, and R are all true.''
Proposed argument:
Is it valid?
assumption
conclusion
Valid Argument?
assumptions conclusion
P Q 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
T T T
T F T
F T T
F T T
T T F
T F T
T T F
T T T
OK?
T yes
F yes
F yes
F yes
F yes
F yes
F yes
F no
To prove an argument is not valid, we just need to find a counterexample.
( ), ( ), ( )P Q Q R R P
P Q R
→ → →
∧ ∧
Is it valid?
Valid Arguments?
If p then q.
q
p
If you are a fish, then you drink water.
You drink water.
You are a fish.
p q p→q q p
T T T T T
T F F F T
F T T T F
F F T F F
assumptions conclusion
Assumptions are true, but not the conclusion.
Valid Arguments?
If p then q.
~p
~q
If you are a fish, then you drink water.
You are not a fish.
You do not drink water.
p q p→q ~p ~q
T T T F F
T F F F T
F T T T F
F F T T T
assumptions conclusion
Exercises
More Exercises
Valid argument True conclusion
True conclusion Valid argument
Contradiction
If you can show that the assumption that the statement
p is false leads logically to a contradiction,
then you can conclude that p is true.
This is similar to the method of denying (modus tollens)
Truth-tellers and Liers
Truth-tellers always tell the truth.
Liers always lie.
A says: B is a truth-teller.
B says: A and I are of opposite type.
Suppose A is a truth-teller.
Then B is a truth-teller (because what A says is true).
Then A is a lier (because what B says is true)
A contradiction.
So A must be a lier.
So B must be a lier (because what A says is false).
No contradiction.
Quick Summary
Arguments
• definition of a valid argument
• method of affirming, denying, contradiction
Key points:
(1) Make sure you understand conditional statements and contrapositive.
(2) Make sure you can check whether an argument is valid.
“The sentence below is false.”
“The sentence above is true.”
Which is true?
Which is false?

More Related Content

What's hot

Logic (PROPOSITIONS)
Logic (PROPOSITIONS)Logic (PROPOSITIONS)
Logic (PROPOSITIONS)D Nayanathara
 
Chapter 2: Relations
Chapter 2: RelationsChapter 2: Relations
Chapter 2: Relationsnszakir
 
Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inferenceraksharao
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDr. Khaled Bakro
 
Discrete Structures. Lecture 1
 Discrete Structures. Lecture 1  Discrete Structures. Lecture 1
Discrete Structures. Lecture 1 Ali Usman
 
Discrete Mathematics Lecture Notes
Discrete Mathematics Lecture NotesDiscrete Mathematics Lecture Notes
Discrete Mathematics Lecture NotesFellowBuddy.com
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical inductionrey castro
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logicJanet Stemwedel
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
CMSC 56 | Lecture 4: Rules of Inference
CMSC 56 | Lecture 4: Rules of InferenceCMSC 56 | Lecture 4: Rules of Inference
CMSC 56 | Lecture 4: Rules of Inferenceallyn joy calcaben
 
Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)Ikhtiar Khan Sohan
 
Mathematical Logic - Part 1
Mathematical Logic - Part 1Mathematical Logic - Part 1
Mathematical Logic - Part 1blaircomp2003
 
Rules of inference
Rules of inferenceRules of inference
Rules of inferenceLakshmi R
 

What's hot (20)

Formal Logic - Lesson 5 - Logical Equivalence
Formal Logic - Lesson 5 - Logical EquivalenceFormal Logic - Lesson 5 - Logical Equivalence
Formal Logic - Lesson 5 - Logical Equivalence
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
 
Discrete Math Lecture 03: Methods of Proof
Discrete Math Lecture 03: Methods of ProofDiscrete Math Lecture 03: Methods of Proof
Discrete Math Lecture 03: Methods of Proof
 
Recursion DM
Recursion DMRecursion DM
Recursion DM
 
Logic (PROPOSITIONS)
Logic (PROPOSITIONS)Logic (PROPOSITIONS)
Logic (PROPOSITIONS)
 
Chapter 2: Relations
Chapter 2: RelationsChapter 2: Relations
Chapter 2: Relations
 
Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inference
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 
Discrete math Truth Table
Discrete math Truth TableDiscrete math Truth Table
Discrete math Truth Table
 
Discrete Structures. Lecture 1
 Discrete Structures. Lecture 1  Discrete Structures. Lecture 1
Discrete Structures. Lecture 1
 
Discrete Mathematics Lecture Notes
Discrete Mathematics Lecture NotesDiscrete Mathematics Lecture Notes
Discrete Mathematics Lecture Notes
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
 
Set in discrete mathematics
Set in discrete mathematicsSet in discrete mathematics
Set in discrete mathematics
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logic
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
CMSC 56 | Lecture 4: Rules of Inference
CMSC 56 | Lecture 4: Rules of InferenceCMSC 56 | Lecture 4: Rules of Inference
CMSC 56 | Lecture 4: Rules of Inference
 
Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)
 
Mathematical Logic - Part 1
Mathematical Logic - Part 1Mathematical Logic - Part 1
Mathematical Logic - Part 1
 
Rules of inference
Rules of inferenceRules of inference
Rules of inference
 
Recurrence relation
Recurrence relationRecurrence relation
Recurrence relation
 

Viewers also liked

Viewers also liked (16)

Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
Discrete math ppt
Discrete math pptDiscrete math ppt
Discrete math ppt
 
Learn to create Blogspot
Learn to create BlogspotLearn to create Blogspot
Learn to create Blogspot
 
Discrete maths questions
Discrete maths questionsDiscrete maths questions
Discrete maths questions
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
#3 formal methods – propositional logic
#3 formal methods – propositional logic#3 formal methods – propositional logic
#3 formal methods – propositional logic
 
Propositional logic sneha-mam
Propositional logic sneha-mam Propositional logic sneha-mam
Propositional logic sneha-mam
 
Propositional logic for Beginners
Propositional logic for BeginnersPropositional logic for Beginners
Propositional logic for Beginners
 
Logic part1
Logic part1Logic part1
Logic part1
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Proofs by contraposition
Proofs by contrapositionProofs by contraposition
Proofs by contraposition
 
Dm1
Dm1Dm1
Dm1
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
 
Math task 3
Math task 3Math task 3
Math task 3
 
Math
MathMath
Math
 

Similar to Discrete Math Lecture 01: Propositional Logic

Mathematical Logic Part 2
Mathematical Logic Part 2Mathematical Logic Part 2
Mathematical Logic Part 2blaircomp2003
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdfjayarao21
 
Discrete mathematics by sadat sumon
Discrete mathematics by sadat sumonDiscrete mathematics by sadat sumon
Discrete mathematics by sadat sumonsadatsumon
 
Propositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicPropositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicpendragon6626
 
Foundation_Logic_1.pptx discrete mathematics
Foundation_Logic_1.pptx discrete mathematicsFoundation_Logic_1.pptx discrete mathematics
Foundation_Logic_1.pptx discrete mathematicsSherwinSangalang3
 
Is it important to explain a theorem? A case study in UML and ALCQI
Is it important to explain a theorem? A case study in UML and ALCQIIs it important to explain a theorem? A case study in UML and ALCQI
Is it important to explain a theorem? A case study in UML and ALCQIAlexandre Rademaker
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)Nitesh Singh
 
Math Project Presentation New
Math Project Presentation NewMath Project Presentation New
Math Project Presentation Newguestf89f47
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Sabu Francis
 
AI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptxAI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptxAsst.prof M.Gokilavani
 
Module code 124ms Tajvinder Virdee Sets and Log.docx
Module code 124ms  Tajvinder Virdee  Sets and Log.docxModule code 124ms  Tajvinder Virdee  Sets and Log.docx
Module code 124ms Tajvinder Virdee Sets and Log.docxmoirarandell
 
MACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEMACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEDrBindhuM
 

Similar to Discrete Math Lecture 01: Propositional Logic (20)

Mathematical Logic Part 2
Mathematical Logic Part 2Mathematical Logic Part 2
Mathematical Logic Part 2
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
 
Discrete mathematics by sadat sumon
Discrete mathematics by sadat sumonDiscrete mathematics by sadat sumon
Discrete mathematics by sadat sumon
 
artficial intelligence
artficial intelligenceartficial intelligence
artficial intelligence
 
Propositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicPropositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logic
 
Propositional Logic and Pridicate logic
Propositional Logic and Pridicate logicPropositional Logic and Pridicate logic
Propositional Logic and Pridicate logic
 
Foundation_Logic_1.pptx discrete mathematics
Foundation_Logic_1.pptx discrete mathematicsFoundation_Logic_1.pptx discrete mathematics
Foundation_Logic_1.pptx discrete mathematics
 
Is it important to explain a theorem? A case study in UML and ALCQI
Is it important to explain a theorem? A case study in UML and ALCQIIs it important to explain a theorem? A case study in UML and ALCQI
Is it important to explain a theorem? A case study in UML and ALCQI
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
 
Math Project Presentation New
Math Project Presentation NewMath Project Presentation New
Math Project Presentation New
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1
 
04 a ch03_programacion
04 a ch03_programacion04 a ch03_programacion
04 a ch03_programacion
 
AI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptxAI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptx
 
Module code 124ms Tajvinder Virdee Sets and Log.docx
Module code 124ms  Tajvinder Virdee  Sets and Log.docxModule code 124ms  Tajvinder Virdee  Sets and Log.docx
Module code 124ms Tajvinder Virdee Sets and Log.docx
 
Analysis.pptx
Analysis.pptxAnalysis.pptx
Analysis.pptx
 
MACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEMACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULE
 
propositional_logic.pdf
propositional_logic.pdfpropositional_logic.pdf
propositional_logic.pdf
 
S10
S10S10
S10
 
S10
S10S10
S10
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 

Discrete Math Lecture 01: Propositional Logic

  • 2. Content 1. Mathematical proof (what and why) 2. Logic, basic operators 3. Using simple operators to construct any operator 4. Logical equivalence, DeMorgan’s law 5. Conditional statement (if, if and only if) 6. Arguments
  • 3. 2 2 2 a b c+ = Familiar? Obvious? cb a Pythagorean theorem
  • 4. cb a (i) a c×c square, and then (ii) an a×a & a b×b square Good Proof b-a We will show that these five pieces can be rearranged into: b-a And then we can conclude that
  • 5. c cc a b c b-a Good Proof The five pieces can be rearranged into: (i) a c×c square
  • 6. cb a b-a b-a Good Proof How to rearrange them into an axa square and a bxb square?
  • 7. b a a ab-a 74 proofs in http://www.cut-the-knot.org/pythagoras/index.shtml b Good Proof b
  • 8. Bad Proof A similar rearrangement technique shows that 65=64… What’s wrong with the proof?
  • 9. Mathematical Proof To prove mathematical theorems, we need a more rigorous system. http://en.wikipedia.org/wiki/Pythagorean_theoremEuclid’s proof of Pythagorean’s theorem The standard procedure for proving mathematical theorems is invented by Euclid in 300BC. First he started with five axioms (the truth of these statements are taken for granted). Then he uses logic to deduce the truth of other statements. 1.It is possible to draw a straight line from any point to any other point. 2.It is possible to produce a finite straight line continuously in a straight line. 3.It is possible to describe a circle with any center and any radius. 4.It is true that all right angles are equal to one another. 5.("Parallel postulate") It is true that, if a straight line falling on two straight lines make the interior angles on the same side less than two right angles, the two straight lines, if produced indefinitely, intersect on that side on which are the angles less than the two right angles. (Optional) See page 18 of the notes for the ZFC axioms that we now use.
  • 10. Content 1. Mathematical proof (what and why) 2. Logic, basic operators 3. Using simple operators to construct any operator 4. Logical equivalence, DeMorgan’s law 5. Conditional statement (if, if and only if) 6. Arguments Now, we have seen the need of a rigorous proof system. We will proceed to define the basic logic system.
  • 11. Statement (Proposition) A Statement is a sentence that is either True or False Examples: Non-examples: x+y>0 x2 +y2 =z2 True False 2 + 2 = 4 3 x 3 = 8 787009911 is a prime They are true for some values of x and y but are false for some other values of x and y. Today is Tuesday.
  • 12. Logic Operators NOT::=¬ ¬ P is true if and only if P is false Logic operators are used to construct new statements from old statements. There are three main logic operators, NOT, AND, OR. TF FT ¬PP
  • 13. Logic Operators F F F T P Q FF TF FT TT QP AND::=∧ F T T T P Q FF TF FT TT QP OR::=∨ Logic operators are used to construct new statements from old statements. There are three main logic operators, NOT, AND, OR.
  • 14. Compound Statement p = “it is hot” q = “it is sunny” It is hot and sunny It is not hot but sunny It is neither hot nor sunny We can also define logic operators on three or more statements, e.g. OR(P,Q,R)
  • 15. More Logical Operators coffee “or” tea  exclusive-or p q p  q T T F T F T F T T F F F We can define more logical operators as we need. P Q R M(P,Q,R) T T T T T T F T T F T T T F F F F T T T F T F F F F T F F F F F majority
  • 16. Content 1. Mathematical proof (what and why) 2. Logic, basic operators 3. Using simple operators to construct any operator 4. Logical equivalence, DeMorgan’s law 5. Conditional statement (if, if and only if) 6. Arguments We can define as many new operators as we like. But we will see how to construct any operator from AND, OR, NOT.
  • 17. Formula for Exclusive-Or p q T T F T F F T F T T T T F T T T T T F F F F T F Logical equivalence: Two statements have the same truth table Idea 0: Guess and check As you will see, there are many different ways to write the same logical formula. One can always use a truth table to check whether two statements are equivalent.
  • 18. Exclusive-Or Is there a more systematic way to construct such a formula? p q p  q T T F T F T F T T F F F Idea 1: Look at the true rowsIdea 1: Look at the true rowsIdea 1: Look at the true rows Want the formula to be true exactly when the input belongs to a “true” row. The input is the second row exactly if this sub-formula is satisfied And the formula is true exactly when the input is the second row or the third row.
  • 19. Exclusive-Or p q p  q T T F T F T F T T F F F Idea 2: Look at the false rows Want the formula to be true exactly when the input does not belong to a “false” row. The input is the first row exactly if this sub-formula is satisfied And the formula is true exactly when the input is not in the 1st row and the 4th row. Is there a more systematic way to construct such a formula?
  • 20. Writing Logical Formula for a Truth Table Digital logic: Given a digital circuit, we can construct the truth table. Now, suppose we are given only the truth table (i.e. the specification, e.g. the specification of the majority function), how can we construct a digital circuit (i.e. formula) using only simple gates (such as AND, OR, NOT) that has the same function?
  • 21. Writing Logical Formula for a Truth Table p q r output T T T F T T F T T F T T T F F F F T T T F T F T F F T T F F F F Use idea 1 or idea 2. Idea 1: Look at the true rows and take the “or”. The formula is true exactly when the input is one of the true rows.
  • 22. Writing Logical Formula for a Truth Table Idea 2: Look at the false rows, negate and take the “and”. The formula is true exactly when the input is not one of the false row. p q r output T T T F T T F T T F T T T F F F F T T T F T F T F F T T F F F F
  • 23. Content 1. Mathematical proof (what and why) 2. Logic, basic operators 3. Using simple operators to construct any operator 4. Logical equivalence, DeMorgan’s law 5. Conditional statement (if, if and only if) 6. Arguments There are many different ways to write the same logical formula. As we have seen, one can always write a formula using only AND, OR, NOT.
  • 24. DeMorgan’s Laws Logical equivalence: Two statements have the same truth table Statement: Tom is in the football team and the basketball team. Negation: Tom is not in the football team or not in the basketball team. De Morgan’s Law Why the negation of the above statement is not the following “Tom is not in the football team and not in the basketball team”? The definition of the negation is that exactly one of P or ¬P is true, but it could be the case that both the above statement and the original statement are false (e.g. Tom is in the football team but not in the basketball team).
  • 25. DeMorgan’s Laws Logical equivalence: Two statements have the same truth table Statement: The number 783477841 is divisible by 7 or 11. Negation: The number 783477841 is not divisible by 7 and not divisible by 11. De Morgan’s Law Again, the negation of the above statement is not “The number 783477841 is not divisible by 7 or not divisible by 11”. In either case, we “flip” the inside operator from OR to AND or from AND to OR.
  • 26. DeMorgan’s Laws Logical equivalence: Two statements have the same truth table T T F F T F T T F T T T F F T T De Morgan’s Law De Morgan’s Law
  • 27. Simplifying Statement (Optional) See textbook for more identities. DeMorgan Distributive law The DeMorgan’s Law allows us to always “move the NOT inside”. We can use logical rules to simplify a logical formula.
  • 28. Tautology, Contradiction A tautology is a statement that is always true. A contradiction is a statement that is always false. (negation of a tautology) In general it is “difficult” to tell whether a statement is a contradiction. It is one of the most important problems in CS – the satisfiability problem.
  • 29. Checkpoint Key points to know. 1. Write a logical formula from a truth table. 2. Check logical equivalence of two logical formulas. 3. DeMorgan’s rule and other simple logical rules (e.g. distributive). 4. Use simple logical rules to simplify a logical formula.
  • 30. Content 1. Mathematical proof (what and why) 2. Logic, basic operators 3. Using simple operators to construct any operator 4. Logical equivalence, DeMorgan’s law 5. Conditional statement (if, if and only if) 6. Arguments
  • 31. Conditional Statement If p then q p is called the hypothesis; q is called the conclusion “If your GPA is 4.0, then you will have full scholarship.”The department says: When is the above sentence false? • It is false when your GPA is 4.0 but you don’t receive full scholarship. • But it is not false if your GPA is below 4.0. Another example: “If there is typhoon T8 today, then there is no class.” When is the above sentence false? p implies q
  • 32. IMPLIES::=→ Logic Operator T T F T P Q FF TF FT TT QP Convention: if we don’t say anything wrong, then it is not false, and thus true. Make sure you understand the definition of IF. The IF operation is very important in mathematical proofs.
  • 33. Logical Equivalence If you see a question in the above form, there are usually 3 ways to deal with it. (1) Truth table (2) Use logical rules (3) Intuition
  • 34. If-Then as Or T T F T P Q FF TF FT TT QP Idea 2: Look at the false rows, negate and take the “and”. •If you don’t give me all your money, then I will kill you. •Either you give me all your money or I will kill you (or both). •If you talk to her, then you can never talk to me. •Either you don’t talk to her or you can never talk to me (or both).
  • 35. Negation of If-Then •If you eat an apple everyday, then you have no toothache. •You eat an apple everyday but you have toothache. •If my computer is not working, then I cannot finish my homework. •My computer is not working but I can finish my homework. previous slide DeMorgan
  • 36. Contrapositive The contrapositive of “if p then q” is “if ~q then ~p”. Statement: If you drive, then you don’t drink. Statement: If you are a CS year 1 student, then you are taking CSC 2110. Contrapositive: If you drink, then you don’t drive. Contrapositive: If you are not taking CSC 2110, then you are not a CS year 1 student. Fact: A conditional statement is logically equivalent to its contrapositive.
  • 37. Proofs Statement: If P, then Q Contrapositive: If Q, then P. F F T T F F F T T T T T T T T T F F F T T F F T In words, the only way the above statements are false is when P true and Q false.
  • 38. Contrapositive Statement: If P, then Q Contrapositive: If Q, then P. Or we can see it using logical rules: Contrapositive is useful in mathematical proofs, e.g. to prove Statement: If x2 is an even number, then x is an even number. Contrapositive: If x is an odd number, then x2 is an odd number. You could instead prove: This is equivalent and is easier to prove.
  • 39. If, Only-If •You succeed if you work hand. •You succeed only if you work hard. R if S means “if S then R” or equivalently “S implies R” We also say S is a sufficient condition for R. You will succeed if and only if you work hard. P if and only if (iff) Q means P and Q are logically equivalent. R only if S means “if R then S” or equivalently “R implies S” We also say S is a necessary condition for R. That is, P implies Q and Q implies P.
  • 40. Necessary AND Sufficient Condition IFF::=↔ T F F T P Q FF TF FT TT QP Note: P Q is equivalent to (P Q) (Q P) Note: P Q is equivalent to (P Q) ( P Q) Is the statement “x is an even number if and only if x2 is an even number” true?
  • 41. Math vs English Parent: if you don’t clean your room, then you can’t watch a DVD. C D This sentence says In real life it also means So Mathematician: if a number x greater than 2 is not an odd number, then x is not a prime number. This sentence says But of course it doesn’t mean
  • 42. Necessary, Sufficient Condition Mathematician: if a number x greater than 2 is not an odd number, then x is not a prime number. This sentence says But of course it doesn’t mean Being an odd number > 2 is a necessary condition for this number to be prime. Being a prime number > 2 is a sufficient condition for this number to be odd.
  • 43. Checkpoint  Conditional Statements • The meaning of IF and its logical forms • Contrapositive • If, only if, if and only if
  • 44. Content 1. Mathematical proof (what and why) 2. Logic, basic operators 3. Using simple operators to construct any operator 4. Logical equivalence, DeMorgan’s law 5. Conditional statement (if, if and only if) 6. Arguments
  • 45. Argument An argument is a sequence of statements. All statements but the final one are called assumptions or hypothesis. The final statement is called the conclusion. An argument is valid if: whenever all the assumptions are true, then the conclusion is true. If today is Wednesday, then yesterday is Tuesday. Today is Wednesday. Yesterday is Tuesday. Informally, an argument is valid if the conclusion follows from the assumptions.
  • 46. Argument An argument is a sequence of statements. All statements but the final one are called assumptions or hypothesis. The final statement is called the conclusion. An argument is valid if: whenever all the assumptions are true, then the conclusion is true. 1.It is possible to draw a straight line from any point to any other point. 2.It is possible to produce a finite straight line continuously in a straight line. 3.It is possible to describe a circle with any center and any radius. 4.It is true that all right angles are equal to one another. 5.("Parallel postulate") It is true that, if a straight line falling on two straight lines make the interior angles on the same side less than two right angles, the two straight lines, if produced indefinitely, intersect on that side on which are the angles less than the two right angles. This is the formal way to prove theorems from axioms. Pythagorean’s theorem
  • 47. Modus Ponens If p then q. p q p q p→q p q T T T T T T F F T F F T T F T F F T F F Modus ponens is Latin meaning “method of affirming”. assumptions conclusion If typhoon, then class cancelled. Typhoon. Class cancelled. Rule:
  • 48. Modus Tollens If p then q. ~q ~p p q p→q ~q ~p T T T F F T F F T F F T T F T F F T T T Modus tollens is Latin meaning “method of denying”. assumptions conclusion If typhoon, then class cancelled. Class not cancelled. No typhoon. Rule:
  • 49. ( ), ( ), ( )P Q Q R R P P Q R → → → ∧ ∧ Equivalence A student is trying to prove that propositions P, Q, and R are all true. She proceeds as follows. First, she proves three facts: • P implies Q • Q implies R • R implies P. Then she concludes, ``Thus P, Q, and R are all true.'' Proposed argument: Is it valid? assumption conclusion
  • 50. Valid Argument? assumptions conclusion P Q 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 T T T T F T F T T F T T T T F T F T T T F T T T OK? T yes F yes F yes F yes F yes F yes F yes F no To prove an argument is not valid, we just need to find a counterexample. ( ), ( ), ( )P Q Q R R P P Q R → → → ∧ ∧ Is it valid?
  • 51. Valid Arguments? If p then q. q p If you are a fish, then you drink water. You drink water. You are a fish. p q p→q q p T T T T T T F F F T F T T T F F F T F F assumptions conclusion Assumptions are true, but not the conclusion.
  • 52. Valid Arguments? If p then q. ~p ~q If you are a fish, then you drink water. You are not a fish. You do not drink water. p q p→q ~p ~q T T T F F T F F F T F T T T F F F T T T assumptions conclusion
  • 54. More Exercises Valid argument True conclusion True conclusion Valid argument
  • 55. Contradiction If you can show that the assumption that the statement p is false leads logically to a contradiction, then you can conclude that p is true. This is similar to the method of denying (modus tollens)
  • 56. Truth-tellers and Liers Truth-tellers always tell the truth. Liers always lie. A says: B is a truth-teller. B says: A and I are of opposite type. Suppose A is a truth-teller. Then B is a truth-teller (because what A says is true). Then A is a lier (because what B says is true) A contradiction. So A must be a lier. So B must be a lier (because what A says is false). No contradiction.
  • 57. Quick Summary Arguments • definition of a valid argument • method of affirming, denying, contradiction Key points: (1) Make sure you understand conditional statements and contrapositive. (2) Make sure you can check whether an argument is valid.
  • 58. “The sentence below is false.” “The sentence above is true.” Which is true? Which is false?