SlideShare a Scribd company logo
1 of 52
Mathematical Logic
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
Mathematical Proof 
To prove mathematical theorems, we need a more rigorous system. 
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. 
Euclid’s proof of Pythagorean’s theorem http://en.wikipedia.org/wiki/Pythagorean_theorem 
(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: 
Today is Tuesday. 
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.
Logic Operators 
Logic operators are used to construct new statements from old statements. 
There are three main logic operators, NOT, AND, OR. 
 :: NOT ¬ P is true if and only if P is false 
P ¬P 
T F 
F T
Logic Operators 
Logic operators are used to construct new statements from old statements. 
There are three main logic operators, NOT, AND, OR. 
 :: AND 
P Q 
T 
F 
F 
F 
P Q 
T T 
T F 
F T 
F F 
 :: OR 
P Q 
T 
T 
T 
F 
P Q 
T T 
T F 
F T 
F F
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 
We can define more logical operators as we need. 
coffee “or” tea 
 exclusive-or 
p q p  q 
T T F 
T F T 
F T T 
F F F 
majority 
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
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 
Idea 0: Guess and check 
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 
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 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 
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 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.
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 
Use idea 1 or idea 2. Idea 1: Look at the true rows 
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 
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”. 
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 
The formula is true exactly when the input is not one of the false row.
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 
De Morgan’s Law 
T T F F 
T F T T 
F T T T 
F F T T 
De Morgan’s Law
Simplifying Statement 
We can use logical rules to simplify a logical formula. 
DeMorgan 
Distributive law 
The DeMorgan’s Law allows us to always “move the NOT inside”. 
(Optional) See textbook for more identities.
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 implies q 
p is called the hypothesis; q is called the conclusion 
The department says: “If your GPA is 4.0, then you will have full scholarship.” 
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?
Logic Operator 
 :: IMPLIES 
P Q 
T 
F 
T 
T 
P Q 
T T 
T F 
F T 
F F 
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 
P Q 
T 
F 
T 
T 
P Q 
T T 
T F 
F T 
F F 
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 are a CS year 1 student, 
then you are taking CSC 2110. 
Contrapositive: If you are not taking CSC 2110, 
then you are not a CS year 1 student. 
Statement: If you drive, then you don’t drink. 
Contrapositive: If you drink, then you don’t drive. 
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. 
You could instead prove: 
Contrapositive: If x is an odd number, then x2 is an odd number. 
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. 
R only if S means “if R then S” or equivalently “R implies S” 
We also say S is a necessary 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. 
That is, P implies Q and Q implies P.
Necessary AND Sufficient Condition 
 :: IFF 
P Q 
T 
F 
F 
T 
P Q 
T T 
T F 
F T 
F F 
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. 
Pythagorean’s theorem 
This is the formal way to prove theorems from axioms.
Modus Ponens 
If p then q. 
p 
q 
If typhoon, then class cancelled. 
Typhoon. 
Class cancelled. 
assumptions conclusion 
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”. 
Rule:
Modus Tollens 
If p then q. 
~q 
~p 
If typhoon, then class cancelled. 
Class not cancelled. 
No typhoon. 
assumptions conclusion 
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”. 
Rule:
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  Q), (Q  R), (R  
P) 
P Q R 
  
• 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? 
(P  Q), (Q  R), (R  
P) 
P Q R 
  
Is it valid? 
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.
Valid Arguments? 
If p then q. 
q 
p 
assumptions conclusion 
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 are true, but not the conclusion. 
If you are a fish, then you drink water. 
You drink water. 
You are a fish.
Valid Arguments? 
If p then q. 
~p 
~q 
assumptions conclusion 
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 
If you are a fish, then you drink water. 
You are not a fish. 
You do not drink water.
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.
Which is true? 
Which is false? 
“The sentence below is false.” 
“The sentence above is true.”

More Related Content

What's hot

Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Amr Rashed
 
3) quadratic vertex form
3) quadratic vertex form3) quadratic vertex form
3) quadratic vertex formestelav
 
Chapter 4 logical reasoning
Chapter 4 logical reasoningChapter 4 logical reasoning
Chapter 4 logical reasoningJaypee Sidon
 
multiple choice variation exam.docx
multiple choice variation exam.docxmultiple choice variation exam.docx
multiple choice variation exam.docxKatherine Bautista
 
Introduction to inductive and deductive reasoning
Introduction to inductive and deductive reasoningIntroduction to inductive and deductive reasoning
Introduction to inductive and deductive reasoningrbangerter
 
Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inferenceraksharao
 
1.3.1 Inductive and Deductive Reasoning
1.3.1 Inductive and Deductive Reasoning1.3.1 Inductive and Deductive Reasoning
1.3.1 Inductive and Deductive Reasoningsmiller5
 
