Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Sections 1.4 Predicates A predicate P(x) is a statement Consider the statement x + 3 = 7. 1) 2) Quantify the variable(s) a) b) Quantifying a statement containing two or more variables Q(x, y) is the statement x + y = 5 xy Q(x, y) xy Q(x, y) xy Q(x, y) xy Q(x, y) domain Definition (p. 43) 1. The symbol 2. The symbol means 3. The symbol means 4. The symbols and 5. A counterexample is P(x): x + 3 = 7 Predicate: x P(x) Domain: R(x): x3 ≥ 0 Predicates x R(x) and x R(x) Domain More examples Translating Quantified Statements Every student in EECS 210 has taken a programming class. S(x): Q(x): P(x): Some student in EECS 210 bought the textbook. B(x): When are the statements false? Expressing Negations: P(x): x is a professor Q(x): x is ignorant R(x): x is vain a) "No professors are ignorant" b) "All ignorant people are vain" c) "No professors are vain" Does statement c follow from a and b? Negating Quantified Statements Negation (x P(x)) Equivalent Statement x (P(x)) (x P(x)) x (P(x)) When true For some x, P(x) is false When false P(x) is false for For some x, all values of x P(x) is true P(x) is true for all x Stmt: Every student in EECS 210 is a sophomore or junior. Negation: Q(n, r): For every nonzero integer n there is a rational number r such that n = 1/r There is a unique x such that for every y, xy = y. R(x, y): xy = y More Examples D(x) is “x is a day” S(x) is “x is sunny” R(x) is “x is rainy” M is “Monday” Some days are not rainy. No day is both sunny and rainy. Monday was sunny; therefore every day will be sunny Quantifications of Two Variables Statement When true When false xy P(x, y) P(x, y) true for all choices yx P(x, y) of x and y Some pair x, y makes P(x, y) false xy P(x, y) Given x a y can be found to make P(x, y) true For some x, every choice of y makes P(x, y) false xy P(x, y) For some value of x every y makes P(x, y) true For every x, there is some y for which P(x, y) is false xy P(x, y) yx P(x, y) There is an x, y pair that makes P(x, y) true P(x, y) is false for every pair x, y More Examples Use the predicates given below to write each of the statements that follow them in symbolic notation. The domain is the set of all movies. M(x): “x is a mystery” D(x): “x is a drama” C(x): “x is a comedy” B(x, y): “x is better than y” a. Some mysteries are dramas. b. Some comedies are better than all dramas. c. For every drama there is a comedy better than it. d. Only comedies are better than mysteries. e. Not every comedy is a mystery. Negating Implications The implication p q is logically equivalent to p V q. Thus, the negation of p q is the statement p q p q T T T F F T F F F(x): x is a fruit pq p pVq q p q V(x): x is a vegetable S(x, y): x is sweeter than y Some vegetable is sweeter than all fruits Every fruit is sweeter than some vegetable Only fruits are sweeter than vegetables Logical Equivalences for Conditional Statements p q p V q (p q) p q p q q p (p q) (p r) p (q r) p V q p q (p q) V (p r) p (q V r) p q (p q) “No professor has been asked questions by all of his students.” S(x): x is a student P(x): x is a professor A(x, y): x has asked y a question What does each translation actually mean? x y ((S(x) P(y)) A(x, y) x y ((S(x) A(x, y)) P(y) x y (A(x, y)) x y (((S(x) P(y) )A(x, y)) x y ((P(y) S(x)) A(x, y)) x y(P(x) A(x, y)) x y(P(x) (S(y) A(x, y) )) A correct translation: Section 1.6 Excursion—validity of arguments A theorem is A proof is validity of an argument Rules of inference Example: If x ends in 0 then it is divisible by 10. (p (p q)) q modus ponens p T T F F | | | | | q T F T F | pq | T | F | T | T Other Valid Arguments Example: If 6 divides x then 2 divides x 2 does not divide 5 Therefore, 6 does not divide 5 pq q___ p modus tollens ((pq q) p) p T T F F | | | | | q T F T F | pq | T | F | T | T Resolution: (p V q) (p V r) (q V r) Example: (from Rosen #61 p. 76) It is not raining or Sue has her umbrella Sue does not have her umbrella or she does not get wet It is raining or Sue does not get wet p: q: r: 1st Statement 2nd Statement 3rd Statement Table 1 Rules of Inference (p. 58 in Rosen) Rule Tautology Name __________________________________________________ p p V q p (p V q) Addition __________________________________________________ pq p (p q) p Simplification __________________________________________________ p q____ Conjunction pq __________________________________________________ p pq [p (p q)] q Modus ponens q __________________________________________________ q pq [q (p q)] p Modus tollens p __________________________________________________ pq qr [(p q) (q r)] (p r) Hypothetical p r Syllogism __________________________________________________ pVq p [(p V q) p] q Disjunctive q Syllogism _________________________________________________ pVq pVr Resolution q V r __________________________________________________ Fallacies p T T F F More Fallacies Circular reasoning | | | | | q T F T F | pq | T | F | T | T Proving Validity of the Inference Rules What we need to prove: Proving the validity of disjunctive syllogism: p T q T T F F T F F pVq p (p V q) p [(p V q) p] q Validity of an argument Example 1: (p. 76 # 2b) If this number is a perfect square then the equation has a rational solution. The equation has a rational solution. Therefore this number is a perfect square. Example 2: If you fail the final you will fail the course. You failed the final. Therefore, you will fail the course Example 3: If it’s above 80 at noon then it will not rain. It rained. Therefore it was not above 80 at noon. Mathematical Notation and Terminology Used in EECS 210 Z Z+ Q R N Mathematical Functions Floor function y Ceiling function y Mod function Divides Notation: GCD LCM Prime number Composite number Relatively Prime Chapter 2 A Primer of Mathematical Writing (Proofs) Types of proofs Give reasons for all steps in a proof Proposition 1: (p. 87) Other than 3, 4 there is no pair of consecutive integers where the first is a prime number and the second is a perfect square. Theorem 2: For all integers n > 4, if n is a perfect square, then n – 1 is not a prime number. (Basically a restatement of proposition 1.) Tracing proofs Typical Proofs about Numbers An integer n is even if An integer m is odd if Closure Property of the Integers: Whenever the operation of addition, subtraction or multiplication is applied to integers, the result is an integer. Proposition 3: The result of summing an odd integer and an even integer is an odd integer. Proof 1: Proof 2: Are both correct? Why or why not? Proposition 5: If n is even then n2 is divisible by 4. Proposition 6: For all integers n, if n2 is even then n is even. Example: Prove that if n + 1 separate passwords are issued to n students, then some student gets ≥ 2 passwords. Section 2.2 Proofs About Numbers An integer n is divisible by Prove or disprove: If n is an odd integer, then n2 - 1 is divisible by 8. If integers m and n are both divisible by 3 then 1. n + m is also divisible by 3. 2. m•n is divisible by 9. 3. n2 + 3n is divisible by 9. Prop. 4: For any nonzero integer d, if integers m and n are both divisible by d, then m + n is also divisible by d. Definition: A real number r is rational if there exist integers a and b (b 0) with r = a/b. Rational numbers (also called fractions) can be expressed in many equivalent ways. (1/2 = 2/4 = 3/6 = …)It is always possible to choose the integers a and b with no common divisors greater than 1. Such numbers are called relatively prime. 2. A real number is irrational if it is not rational. More Examples Example 1: Prove that the sum of two rational numbers is rational Example 2: Prove or disprove the product of two irrational numbers is irrational. Example 3: Prove that for every integer n, 3(n2 + 2n + 3) – 2n2 is a perfect square. Proposition 6: For any integer n, n2 + n is even. Example 4: Prove n3 – n is divisible by 3 for all n ≥ 0 Example 5: The difference of two consecutive cubes is odd. Proving by cases Prove that for any two numbers x and y, |xy| = |x| • |y| Case 1: x ≥ 0 and y ≥ 0 Case 2: x ≥ 0, y < 0 Case 3: y ≥ 0, x < 0 Case 4: x < 0, y < 0 Example 6: Prove or disprove there exist three consecutive odd primes. Example 7: Prove or disprove that given a positive integer n there exist n consecutive odd positive integers that are prime. The Division Theorem Theorem 8: For all integers a and b with b > 0, there is an integer q (the quotient) and an integer r (the remainder) such that 1. a = b•q + r and 2. 0 r < b Proposition 9: If n is any integer not divisible by 5 then n has a square that is either of the form 5k + 1 or 5k + 4. Definition: We write a mod b = r to mean that r is the remainder when a is divided by b. (i.e. a = b•q + r and 0 r < b) Difference between the divides relation and division Proving the equivalence of three or more statements Prove that if n is an integer, then the following four statements are equivalent: (1) n is even (2) n + 1 is odd (3) 3n + 1 is odd (4) 3n is even Proof Technique Exhaustive Proof Direct Proof How to prove P Q Show P Q for all possible cases Assume P, deduce Q Comments Only works for a finite number of cases. The standard approach to try. Contrapositive Assume Q, deduce P Use if Q as a (Indirect) Proof hypothesis seems to give more information to work with. Contradiction Assume P Λ Q, deduce Try this approach when Q says a contradiction something is not true. Proof by Cases Break the domain into Try this for proving two or more subsets properties of numbers and prove PQ for the where odd and even elements in each such or positive and negative numbers subset. require different proofs. Counterexample Prove statement false Used to show that by finding one value for PQ is false. P such that Q is false. Existence Find one explicit This is the only time solution you may "prove by (e.g. there exists an example" even prime number) Modification of Table 2.2 p. 91 Gersting