Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chap 3 –A theorem is a statement that can be shown to be true –A proof is a sequence of statements to show that a theorem is true –Axioms: statements which.

Similar presentations


Presentation on theme: "Chap 3 –A theorem is a statement that can be shown to be true –A proof is a sequence of statements to show that a theorem is true –Axioms: statements which."— Presentation transcript:

1 Chap 3 –A theorem is a statement that can be shown to be true –A proof is a sequence of statements to show that a theorem is true –Axioms: statements which are assumptions, hypotheses or previously proved theorem –Pales of inference: draw conclusion from other assertions

2 Chap 3 (cont.) –Lemma: simple theorems used to prove other theorems –Corollary: established from a theorem –Modus ponens P P  Q ∴ Q –Table 1: rules of inference

3 Chap 3 (cont.) –An argument is valid if whenever all the hypotheses are true, the conclusion is also true –if all propositions used in a valid argument are true, if leads to a correct conclusion –“if | o | is divisible by 3, than | 0 | 2 is divisible by 9. | o | is divisible by 3. Consequently, | 0 | 2 is divisible by 9.” is a valid argument; however, the conclusion is false –Example 6 & 7

4 [(P  Q)  Q]  P is not a tautology –fallacy of affirming the conclusion  [(P  Q)   Q]   Q is not a tautology –fallacy of denying the hypothesis n is an even integer whenever n 2 is an even integer suppose n 2 is even, then n 2 is = 2k For some integer k. Let n=2l for some integer l. This show n is ever. –fallacy if begging the question Table 2 rule of inference for quantified statements Example 13

5 odirect proof: If n is odd, then n 2 is odd n=2k+1, n 2 =(2k+1) 2 = 4k 2 +4h+1 = 2(2k 2 +2h)+1 n 2 is odd oindirect proof: If 3n+2 is odd, n is odd assume n is ever, n=2k 3n+2 = 3(2h)+2 = 2(3h+1) 3n+2 is even P  Q   Q   P

6 otrivial proof: P(n): “If a and b are positive, a  b then an a n  b n “,show P(o) is true If a  b, then a 0  b 0 since 1  1, P(o) is true - Q is true, then P  Q is true

7 o Proof by contradiction: √2 is irrational Let P: √2 is irrational Suppose that  P is true, √2 is rational √2 = a / b, a and b have no common factors 2 = a 2 /b 2 a 2 is even, a is even, a=2 c 2b 2 =4c 2 b 2 =2c 2 b 2 is even, b is even contradiction! —  P  F is true  P is false, P is true

8  Rewrite an indirect proof by a proof by contradiction  q   p is true then p  q is true  q is true and show  p must also true Suppose p and  p are true(proof by contradiction) use direct proof  q   p to show  p is also true,contradiction Example 19 : If 3n+2 is odd, n is odd assume 3n+2 is odd and n is even for n is even,we show 3n+2 is even, contradiction!

9  Proof by cases : If n is an integer not divisible by 3, then n2  1(mod 3) p: n is not divisible by 3 q: n2  1(mod 3) p is equivalent to p 1V p 2,p 1 :n  1,p 2 :n  2 [(p 1V p 2 V....p n )  q]  [( p 1  q )  ( p 2  q )  …  ( p n  q )] (p 1V p 2 )  q p  q  (p  q)  [(p  q)  (q  p) ]

10 Example 21: n is odd  n 2 is odd we show p  q and q  p are true  [ p 1  p 2  …  p n ]  [ (p 1  p 2 )  …  (p n-1  p n )  p n  p 1 ) ]  Constructive existence proof find an element a such that p(a) is true for proving  x p(x)  Nonconstructive existence proof proof by constructive

11  Prove  xp(x) is false find an element a such that p(a) is false  x  p(x) is true,   xp(x) is true,  xp(x) is false counterexample Example 25 Example 26 (the truth of a statement cannot be established by one or more examples)

12  every even positive integer greater than 4 is the sum of two primes –Goldbach’s conjecture –no counterexample has been found