Differential Equations
Differential EquationsDifferential Equations
Differential EquationsKrupaSuthar3
 
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
 
Grade 8-if-then-statement
Grade 8-if-then-statementGrade 8-if-then-statement
Grade 8-if-then-statementAnnalizaTenioso
 
Permutations & Combinations
Permutations & CombinationsPermutations & Combinations
Permutations & Combinationsrfant
 
Formal Logic - Lesson 4 - Tautology, Contradiction and Contingency
Formal Logic - Lesson 4 - Tautology, Contradiction and ContingencyFormal Logic - Lesson 4 - Tautology, Contradiction and Contingency
Formal Logic - Lesson 4 - Tautology, Contradiction and ContingencyLaguna State Polytechnic University
 

What's hot (20)

Inductive vs deductive reasoning
Inductive vs deductive reasoningInductive vs deductive reasoning
Inductive vs deductive reasoning
 
Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1
 
Echelon forms
Echelon formsEchelon forms
Echelon forms
 
Truth table
Truth tableTruth table
Truth table
 
3) quadratic vertex form
3) quadratic vertex form3) quadratic vertex form
3) quadratic vertex form
 
Chapter 4 logical reasoning
Chapter 4 logical reasoningChapter 4 logical reasoning
Chapter 4 logical reasoning
 
multiple choice variation exam.docx
multiple choice variation exam.docxmultiple choice variation exam.docx
multiple choice variation exam.docx
 
Discrete math Truth Table
Discrete math Truth TableDiscrete math Truth Table
Discrete math Truth Table
 
Introduction to inductive and deductive reasoning
Introduction to inductive and deductive reasoningIntroduction to inductive and deductive reasoning
Introduction to inductive and deductive reasoning
 
Topology M.Sc. 2 semester Mathematics compactness, unit - 4
Topology M.Sc. 2 semester Mathematics compactness, unit - 4Topology M.Sc. 2 semester Mathematics compactness, unit - 4
Topology M.Sc. 2 semester Mathematics compactness, unit - 4
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inference
 
1.3.1 Inductive and Deductive Reasoning
1.3.1 Inductive and Deductive Reasoning1.3.1 Inductive and Deductive Reasoning
1.3.1 Inductive and Deductive Reasoning
 
Differential Equations
Differential EquationsDifferential Equations
Differential Equations
 
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 د. خالد بكرو
 
Mathematical Logic
Mathematical LogicMathematical Logic
Mathematical Logic
 
Grade 8-if-then-statement
Grade 8-if-then-statementGrade 8-if-then-statement
Grade 8-if-then-statement
 
Permutations & Combinations
Permutations & CombinationsPermutations & Combinations
Permutations & Combinations
 
Calculus
CalculusCalculus
Calculus
 
Formal Logic - Lesson 4 - Tautology, Contradiction and Contingency
Formal Logic - Lesson 4 - Tautology, Contradiction and ContingencyFormal Logic - Lesson 4 - Tautology, Contradiction and Contingency
Formal Logic - Lesson 4 - Tautology, Contradiction and Contingency
 

Viewers also liked

Introduction to Logic
Introduction to LogicIntroduction to Logic
Introduction to LogicRuby Angela
 
Logical mathematical intelligence
Logical mathematical intelligenceLogical mathematical intelligence
Logical mathematical intelligenceEli Adame
 
Unit 5 Geometry Logic Vocabulary
Unit 5 Geometry Logic VocabularyUnit 5 Geometry Logic Vocabulary
Unit 5 Geometry Logic Vocabularyrrmwpease
 
Exercise 1
Exercise 1Exercise 1
Exercise 1Amr Nady
 
Hacking Java - Enhancing Java Code at Build or Runtime
Hacking Java - Enhancing Java Code at Build or RuntimeHacking Java - Enhancing Java Code at Build or Runtime
Hacking Java - Enhancing Java Code at Build or RuntimeSean P. Floyd
 
Logika Matematika; Penarikan Kesimpulan
Logika Matematika; Penarikan KesimpulanLogika Matematika; Penarikan Kesimpulan
Logika Matematika; Penarikan KesimpulanMaya Sy
 
Maths ppt by x d
Maths ppt by x dMaths ppt by x d
Maths ppt by x dalex john
 
Logical Operators in Brief with examples
Logical Operators in Brief with examplesLogical Operators in Brief with examples
Logical Operators in Brief with examplesMujtaBa Khan
 
Logic
LogicLogic
LogicH K
 
Interpersonal inlelligence & intrapersonal intelligence
Interpersonal inlelligence & intrapersonal intelligenceInterpersonal inlelligence & intrapersonal intelligence
Interpersonal inlelligence & intrapersonal intelligenceRohit Goel
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2Ali Usman
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inferenceSlideshare
 
Truth tables
Truth tablesTruth tables
Truth tableswalkerlj
 

