csci2110 – discrete mathematics tutorial 9 first order logic wong chung hoi (hollis)...
TRANSCRIPT
![Page 1: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/1.jpg)
CSCI2110 – Discrete MathematicsTutorial 9
First Order Logic
Wong Chung Hoi (Hollis)[email protected]
2-11-2011
![Page 2: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/2.jpg)
Agenda
• First Order Logic• Multiple Quantifiers• Proofing Arguments Validity– Proof by truth table– Proof by inference rules
![Page 3: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/3.jpg)
First Order Logic
• Predicate - Proposition with variables– P(x): x > 0 p: -5 > 0– H(y): y is smart h: Peter is smart– G(s,t): s is a subset of t g: {1,2} is a subset of Ø
• Domain – Set of values that the variables take.– – –
![Page 4: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/4.jpg)
First Order Logic
• Predicates takes different truth value on different substituted values.– P(x): x > 0, P(0) = F, P(1) = T– H(y): y is smart, H(“Peter”) = T, H(“John”) = F
H(“Paul”) = F, H(“Mary”) = T• Truth set – set of elements that are evaluated
True on a predicate.– –
![Page 5: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/5.jpg)
From Predicates to Propositions
• By substitution P(x): x > 0– p: P(10), p: P(-1)
• By quantifiers– For All –
• for every, for any, for each, given any, for arbitrary•
– There Exists – • there is a, we can find a, at least one, for some•
![Page 6: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/6.jpg)
Exercise
• Express in terms of .–
• Express in terms of .–
• What is the negation of ? • What is the negation of ?
![Page 7: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/7.jpg)
All people never grow up
P – Set of all peopleG(x): x grows up
Some people never grow up. All people grow up.
![Page 8: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/8.jpg)
S – Set of all things that can be boughtE(x): x is expensive these days.
Nothing is expensive these days.
Something is expensive these days.
![Page 9: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/9.jpg)
S – Set of things to be described.E(x): x can end well.
Not everything can end well.
Everything can end well.
![Page 10: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/10.jpg)
P – Set of all peopleR(x): x can readW(x): x can write
Some people can’t read and some people can’t write.
All people can read or all people can write.
![Page 11: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/11.jpg)
P – Set of all peopleA – Set of all AmericanC(x): For x, it’s a crutchL(x): For x, it’s a way of life
For some people, it’s a crutch and for all American, it’s a way of life.
For all people, it’s not a crutch or for some American, it’s not a way of life.
![Page 12: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/12.jpg)
Agenda
• First Order Logic• Multiple Quantifiers• Proofing Arguments Validity– Proof by truth table– Proof by inference rules
![Page 13: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/13.jpg)
Multiple Quantifiers
• K(x, y): x takes the course y– Domain of x is set of all CSE students (S)– Domain of y is set of all CSE courses (C)
• Two quantifiers of the same type can be combined.
![Page 14: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/14.jpg)
Multiple Quantifiers
• K(x, y): x takes the course y– Domain of x is set of all CSE students (S)– Domain of y is set of all CSE courses (C)
• Two quantifiers of different type cannot be reverse.
![Page 15: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/15.jpg)
Exercise
• Express in terms of .–
• Express in terms of .–
• What is the negation of ? • What is the negation of ?
![Page 16: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/16.jpg)
S – Set of all postersP – Set of all peopleM(x, y): x can make y
There are some people who can’t make any posters.
All people can make some posters.
![Page 17: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/17.jpg)
R – Set of all retardsP – Set of all peopleK(x, y): x know y
Everyone knows some retards.
There exists someone who don’t know any retards.
![Page 18: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/18.jpg)
Agenda
• First Order Logic• Multiple Quantifiers• Proofing Arguments Validity– Proof by truth table– Proof by inference rules
![Page 19: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/19.jpg)
Proofing Arguments Validity
• Arguments – hypothesis and conclusion– E.g.
• Valid argument: If all hypothesizes are true, then the conclusion is true.– Proof by truth table.– Proof by Inference rules.
![Page 20: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/20.jpg)
Proof By Truth Table 1
• Is this argument valid?
![Page 21: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/21.jpg)
Proof By Truth Table 2
• Is this argument valid?
![Page 22: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/22.jpg)
Inference Rules
• All can be proven by truth table• Modus Ponens Modus Tollens
• Generalization Specialization
• Transitivity Contradiction Rule
![Page 23: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/23.jpg)
Proof By Inference Rules 1
• Show that the argument is valid.
![Page 24: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/24.jpg)
Proof By Inference Rules 2
• Show that the argument is valid.
![Page 25: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/25.jpg)
Inference rule for predicates
• Universal instantiation
• Universal Modus Pollens
• Universal Modus Tollens
![Page 26: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/26.jpg)
Proof By Inference Rules 3
• Show that the argument is valid. Assume the domain of all predicates is a set and .
![Page 27: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/27.jpg)
Proof By Inference Rules 3
• Show that the argument is valid. Assume the domain of all predicates is a set and .
![Page 28: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 2-11-2011](https://reader035.vdocument.in/reader035/viewer/2022062300/56649dd45503460f94acbef0/html5/thumbnails/28.jpg)
Summary
• Difference between predicates and proposition
• Quantifiers and negation• Proofing Arguments Validity– Proof by truth table– Proof by inference rules