1 / 15

ICS 253: Discrete Structures I

ICS 253: Discrete Structures I. Spring Semester 2014 (2013-2). Nested Quantifiers. Dr. Nasir Al-Darwish Computer Science Department King Fahd University of Petroleum and Minerals darwish@kfupm.edu.sa. Negating Quantifiers - Examples. Translating English into predicates.

nathand
Download Presentation

ICS 253: Discrete Structures I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ICS 253: Discrete Structures I Spring Semester 2014 (2013-2) Nested Quantifiers Dr. Nasir Al-Darwish Computer Science Department King Fahd University of Petroleum and Minerals darwish@kfupm.edu.sa

  2. Negating Quantifiers - Examples

  3. Translating English into predicates • “Every student in this class has studied calculus” Let c(x) be the statement that “x has studied calculus”. Let s(x) be the statement “x is in this class”

  4. Using quantifiers in system specifications • “Every mail message larger than one megabyte will be compressed” Let c(m) denote “message m will be compressed” and let s(m,y) be “mail message m is larger than y megabytes” where m is the domain of all mail messages and y is a positive real number. Then the above statement can be written as follows:

  5. Example • “If a user is active, at least one network link will be available” Let a(u) represent “user u is active” where u is the domain of all users, and let s(n, x) denote “network link n is in state x” where n has the domain of all network links, and x has the domain of all possible states, {"available", "unavailable"}. Then the above statement can be written as follows:

  6. Nested quantifiers Assume the domain for the variables x, y, and z consists of real numbers xy (x + y) = 0 says: For every real number x, there exists a real number y where x + y = 0 (this is true if we let y be –x) xy (x + y) = 0 same as xq(x) where q(x) is y p(x, y) andp(x, y) is (x + y) = 0 xy (x + y) = (y + x) says: For every real number x, and every real number y, (x + y) = (y + x) - commutative law for addition of real numbers Similarly, the associative law: x y z (x + (y + z) = (x + y)+ z) x y ((x < 0)  (y < 0)  (xy > 0)) says ? The multiplication of two negative real numbers is a positive real number

  7. Quantification as loop • x yp(x,y) For every x, for every y • Loop through x and for each x loop through y • If we find p(x,y) is true for all x and y, then the statement is true • If we ever hit a value x for which we hit a value y for which p(x,y) is false, the whole statement is false • x yp(x,y) For every x, there exists y • Loop through x, for each x loop through y until finding a y such that p(x,y) is true • If for every x, we find a y for which p(x,y) is true, then the statement is true; otherwise, the statement is false

  8. Quantification as loop • x yp(x,y) : loop through the values of x until we find an x for which p(x,y) is true for all values of y • Once found such one x, then the statement is true • x yp(x,y) : loop though the values of x where for each x loop through the values of y until we find an x for which we find a y such that p(x,y) is true • If we never find an x and a y such that p(x,y) is true then the statement is false

  9. Order of quantification

  10. Quantification of two variables

  11. Quantification with more variables

  12. Translating mathematical statements • “The sum of two positive integers is always positive”

  13. Translating mathematical statements • “Every real number except zero has a multiplicative inverse”

  14. Translating predicates to English • Assume c(x) is “x owns a computer”,f(x,y) is “x and y are friends”, and the domain for xand y consists of all students in KFUPM. • Express the following in English: • Answer: Every KFUPM student owns a computer or is a friend of a KFUPM student who owns a computer. • Assume f(x,y) means x and y are friends, and the domain consists of all students in KFUPM • Express the following in English:

  15. Negating nested quantifiers • Move negation to the right and invert the quantifier • Example: “There does not exist a woman (w) who has taken a flight (f)on every airline (a) in the world” where p(w,f) is “w has taken f”, and q(f,a) is “f is a flight on airline a”

More Related