Viewers also liked (20)

Introduction to Logic
Introduction to LogicIntroduction to Logic
Introduction to Logic
 
Logic introduction
Logic   introductionLogic   introduction
Logic introduction
 
Logical mathematical intelligence
Logical mathematical intelligenceLogical mathematical intelligence
Logical mathematical intelligence
 
Logic Ppt
Logic PptLogic Ppt
Logic Ppt
 
Unit 5 Geometry Logic Vocabulary
Unit 5 Geometry Logic VocabularyUnit 5 Geometry Logic Vocabulary
Unit 5 Geometry Logic Vocabulary
 
Exercise 1
Exercise 1Exercise 1
Exercise 1
 
Hacking Java - Enhancing Java Code at Build or Runtime
Hacking Java - Enhancing Java Code at Build or RuntimeHacking Java - Enhancing Java Code at Build or Runtime
Hacking Java - Enhancing Java Code at Build or Runtime
 
Logical mathematical
Logical mathematicalLogical mathematical
Logical mathematical
 
Logika Matematika; Penarikan Kesimpulan
Logika Matematika; Penarikan KesimpulanLogika Matematika; Penarikan Kesimpulan
Logika Matematika; Penarikan Kesimpulan
 
Proof by contradiction
Proof by contradictionProof by contradiction
Proof by contradiction
 
Bba2
Bba2Bba2
Bba2
 
Maths ppt by x d
Maths ppt by x dMaths ppt by x d
Maths ppt by x d
 
Logical Operators in Brief with examples
Logical Operators in Brief with examplesLogical Operators in Brief with examples
Logical Operators in Brief with examples
 
Logic
LogicLogic
Logic
 
Interpersonal inlelligence & intrapersonal intelligence
Interpersonal inlelligence & intrapersonal intelligenceInterpersonal inlelligence & intrapersonal intelligence
Interpersonal inlelligence & intrapersonal intelligence
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
 
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
 
Logic&proof
Logic&proofLogic&proof
Logic&proof
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inference
 
Truth tables
Truth tablesTruth tables
Truth tables
 

Similar to Mathematical Logic Part 2

Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicIT Engineering Department
 
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
 
1Week 3 Section 1.4 Predicates and Quantifiers As.docx
 1Week 3 Section 1.4 Predicates and Quantifiers  As.docx 1Week 3 Section 1.4 Predicates and Quantifiers  As.docx
1Week 3 Section 1.4 Predicates and Quantifiers As.docxjoyjonna282
 
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
 
maths module social science.pdf
maths module social science.pdfmaths module social science.pdf
maths module social science.pdfShwaBeli
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxPriyalMayurManvar
 
Arguments in discreate structures and stuff
Arguments in discreate structures and stuffArguments in discreate structures and stuff
Arguments in discreate structures and stuffZenLooper
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicUniversity of Potsdam
 
the halting_problem
the halting_problemthe halting_problem
the halting_problemRajendran
 
MACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEMACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEDrBindhuM
 

Similar to Mathematical Logic Part 2 (20)

Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional Logic
 
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
 
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
 
Mathematical Reasoning DM
Mathematical Reasoning DMMathematical Reasoning DM
Mathematical Reasoning DM
 
propositional_logic.pdf
propositional_logic.pdfpropositional_logic.pdf
propositional_logic.pdf
 
4AMT122-PART 1-SLIDES.pptx
4AMT122-PART 1-SLIDES.pptx4AMT122-PART 1-SLIDES.pptx
4AMT122-PART 1-SLIDES.pptx
 
1Week 3 Section 1.4 Predicates and Quantifiers As.docx
 1Week 3 Section 1.4 Predicates and Quantifiers  As.docx 1Week 3 Section 1.4 Predicates and Quantifiers  As.docx
1Week 3 Section 1.4 Predicates and Quantifiers As.docx
 
Analysis.pptx
Analysis.pptxAnalysis.pptx
Analysis.pptx
 
Propositional Logic and Pridicate logic
Propositional Logic and Pridicate logicPropositional Logic and Pridicate logic
Propositional Logic and Pridicate logic
 
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
 
maths module social science.pdf
maths module social science.pdfmaths module social science.pdf
maths module social science.pdf
 
Bab 1 proposisi
Bab 1 proposisiBab 1 proposisi
Bab 1 proposisi
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptx
 
Arguments in discreate structures and stuff
Arguments in discreate structures and stuffArguments in discreate structures and stuff
Arguments in discreate structures and stuff
 
AppTheories_L3
AppTheories_L3AppTheories_L3
AppTheories_L3
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional Logic
 
the halting_problem
the halting_problemthe halting_problem
the halting_problem
 
Course notes1
Course notes1Course notes1
Course notes1
 
MACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEMACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULE
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
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
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
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
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
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
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
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
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
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
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

Mathematical Logic Part 2

  • 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. Mathematical Proof To prove mathematical theorems, we need a more rigorous system. 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. Euclid’s proof of Pythagorean’s theorem http://en.wikipedia.org/wiki/Pythagorean_theorem (Optional) See page 18 of the notes for the ZFC axioms that we now use.
  • 4. 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.
  • 5. Statement (Proposition) A Statement is a sentence that is either True or False Examples: Today is Tuesday. 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.
  • 6. Logic Operators Logic operators are used to construct new statements from old statements. There are three main logic operators, NOT, AND, OR.  :: NOT ¬ P is true if and only if P is false P ¬P T F F T
  • 7. Logic Operators Logic operators are used to construct new statements from old statements. There are three main logic operators, NOT, AND, OR.  :: AND P Q T F F F P Q T T T F F T F F  :: OR P Q T T T F P Q T T T F F T F F
  • 8. 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)
  • 9. More Logical Operators We can define more logical operators as we need. coffee “or” tea  exclusive-or p q p  q T T F T F T F T T F F F majority 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
  • 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 We can define as many new operators as we like. But we will see how to construct any operator from AND, OR, NOT.
  • 11. Formula for Exclusive-Or Idea 0: Guess and check 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 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.
  • 12. 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 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.
  • 13. 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 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.
  • 14. 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?
  • 15. Writing Logical Formula for a Truth Table Use idea 1 or idea 2. Idea 1: Look at the true rows 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 and take the “or”. The formula is true exactly when the input is one of the true rows.
  • 16. Writing Logical Formula for a Truth Table Idea 2: Look at the false rows, negate and take the “and”. 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 The formula is true exactly when the input is not one of the false row.
  • 17. 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.
  • 18. 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).
  • 19. 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.
  • 20. DeMorgan’s Laws Logical equivalence: Two statements have the same truth table De Morgan’s Law T T F F T F T T F T T T F F T T De Morgan’s Law
  • 21. Simplifying Statement We can use logical rules to simplify a logical formula. DeMorgan Distributive law The DeMorgan’s Law allows us to always “move the NOT inside”. (Optional) See textbook for more identities.
  • 22. 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.
  • 23. 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.
  • 24. 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
  • 25. Conditional Statement If p then q p implies q p is called the hypothesis; q is called the conclusion The department says: “If your GPA is 4.0, then you will have full scholarship.” 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?
  • 26. Logic Operator  :: IMPLIES P Q T F T T P Q T T T F F T F F 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.
  • 27. 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
  • 28. If-Then as Or P Q T F T T P Q T T T F F T F F 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).
  • 29. 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
  • 30. Contrapositive The contrapositive of “if p then q” is “if ~q then ~p”. Statement: If you are a CS year 1 student, then you are taking CSC 2110. Contrapositive: If you are not taking CSC 2110, then you are not a CS year 1 student. Statement: If you drive, then you don’t drink. Contrapositive: If you drink, then you don’t drive. Fact: A conditional statement is logically equivalent to its contrapositive.
  • 31. 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.
  • 32. 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. You could instead prove: Contrapositive: If x is an odd number, then x2 is an odd number. This is equivalent and is easier to prove.
  • 33. 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. R only if S means “if R then S” or equivalently “R implies S” We also say S is a necessary 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. That is, P implies Q and Q implies P.
  • 34. Necessary AND Sufficient Condition  :: IFF P Q T F F T P Q T T T F F T F F 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?
  • 35. 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
  • 36. 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.
  • 37. Checkpoint  Conditional Statements • The meaning of IF and its logical forms • Contrapositive • If, only if, if and only if
  • 38. 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
  • 39. 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.
  • 40. 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. Pythagorean’s theorem This is the formal way to prove theorems from axioms.
  • 41. Modus Ponens If p then q. p q If typhoon, then class cancelled. Typhoon. Class cancelled. assumptions conclusion 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”. Rule:
  • 42. Modus Tollens If p then q. ~q ~p If typhoon, then class cancelled. Class not cancelled. No typhoon. assumptions conclusion 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”. Rule:
  • 43. 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  Q), (Q  R), (R  P) P Q R   • 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
  • 44. Valid Argument? (P  Q), (Q  R), (R  P) P Q R   Is it valid? 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.
  • 45. Valid Arguments? If p then q. q p assumptions conclusion 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 are true, but not the conclusion. If you are a fish, then you drink water. You drink water. You are a fish.
  • 46. Valid Arguments? If p then q. ~p ~q assumptions conclusion 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 If you are a fish, then you drink water. You are not a fish. You do not drink water.
  • 48. More Exercises Valid argument True conclusion True conclusion Valid argument
  • 49. 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)
  • 50. 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.
  • 51. 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.
  • 52. Which is true? Which is false? “The sentence below is false.” “The sentence above is true.”