Download CSE 20 - Lecture 14: Logic and Proof Techniques

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Turing's proof wikipedia , lookup

History of the function concept wikipedia , lookup

Axiom of reducibility wikipedia , lookup

Inquiry wikipedia , lookup

Modal logic wikipedia , lookup

Jesús Mosterín wikipedia , lookup

Gödel's incompleteness theorems wikipedia , lookup

Set theory wikipedia , lookup

History of logic wikipedia , lookup

Combinatory logic wikipedia , lookup

Sequent calculus wikipedia , lookup

Foundations of mathematics wikipedia , lookup

Propositional formula wikipedia , lookup

Catuṣkoṭi wikipedia , lookup

Naive set theory wikipedia , lookup

Syllogism wikipedia , lookup

Laws of Form wikipedia , lookup

Interpretation (logic) wikipedia , lookup

Quantum logic wikipedia , lookup

Truth-bearer wikipedia , lookup

Mathematical logic wikipedia , lookup

Natural deduction wikipedia , lookup

Theorem wikipedia , lookup

Propositional calculus wikipedia , lookup

Intuitionistic logic wikipedia , lookup

Curry–Howard correspondence wikipedia , lookup

Law of thought wikipedia , lookup

Principia Mathematica wikipedia , lookup

Mathematical proof wikipedia , lookup