13 Mathematical Induction –The sum of the first n positive cold integers,n 2 ? –P(n) is true for every positive integer n: Basic step: P(n) is true Inductive step: P(n)  P(n-1) is true for every positive integer n –[P(1)  n(P(n)  P(n+1)]   n P(n) –Example 2,3,5,6,7,8,11,12

14 Second Principle of Mathematical Induction –P(n) is true for every positive integer n: Basic step: P(1) is true Inductive step: P(1)  P(2)  …  P(m)  P(m+1) is true –Example 13 P(n): n can be written as product of primes, n  2 Basic step: P(2)

15 Second Principle of Mathematical Induction, cont. Inductive step: assume P(k) is true for all positive integers k, k  n i ) n+1 is prime ii) n+1 is composite n+1= a*b, 2  a  b  n+1 by inductive hypothesis, both a and b can be written as product of primes difficult to prove using principle of math. Induction!

16 Example 14 P(n): postage of n cents can be formed using 4-cent and 5-cent stamps, n  12 Basic step: P(n) is true Inductive step: P(n) is true i) one 4-cent stamp is used replace it with a 5-cent stamp ii) no 4-cent stamps were used n  12, at least three 5-cent were used replace three 5-cent with for 4-cent

17 Basic step: P(12), P(13),P(14) and P(15) are true Inductive step: n  15, k cents can be formed, 12  k  n to form n+1, use n-3 cents and 4-cent

18 Application of Mathematical Induction A n =2 n, n=0,1,2,… a 0 =1 a n+1 =2a n, n=0,1,2,… – recessive / inductive definitions Example 1 f(0)=3 f(n+1)=2f(n)+3 Example 2 F(n)=n! F(0)=1 F(n+1)=(n+1)F(n)

19 – Some recessive definitions of functions are based on the second principle of mathematical induction Example 5 The Fibonacci numbers f 0 =0, f 1 =1 f n =f n-1 +f n-2, n=2,3,4…

20 Example 6 ( use fibonacci numbers to prove ) show f n >  n-2,  =(1+√5)/2, n  3 P(n): f n >  n-2 Basic step: P(3) is true: f3=2 >  P(4) is true: f4=3 >(3+√5)/2 =  2

21 Inductive step: assume P(k) is true, 3  k  n, n  4  2 =  +1,  n-1 =  2 ×  n-3 =  ×  n-3 +  n-3 =  n-2 +  n-3 f n-1 >  n-3, f n >  n-2 ∴ f n+1 = f n +f n-1 >  n-2 +  n-3 =  n-1 P(n+1) is true

22 Recursive algorithms Definition 1 An algorithm is recursive if it solves a problem by reducing it to an instance of the same problem with smaller input Example 1 compute a n where a is non  ero and n  0 procedure power (a:nonzero, n:nonnegative ) if n=0 than power (a, n):=1 else power (a,n):= a×power(a,n-1)

23 Example 5 compute n! procedure factorial ( n:positive ) if n=1 than factorial(n) : = 1 else factorial (n) : = n × factorial(n-1) – a corresponding iterative procedure procedure iterative factorial ( n:positive ) x : = 1 for i : =1 to n x : =i × x x is n!

24 Example 7 found the nth Fabonacci number procedure fibonacci (n:nonnegative) if n=0 then fibonacci(0):=0 else if n=0 then fibonacci(1):=1 else fabonacci(n):=fabonacci(n-1)+ f 4 fabonacci(n-2) f 3 f 2 f 2 f 1 f 1 f 0 f 1 f 0

25 procedure iterative fibonacci (n: nonnegative) if n=0 than y:= 0 else begin x:=0 y:=1 for i:=1 to n-1 begin z : = x+y x : = y y : = z end end y is the nth fibonacci number

26 Require n-1 addition to find fn Require far less computation A recursive procedure is sometimes preferable –eases to be implemented –Machine designed to handle recursion


Download ppt "Chap 3 –A theorem is a statement that can be shown to be true –A proof is a sequence of statements to show that a theorem is true –Axioms: statements which."

Similar presentations


Ads by Google