discrete structures predicate logic 2
DESCRIPTION
Discrete Structures Predicate Logic 2. Dr. Muhammad Humayoun Assistant Professor COMSATS Institute of Computer Science, Lahore. [email protected] https://sites.google.com/a/ciitlahore.edu.pk/dstruct/. Negation of Quantifiers. ???. Negation of Quantifiers. ???. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/1.jpg)
1
Discrete StructuresPredicate Logic 2
Dr. Muhammad HumayounAssistant Professor
COMSATS Institute of Computer Science, [email protected]
https://sites.google.com/a/ciitlahore.edu.pk/dstruct/
![Page 2: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/2.jpg)
2
Negation of Quantifiers
• ???
![Page 3: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/3.jpg)
3
Negation of Quantifiers
• ???
![Page 4: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/4.jpg)
4
Negation of Quantifiers
• ???
![Page 5: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/5.jpg)
5
ExerciseB(x): “x is a baby” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• Babies are ignorant.
![Page 6: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/6.jpg)
6
ExerciseB(x): “x is a baby” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• Babies are ignorant. (Ambiguous)• All/Some babies are ignorant
![Page 7: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/7.jpg)
7
ExerciseB(x): “x is a baby” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• Babies are ignorant. (Ambiguous)• All babies are ignorant
![Page 8: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/8.jpg)
8
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• No professors are ignorant.• It is not the case that there exists an x such that x
is a professor and x is ignorant.
• It is not the case that all professors are ignorant.
![Page 9: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/9.jpg)
9
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• No professors are ignorant.• [There is no such professor who is ignorant]• [It is not the case that there is an x such that x is a
professor and x is ignorant.]
• It is not the case that all professors are ignorant.
![Page 10: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/10.jpg)
10
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• No professors are ignorant.• [There is no such professor who is ignorant]• [It is not the case that there is an x such that x is a
professor and x is ignorant.]
professors are ignorant.
![Page 11: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/11.jpg)
11
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• No professors are ignorant.• [There is no such professor who is ignorant]• [It is not the case that there is an x such that x is a
professor and x is ignorant.]
• All professors are not ignorant
![Page 12: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/12.jpg)
12
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• No professors are ignorant.
• All (and all of them) professors are not ignorant.
![Page 13: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/13.jpg)
13
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• All ignorant people are vain. • For all people x, if x is ignorant then x is vain.
• It is logically equivalent to
• There is no such person x such that he is ignorant and not vain.
![Page 14: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/14.jpg)
14
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• All ignorant people are vain. • For all people x, if x is ignorant then x is vain.
• It is logically equivalent to
• There is no such person x such that he is ignorant and not vain.
![Page 15: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/15.jpg)
15
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• All ignorant people are vain. • For all people x, if x is ignorant then x is vain.
• It is logically equivalent to
• There is no such person x such that he is ignorant and not vain.
![Page 16: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/16.jpg)
16
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• All ignorant people are vain. • For all people x, if x is ignorant then x is vain.
• It is logically equivalent to
• There is no such person x such that he is ignorant and not vain.
![Page 17: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/17.jpg)
17
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• All ignorant people are vain. • For all people x, if x is ignorant then x is vain.
• It is logically equivalent to
• There is no such person x such that he is ignorant and not vain.
Useful
![Page 18: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/18.jpg)
18
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• No professors are vain• It is not the case that there is an x such that x is professor
and x is vain.
• For all people x, if x is a professor then x not vain.
![Page 19: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/19.jpg)
19
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• No professors are vain• It is not the case that there is an x such that x is professor
and x is vain.
• For all people x, if x is a professor then x not vain.
![Page 20: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/20.jpg)
20
Exerciseprofessor(x): “x is a professor” ignorant(x): “x is ignorant” vain(x): “x is vain” Universe: The set of all people.
• No professors are vain• It is not the case that there is an x such that x is professor
and x is vain.
• For all people x, if x is a professor then x not vain.
![Page 21: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/21.jpg)
21
Precedence of Quantifiers
• The quantifiers and have higher precedence then all logical operators from propositional calculus.
• e.g. is the disjunction of .
![Page 22: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/22.jpg)
22
Quantifiers with Restricted Domain
• –
![Page 23: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/23.jpg)
23
Quantifiers with Restricted Domain
• –
![Page 24: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/24.jpg)
24
Quantifiers with Restricted Domain
• –
![Page 25: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/25.jpg)
25
Quantifiers with Restricted Domain
• –
![Page 26: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/26.jpg)
26
Nested Quantifiers
“For all , there exists a such that”. Example: where and are integers
![Page 27: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/27.jpg)
27
Nested Quantifiers
“For all , there exists a such that”. Example: where and are integers
There exists an x such that for all , is true” Example:
• THINK QUANTIFICATION AS LOOPS
![Page 28: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/28.jpg)
28
Meanings of multiple quantifiersSuppose = “x likes y.”Domain of x: {St1, St2}; Domain of y: {DS, Calculus}
• – true for all x, y pairs.
– true for at least one x, y pair.
– For every value of x we can find a (possibly different) y so that P(x,y) is true.
– There is at least one x for which P(x,y) is always true.
![Page 29: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/29.jpg)
29
Meanings of multiple quantifiersSuppose = “x likes y.”Domain of x: {St1, St2}; Domain of y: {DS, Calculus}
• – true for all x, y pairs.
– true for at least one x, y pair.
– For every value of x we can find a (possibly different) y so that P(x,y) is true.
– There is at least one x for which P(x,y) is always true.
![Page 30: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/30.jpg)
30
Meanings of multiple quantifiersSuppose = “x likes y.”Domain of x: {St1, St2}; Domain of y: {DS, Calculus}
• – true for all x, y pairs.
– true for at least one x, y pair.
– For every value of x we can find a (possibly different) y so that P(x,y) is true.
– There is at least one x for which P(x,y) is always true.
![Page 31: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/31.jpg)
31
Meanings of multiple quantifiersSuppose = “x likes y.”Domain of x: {St1, St2}; Domain of y: {DS, Calculus}
• – true for all x, y pairs.
– true for at least one x, y pair.
– For every value of x we can find a (possibly different) y so that P(x,y) is true.
– There is at least one x for which P(x,y) is always true.
![Page 32: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/32.jpg)
32
• Quantification order is not commutative
![Page 33: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/33.jpg)
33
Example
Domain: Real numbers
• True/False??? • For all real numbers x and for all real numbers y
there is a real number z such that .• True • True/False???• There is a real number z such that for all real
numbers x and for all real numbers y it is true that .• False
![Page 34: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/34.jpg)
34
Example
Domain: Real numbers
• True/False??? • For all real numbers x and for all real numbers y
there is a real number z such that .• True • True/False???• There is a real number z such that for all real
numbers x and for all real numbers y it is true that .• False
![Page 35: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/35.jpg)
35
Example
Domain: Real numbers
• True/False??? • For all real numbers x and for all real numbers y
there is a real number z such that .• True • True/False???• There is a real number z such that for all real
numbers x and for all real numbers y it is true that .• False
![Page 36: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/36.jpg)
36
Example
Domain: Real numbers
• True/False??? • For all real numbers x and for all real numbers y
there is a real number z such that .• True • True/False???• There is a real number z such that for all real
numbers x and for all real numbers y it is true that .• False
![Page 37: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/37.jpg)
37
From Nested Quantifiers to English
• F (a, b): “a and b are friends” • Domain: All students in COMSATS.
• There is a student x such that for all students y and all students z other than y, if x and y are friends and x and z are friends, then y and z are not friends.
• There is a student none of whose friends are also friends with each other.
![Page 38: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/38.jpg)
38
From Nested Quantifiers to English
• F (a, b): “a and b are friends” • Domain: All students in COMSATS.
• There is a student x such that for all students y and all students z other than y, if x and y are friends and x and z are friends, then y and z are not friends.
• There is a student none of whose friends are also friends with each other.
![Page 39: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/39.jpg)
39
From English to Nested Quantifiers
• "If a person is female and is a parent, then this person is someone's mother“
• For every person x , if person x is female and person x is a parent, then there exists a person y such that person x is the mother of person y.“– F(x): “x is female”– P(x): “x is a parent“– M(x, y) : “x is the mother of y”
![Page 40: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/40.jpg)
40
From English to Nested Quantifiers
• "If a person is female and is a parent, then this person is someone's mother“
• For every person x , if person x is female and person x is a parent, then there exists a person y such that person x is the mother of person y.“– F(x): “x is female”– P(x): “x is a parent“– M(x, y) : “x is the mother of y”
![Page 41: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/41.jpg)
41
• The sum of two positive integers is always positive.
• What is domain above?• Integers• If domain is “+ve integers”
![Page 42: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/42.jpg)
42
• The sum of two positive integers is always positive.
• What is domain above?• Integers• If domain is “+ve integers”
![Page 43: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/43.jpg)
43
• The sum of two positive integers is always positive.
• What is domain above?• Integers• If domain is “+ve integers”
![Page 44: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/44.jpg)
44
• Everyone has exactly one best friend• For every person x , person x has exactly one best
friend.
• B(x,y): “x has best friend y”
• Exactly one best friend ????
![Page 45: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/45.jpg)
45
• Everyone has exactly one best friend• For every person x , person x has exactly one best
friend.
• B(x,y): “x has best friend y”
• Exactly one best friend ????
![Page 46: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/46.jpg)
46
• Everyone has exactly one best friend• For every person x , person x has exactly one best
friend.
• B(x,y): “x has best friend y”
• Exactly one best friend ????
![Page 47: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/47.jpg)
47
• Everyone has exactly one best friend• For every person x , person x has exactly one best
friend.
• B(x,y): “x has best friend y”
• Exactly one best friend ????
![Page 48: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/48.jpg)
48
• Everyone has exactly one best friend• For every person x , person x has exactly one best
friend.
• B(x,y): “x has best friend y”
• Exactly one best friend ????
![Page 49: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/49.jpg)
49
• Everyone has exactly one best friend• For every person x , person x has exactly one best
friend.
• B(x,y): “x has best friend y”
• Exactly one best friend ????
![Page 50: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/50.jpg)
50
• There is a woman who has taken a flight on every airline in the world.
• Domains: people airlines flights• W(x): x is a woman• F(x, f): x has taken flight f• A(f, a): flight f belongs to airline a
•
•
![Page 51: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/51.jpg)
51
• There is a woman who has taken a flight on every airline in the world.
• Domains: woman airlines flights• P(w, f): Woman w has taken flight f• Q(f, a): flight f belongs to airline a
•
•
![Page 52: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/52.jpg)
52
• There is a woman who has taken a flight on every airline in the world.
• Domains: woman airlines flights• P(w, f): Woman w has taken flight f• Q(f, a): flight f belongs to airline a
•
![Page 53: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/53.jpg)
53
• There is a woman who has taken a flight on every airline in the world.
• Domains: woman airlines flights• R(w, f, a): Woman w has taken flight f on airline a
![Page 54: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/54.jpg)
54
Bound and free variablesA variable is bound if it is known or quantified.
Otherwise, it is free.
Examples:P(x) x is freeP(5) x is bound to 5x P(x) x is bound by quantifier
Reminder: in a proposition, all variables must be bound.
![Page 55: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/55.jpg)
55
Negating Nested Quantifiers
![Page 56: Discrete Structures Predicate Logic 2](https://reader033.vdocuments.net/reader033/viewer/2022050820/5681602f550346895dcf46d7/html5/thumbnails/56.jpg)
56
Do Exercises