1 / 42

Discrete Mathematics I Lectures Chapter 3

Discrete Mathematics I Lectures Chapter 3. Some material adapted from lecture notes provided by Dr. Chungsim Han and Dr. Sam Lomonaco. Dr. Adam P. Anthony Spring 2011. This Week. Introduction to First Order Logic (Sections 3.1—3.3) Predicates and Logic Functions Quantifiers

melody
Download Presentation

Discrete Mathematics I Lectures Chapter 3

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. Discrete Mathematics ILectures Chapter 3 Some material adapted from lecture notes provided by Dr. Chungsim Han and Dr. Sam Lomonaco Dr. Adam P. AnthonySpring 2011

  2. This Week • Introduction to First Order Logic (Sections 3.1—3.3) • Predicates and Logic Functions • Quantifiers • Basic Logic Using Quantifiers • Implication, negation rules for quantifiers

  3. Propositional Functions • Propositional function (open sentence): • Statement involving one or more variables, • e.g.: P(x) = x-3 > 5. • Let us call this propositional function P(x), where P is the predicate and x is the variable. What is the truth value of P(2) ? false What is the truth value of P(8) ? false What is the truth value of P(9) ? true

  4. Propositional Functions • Let us consider the propositional function Q(x, y, z) defined as: • Q(x, y, z) = x + y = z. • Here, Q is the predicate and x, y, and z are the variables. What is the truth value of Q(2, 3, 5) ? true What is the truth value of Q(0, 1, 2) ? false What is the truth value of Q(9, -9, 0) ? true

  5. Function Domains • Propositional functions are just like mathematical functions, they must have a domain: • Real numbers • Integers • People • Students • Professors • Stock Traders? • Domains are used to clarify the purpose of the predicate • Let x be the set of all Students. Let FT(x) = x is a full time student • Sometimes domains are extremely important, particularly with if-then statements

  6. Universal Quantification • Let P(x) be a propositional function. • Universally quantified sentence: • For all x in the universe of discourse P(x) is true. • Using the universal quantifier : • x P(x) “for all x P(x)” or “for every x P(x)” • (Note: x P(x) is either true or false, so it is a proposition, not a propositional function.)

  7. Universal Quantification • Example: • S(x): x is a B-W student. • G(x): x is a genius. • What does x (S(x) G(x)) mean ? • “If x is a UMBC student, then x is a genius.” • OR • “All UMBC students are geniuses.”

  8. Existential Quantification • Existentially quantified sentence: • There exists an x in the universe of discourse for which P(x) is true. • Using the existential quantifier : • x P(x) “There is an x such that P(x).” • “There is at least one x such that P(x).” • (Note: x P(x) is either true or false, so it is a proposition, not a propositional function.)

  9. Existential Quantification • Example: • P(x): x is a B-W professor. • G(x): x is a genius. • What does x (P(x) G(x)) mean ? • “There is an x such that x is a UMBC professor and x is a genius.” OR • “At least one B-W professor is a genius.”

  10. Quantifiers, Predicates and Domains • A properly defined quantified statement will have predicates and domains clearly specified • How do we say there is a value for x that makes (5x =3) true? • Let x be the set of all real numbers R • Let P(x) = (5x = 3) • xP(x) • Sometimes, this is more trouble than it’s worth to be this clear so we’ll use shorthand: • x in real numbers such that 5x = 3 • Or, even shorter: x in R, 5x = 3 • Finally, if predicates are used (particularly with implication) but no quantifier is given, then assume  is used: • P(x) → Q(x) ≡∀xP(x) → Q(x)

  11. Exercise 2.1.1 • Re-write each statement using  and  (sometimes both!) as appropriate: • There Exists a negative real x such that x2=8 • For every nonzero real a, there is a real b such that ab = 1 • All even integers are positive • Some integers are prime • If n2=4 then n = 2

  12. Exercise 2.1.2 • Determine the truth values of the following statements: • For all real numbers x, x2 ≥ 0 • For all real numbers x, x2 > 0 • There is an integer n such that n2 = 4 • There is an integer n such that n2 = 3 • For all integers x, If x = 2 then x2 = 4 • If x2 = 4 then x = 2

  13. Truth Values of Quantified Statements • Take the statement: • ∀vertebrates a, Bird(a) → Fly(a) • Is it True? • Disproof by Counter-example • Take the statement: • ∃species s, Pig(s) ∧ Fly(s) • Is it True? How do we disprove this one? • Disproof by exhaustive search • Picking domains carefully here can make search easier • In Reality, ∀ is a generalized version of AND (∧) and ∃ is a generalized version of OR ∨: • To say ∀xP(x) means we are saying P(x) is true for everything in the world at the same time • ∀xP(x) ≡P(x1) ∧ P(x2) ∧… ∧P(xn) • To say that ∃xP(x) means we are saying that P(x) is true for at least one (or more or ALL) thing in the world • ∃xP(x) ≡P(x1) ∨ P(x2) ∨… ∨P(xn)

  14. Generalized DeMorgan’s • DeMorgan’s law can apply to longer expressions as long as the connective used is the same throughout: • ¬(p ∧ q ∧r ∧z) ≡¬p ∨ ¬q ∨¬r ∨¬z • Repeatedly apply associative laws to see how this works • So if ∀and ∃ are just short-hand for ∧ and ∨ then what happens if we negate them?

  15. Negating Quantified Statements • ∀xP(x) ≡P(x1) ∧ P(x2) ∧… ∧P(xn) • ∃xP(x) ≡P(x1) ∨ P(x2) ∨… ∨P(xn) • ¬(∀xP(x)) ≡¬(P(x1) ∧ P(x2) ∧… ∧P(xn)) ≡¬P(x1) ∨ ¬P(x2) ∨… ∨¬P(xn) ≡∃x ¬P(x) • ¬(∃xP(x)) ≡¬(P(x1) ∨ P(x2) ∨… ∨P(xn)) ≡¬P(x1) ∧ ¬P(x2) ∧… ∧¬P(xn) ≡∀x ¬P(x)

  16. Tying It All Together • Things seem strange now…logic functions…predicates…quantifiers… • Everything we learned before today is still applicable: • Theorem 2.1.1 (laws for simplification) • Implication elimination/negation • Converse/contrapositive/inverse • Any other equivalences/tautologies/contradictions • Truth tables can be used, but less frequently at this point

  17. Exercise 2.1.3 • Write negations for the following statements: • For all numbers x, x2 > 0 • There is an integer n such that n2 = 3 • All even integers are positive • Some integers are prime

  18. Exercise 2.1.3 cont. • For any real x, if x ≥ 0, then x2≥x • For any integer n, if n2=n, then n = • Some dogs go to hell • EVERYBODY fails MTH 161!

  19. Exercise 2.1.4 • Rewrite the following using ∀ and ∃, then determine the truth value of each statement (hint: negating the statement can help—HOW?): • All even integers are positive • Some integers are prime • There is a positive real x such that x2 ≥ x3 • For any real x, if x ≥ 1, then x2 ≥ x

  20. 2.1.4 continued • For any integer n, if n2 = n, then n = 0 • For any real x, if x2 = -1, then x = -1 • If n2 = 4, then n = 2

  21. Major Pitfalls with Conditionals • Remember how we interpret implication • If you can’t prove me wrong, then I’m right • For what things in the world is student(x) → smart(x) true? • Smart students • Anybody who is not a student (vacuously true case) • When is ∀people x, student(x) → smart(x) true? When is it false? • When is ∃person x, student(x) → smart(x) true? When is it false? • If we meant to say, ‘there exists a student who is smart’ how do we fix this?

  22. Common Uses of Quantifiers • Universal quantifiers are often used with “implies” to form “rules”: (x) student(x) smart(x) means “All students are smart” • Universal quantification is rarely used to make blanket statements about every individual in the world: (x)student(x)smart(x) means “Everyone in the world is a student and is smart” • Existential quantifiers are usually used with “and” to specify a list of properties about an individual: (x) student(x) smart(x) means “There is a student who is smart”

  23. Using Multiple Variables, Quantifiers • We already saw a multivariable predicate: Q(x, y, z) = x + y = z. • We can quantify this as (for example): • ∃real x∃realy∃realz, such that Q(x,y,z) • Read this as: there exist real number values x, y, and z such that the sum of x and y is z • We can also mix-and-match quantifiers, but it’s trickier and in English it can be confusing: • ‘There is a person supervising every detail of the production process’ • Work out on the board

  24. Understanding Mixed Quantifiers • Here’s how you could ‘determine’ the truth of the following: • ∀x in D, ∃y in E such that P(x,y) • Have a friend pick anything in D, then you have to find something in E that makes P(x,y) true • If you ever fail, then the statement is false (counterexample). • ∃x in D such that ∀y in E, P(x,y) • You need to pick a ‘trump card’: Pick one item from D such that no matter what someone picks out of E, P(x,y) will be true • Your friend should always fail to prove you wrong

  25. Exercise 2.2.1 • Express the following using ∀ and ∃, then evaluate the truth of the expression • For any real x, there is a real y such that x + y = 0 • There is a real x such that for any real y, x ≤ y • For any real x, there is a real y such that y < x

  26. Less Mathematical Practice (2.2.2) Every gardener likes the sun. xgardener(x) likes(x,Sun) You can fool some of the people all of the time. xtperson(x) time(t)  can-fool(x,t) You can fool all of the people some of the time. xt (person(x) time(t) can-fool(x,t)) x (person(x) t (time(t) can-fool(x,t)) All purple mushrooms are poisonous. x (mushroom(x) purple(x)) poisonous(x) No purple mushroom is poisonous. xpurple(x) mushroom(x) poisonous(x) x (mushroom(x) purple(x)) poisonous(x)

  27. Logic to English Translation (2.2.3) • x person(x)  male(x) v female(x) • x male(x) ^ person(x) • x boy(x) male(x) ^ young(x)

  28. Negating Mixed Quantifiers • Easy: just apply the negation rule we learned earlier for quantifiers, moving the negation in bit-by-bit: • ¬(∀x in D, ∃y in E such that P(x,y)) ≡∃x in D, ¬(E y in E such that P(x,y)) ≡∃x in D, ∀y in E such that ¬P(x,y) • Works same for ∃x in D such that ∀y in E, P(x,y) • Work out on board!

  29. Exercise 2.2.4 • Negate the following until all negation signs are touching a predicate: • ∀x ∀y, P(x,y) • ∀x∃y, (P(x) ∧ Z(x,y)) • ∃x∀y, (P(x) →R(y))

  30. Order Matters (half the time)! • If all your quantifiers are the same, you can put them in any order and the meaning remains: • ∀realsx, ∀ realsy, x + y = y + x ≡∀realsy, ∀ realsx, x + y = y + x • Similar for ∃ • You have to be VERY careful about the order of mixed quantifiers: • What is the difference between: ∀people x, ∃a person y such that loves(x,y) ∃person x such that ∀people y, loves(x,y)

  31. Valid Arguments Using Quantifiers • Quantifiers help avoid having to name everything in the domain • But what if we reach a point where we are looking at a particular item? • What can we conclude about that item, if all we have a quantified statements?

  32. Universal Instantiation • Rule of Universal Instantiation: • If some property is true of EVERYTHING in a domain, then it is true of any PARTICULAR thing in that domain • x in D, P(x) is TRUE for all things in the domain D • Now, observe an item a from the domain D: • Can we conclude anything? • P(a) has to be true

  33. Universal Modus Ponens • x in D, P(x)  Q(x) P(a) is true for a particular a in D Therefore, Q(a) is true • Universal instantiation makes this work. How?

  34. Universal Modus Tollens • x in D, P(x)  Q(x) Q(a) for some particular a in D Therefore, P(a) • Same Reasoning about Universal Instantiation here, as well!

  35. Universal Modus Ponens or Universal Modus Tollens? • All good cars are expensiveA smarty is not expensiveTherefore, a smarty is not a good car • Any sum of two rational numbers is rationalThe numbers a and b are rationalTherefore, a + b is rational

  36. Fill In The Blanks (Modus Ponens or Modus Tollens) • If n is even, then n = 2k for some integer k(4x + 2) is evenTherefore, _________________ • If m is odd, then m = 2k + 1 for some integer kr  2i + 1 for any integer ITherefore, __________________ • n is even if and only if n = 2k for some integer k(m + 1)2 = 2l and l is an integerTherefore, __________________

  37. Other Quantified Arguments • All of the arguments we looked at in CH 2 have a quantified version of one form or another • Universal Transitivity: • x P(x)  Q(x) x Q(x)  R(x) x P(x)  R(x) • Invalid arguments can be quantified as well, so be careful! • Don’t forget about Converse, Inverse error

  38. Diagrams For Analyzing Arguments • All good cars are expensive A smarty is not an expensive car Therefore, a smarty is not a good car Expensive Cars Expensive Cars Smarty Good Cars

  39. Diagram Example 1 • All CS Majors are smartPam is not a CS MajorTherefore, Pam is not smart

  40. Diagram Example 2 • If a product of two numbers is 0, then at least one of the numbers is 0.x  0 and y  0Therefore, xy  0

  41. Diagram Example 3 • No college cafeteria food is goodNo good food is wastedTherefore, No college cafeteria food is wasted

  42. Diagram Example 4 • All teachers occasionally make mistakesNo gods ever make mistakesTherefore, No teachers are gods

More Related