Transcript
CSE 20
Lecture 14: Logic and Proof Techniques
CSE 20: Lecture 14
Midterm Review
Representation of integers in base b
Logic
Proof systems:
Direct Proof
Proof by contradiction
Contraposetive
Sets Theory
Functions
CSE 20: Lecture 14
Midterm Review
Representation of integers in base b
Logic
Proof systems:
Direct Proof
Proof by contradiction
Contraposetive
Sets Theory
Functions
NO CALCULATOR, NO CHEAT SHEET
CSE 20: Lecture 14
Use of Propositional Logic
Check the correctness of a statement: whether a
sentence/paragraph/proposition is logically correct.
CSE 20: Lecture 14
Use of Propositional Logic
Check the correctness of a statement: whether a
sentence/paragraph/proposition is logically correct.
Make deductions
CSE 20: Lecture 14
Use of Propositional Logic
Check the correctness of a statement: whether a
sentence/paragraph/proposition is logically correct.
Make deductions
Check if two propositions are equivalent.
CSE 20: Lecture 14
Equivalence of statements/propositions
If the truthtables of two statement/propositions are
identical then the two statement/propositions are
equivalent
One can also use various rules for propositional logic.
CSE 20: Lecture 14
Rules of Propositional Logic
1
Commutative law:
(p ∨ q) = (q ∨ p) and (p ∧ q) = (q ∧ p)
2
Associative law:
(p ∨ (q ∨ r)) = ((p ∨ q) ∨ r) and
(p ∧ (q ∧ r)) = ((p ∧ q) ∧ r)
3
Distributive law:
(p ∨ (q ∧ r)) = (p ∨ q) ∧ (p ∨ r) and
(p ∧ (q ∨ r)) = (p ∧ q) ∨ (p ∧ r)
4
De Morgan’s Law:
¬(p ∨ q) = (¬p ∧ ¬q) and ¬(p ∧ q) = (¬p ∨ ¬q)
CSE 20: Lecture 14
Equivalence of Statement: iclicker Question 1
Which of the following is equivalent to A =⇒ B
A.
B.
C.
D.
E.
(¬B ∨ A) = F alse
(¬A ∧ B) = F alse
(¬B ∧ A) = F alse
¬A =⇒ ¬B
(¬B ∨ A)
CSE 20: Lecture 14
Proof Techniques
To prove statement B from A:
CSE 20: Lecture 14
Proof Techniques
To prove statement B from A:
Direct Proof:
A =⇒ B
CSE 20: Lecture 14
Proof Techniques
To prove statement B from A:
Direct Proof:
A =⇒ B
Proof by contradiction:
(¬B ∧ A) gives a contradiction
CSE 20: Lecture 14
Proof Techniques
To prove statement B from A:
Direct Proof:
A =⇒ B
Proof by contradiction:
(¬B ∧ A) gives a contradiction
Proof by Contraposetive: A =⇒ B is same as proving
¬B =⇒ ¬A.
CSE 20: Lecture 14
Sets
Sets
For example:
Set of names of all students
CSE 20: Lecture 14
Sets
Sets
For example:
Set of names of all students
Set of letters in the english alphabet
CSE 20: Lecture 14
Sets
Sets
For example:
Set of names of all students
Set of letters in the english alphabet
Set of digits. {0, 1, . . . , 9} or {0, 1}
Size of a set is the number of elements in the set.
Size of set A is denoted by |A|.
CSE 20: Lecture 14
Operations on Sets
Union, ∪.
A ∪ B is the set of all elements that are in A OR B.
Intesection, ∩
A ∩ B is the set of all elements that are in A AND B.
Complement, Ac or A
Ac is the set of elements N OT in A.
Cartesan Product.
CSE 20: Lecture 14
Rules of Set Theory
Let p, q and r be sets.
1
Commutative law:
(p ∪ q) = (q ∪ p) and (p ∩ q) = (q ∩ p)
2
Associative law:
(p ∪ (q ∪ r)) = ((p ∪ q) ∪ r) and
(p ∩ (q ∩ r)) = ((p ∩ q) ∩ r)
3
Distributive law:
(p ∪ (q ∩ r)) = (p ∪ q) ∩ (p ∪ r) and
(p ∩ (q ∪ r)) = (p ∩ q) ∪ (p ∩ r)
4
De Morgan’s Law:
(p ∪ q)c = (pc ∩ q c ) and (p ∩ q)c = (pc ∪ q c )
CSE 20: Lecture 14
Set Theory and Propositional Logic
Set Theory and Propositional Logic is two mathematical
language which follow very similar rules.
CSE 20: Lecture 14
iclicker Question 2
If A and B are two sets such that size of A is 10 and size of
B is 12. If size of A ∪ B is 20 what is size of A ∩ B.
A
B
C
D
E
2
3
10
22
Can’t be said.
CSE 20: Lecture 14
iclicker Question 3
If A and B are two sets such that size of A is 10 and size of
B is 12. If size of A ∩ B is 4 what is size of A\B.
A
B
C
D
E
2
3
6
10
Can’t be said.
CSE 20: Lecture 14
iclicker Question 4
If A and B are two sets such that size of A is 10 and size of
B is 12. How many functions are there from A to B.
A
B
C
D
E
1012
1210
120
12
None of the above.
CSE 20: Lecture 14
Propositional Logic
Every statement is either TRUE or FALSE
There are logical connectives ∨, ∧, ¬, =⇒ and ⇐⇒ .
Two logical statements can be equivalent if the two
statements answer exactly in the same way on every
input.
To check whether two logical statements are equivalent
one can do one of the following:
Checking the Truthtable of each statement
Reducing one to the other using reductions
CSE 20: Lecture 14
Predicate Logic
There are two important symbols: ∀ and ∃.
Some statements can be defined using a variable.
For example: Px = “4x2 + 3 is divisible by 5”
We can have statements like: ∀x ∈ Z, 4x2 + 3 is
divisible by 5.
Or ∃x ∈ Z, 4x2 + 3 is divisible by 5.
CSE 20: Lecture 14
Rules of negation
¬(∀x, Px ) = (∃x, ¬Px ).
¬(∃x, Px ) = (∀x, ¬Px ).
CSE 20: Lecture 14
Negating a sentence: iclicker
What is the negation of the sentence: “There is an
university in USA where every department has at least 20
faculty and at least one noble laureate.”
CSE 20: Lecture 14
Negating a sentence: iclicker
What is the negation of the sentence: “There is an
university in USA where every department has at least 20
faculty and at least one noble laureate.”
There is an university in USA where every department
has less than 20 faculty and at least one noble laureate.
All universitis in USA where every department has at
least 20 faculty and at least one noble laureate.
For all universities in USA there is a department has
less than 20 faculty or at most one noble laureate.
For all universities in USA there is a department has
less than 20 faculty and at least one noble laureate.
CSE 20: Lecture 14
Is
√
2 a rational?
In the√last class we used proof by contradiction to prove
that 2 is not rational.
CSE 20: Lecture 14
Proof Techniques
To prove statement B from A:
CSE 20: Lecture 14
Proof Techniques
To prove statement B from A:
Direct Proof:
A =⇒ B
Proof by contradiction:
(¬B ∧ A) gives a contradiction
Proof by Contraposetive: A =⇒ B is same as proving
¬B =⇒ ¬A.
CSE 20: Lecture 14
Is
√
2+
√
3 a rational?
Prove that
√
√
2 + 3 is not rational.
CSE 20: Lecture 14