Lecture 11 1 5 3 1 Methods of

  • Slides: 15
Download presentation
Lecture 11 1. 5, 3. 1 Methods of Proof

Lecture 11 1. 5, 3. 1 Methods of Proof

Last time in 1. 5 To prove theorems we use rules of inference such

Last time in 1. 5 To prove theorems we use rules of inference such as: p, p q, therefore, q NOT q, p q, therefore NOT p. p AND q, therefore p FORALL x P(x), therefore for arbitrary c, P(c) EXISTS x P(x), therefore for some c, P(c) It is easy to make mistakes, make sure that: 1) All premises pi are true when you prove (p 1 AND p 2 AND. . . pn) q 2) Every rule of inference you use is correct. Some proof strategies: To proof p q 1) direct proof: assume p is true, use rules to prove that q is true. 2) indirect proof, assume q is NOT true, use rules to prove p is NOT true. To prove p is true: 3) By contradiction: assume p is NOT true, use rules to show that NOT p F i. e. it leads to a contradiction.

Vacuous –Trivial Proofs Lets say we want to prove p q but the premise

Vacuous –Trivial Proofs Lets say we want to prove p q but the premise p can be shown to be false! Then p q is always true because (F T) = T and (F F) = T. This is a vacuous prove. Old example: prove that for any set S: Proof: The following must be shown to be true: However: the empty set does not contain any elements and the premise is always false. Therefore the implication must always be true! Trivial Proof: We want to prove p q, and we can show that q is true. Then, because (T T) = T and (F T) = T we have proven the implication. Example: P(n): a>=b a^n >= b^n for positive integers. Is P(0) true? P(0): a^0 >= b^0 is equivalent to 1>=1. Therefore, q is true and thus p q is true.

Example Indirect Proof Prove that: if n is an integer and n^2 is odd,

Example Indirect Proof Prove that: if n is an integer and n^2 is odd, then n is odd. Direct prove is hard in this case. Indirect proof: Assume NOT q : n is even. n = 2 k n^2 = 4 k^2 = 2(2 k^2) is even, is not odd. Thus NOT q NOT p, p q

Example of Proof by Contradiction def: rational number is a number that can be

Example of Proof by Contradiction def: rational number is a number that can be written as a/b for integers a, b, where b should not be 0. Reals that are not rational are irrational. sqrt(2) is irrational. (note: we are not proving an implication now, although we could have written it as: if x=sqrt(2) x = irrational. ) Assume sqrt(2) is not irrational. sqrt(2) = a/b where there is no common divisor (otherwise divide by this number). 2 = a^2 / b^2 2 b^2 = a^2 = even a = 2 c 2 b^2 = 4 c^2 b^2 = 2 c^2 b^2 = even b=even both a and b can be divided by 2 (contradiction).

1. 5 An indirect proof is in fact also a prove by contradiction: Assume

1. 5 An indirect proof is in fact also a prove by contradiction: Assume p = T and (NOT q) = T indirect prove: (NOT q) (NOT p) Therefore: p AND (NOT p) = T, contradiction Proof by cases: (p 1 OR p 2 OR p 3. . . OR pn) q (if at least one of the premises hold, q follows) This is equivalent to (p 1 q) AND (p 2 q) AND. . . AND (pn q) Example: Prove x^2 >= 0 p 1: x<0 x^2 >=0 p 2: x=0 x^2 >=0 p 3: x>0 x^2 >=0

Equivalence Proofs These are bidirectional statements of the form p q. Equivalent to proving

Equivalence Proofs These are bidirectional statements of the form p q. Equivalent to proving 2 cases: p q AND q p. Example: Prove integer n is odd if and only if (iff) n^2 is odd. Lecture 10: if n is odd n^2 is odd Lecture 11: if n^2 is odd n is odd.

Lists of Equivalences p 1 p 2 p 3 . . . pn This

Lists of Equivalences p 1 p 2 p 3 . . . pn This means they are all equivalent. There are C(n, 2) pairs to prove! There is however a smarter way: Design one path through all pi’s that can bring you from any pi to any other then you are done: p 5 p 4 p 6 p 3 p 1 p 2

Theorems with Quantifiers Existence proofs: Proofs of the form: There exists an element x

Theorems with Quantifiers Existence proofs: Proofs of the form: There exists an element x such that. . . these proofs may be constructive (construct some x) or non-constructive. Uniqueness: Proofs of the form: there exists a unique element x such that. . . Example: Prove that proof: for arbitrary x, y=-x makes the proposition true. Is it unique. Assume it is not true and show contradiction: Let say there is a r such that x+r=0 but r is not –x. Then it follows that x+r=x+y r=y which contradicts our assumption.

3. 1 self reading

3. 1 self reading

The Halting Problem Is it possible to design an algorithm that always predicts for

The Halting Problem Is it possible to design an algorithm that always predicts for a given program P and a given input to that program I, if it will stop or run forever? Proposition: there isn’t Proof. Assume there is such a predictor H(P, I). A program can be represented as a bit-string, and therefore as input to another program. Imagine a program P that can take itself as input. H(P, P) should predict if it stops: H = 1 if it stops, H=0 if it doesn’t stop. Define a new program K(P) as follows: that is K(P) loops forever if H(P, P) = 1 K(P) = stops if H(P, P) = 0 Can H(K, K) predict whether this program stops? K(K) loops forever if H(K, K) = 1 K(K) stops if H(K, K) = 0 So H(K, K) does not predict correctly which is in contradiction with the assumption!

Sequences & Summations definition: A sequence is a function from the set of integers

Sequences & Summations definition: A sequence is a function from the set of integers to a set S: a 1, a 2, a 3, . . (function from 1, 2. . . a 1, a 2, . . . ) an is a term in the sequence which is sometimes denoted with {an} (not a set!) Example: {an} with an= 1/n over n=1, . . 1, 1/2, 1/3, . . . Geometric progression: Sequence of the form: a, ar^2, . . . , ar^n, . . . a = initial term, r = common ratio are real numbers 3, 6, 12, 24, . . . (a=3, r=2): ratios are constant Arithmetic progression Sequence of the form a, a+d, a+2 d, . . . , a+nd, . . . a = initial term and d = common difference are real numbers 3, 5, 7, 9, 11, . . . (a=3, r=2): differences are constant A string: finite sequence a 1, . . . , an.

Sums Notation notation: single sum double sum

Sums Notation notation: single sum double sum

Summations Theorem proof trivial

Summations Theorem proof trivial

Summations Theorem: sketch of proof: Split into 2 cases: even and odd n. In

Summations Theorem: sketch of proof: Split into 2 cases: even and odd n. In both cases argue as follows: