L06 - Induction and Recursion Odd Powers Are Odd Fact: If m...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Induction and Recursion
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Odd Powers Are Odd Fact: If m is odd and n is odd, then nm is odd. Proposition: for an odd number m, m k is odd for all non-negative integer k. Proof by induction Let P(i) be the proposition that m i is odd. P(1) is true by definition. P(2) is true by P(1) and the fact. P(3) is true by P(2) and the fact. P(i+1) is true by P(i) and the fact. So P(i) is true for all i.
Background image of page 2
The Induction Rule 0 and (from n to n +1 ), proves 0 , 1 , 2 , 3 ,…. R(0), R(n) R(n+1) m  . R(m) Like domino effect… For any n>=0 Very easy to prove Much easier to prove with R(n) as an assumption.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Statements in green form a template for inductive proofs. Proof: (by induction on n) The induction hypothesis, P(n), is: Proof by Induction Let’s prove:
Background image of page 4
Proof by Induction Base Case (n = 0): 1 1 1 r r 01 20 ? 1 1 1 1 r rr r r     Wait : divide by zero bug! This is only true for r 1 1 2 1. :: 1 ( 1 1 ) Pn r r r r  n n 1 2 1 1 1 n n r r r Theorem: 1. r
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Induction Step: Assume P(n) for some n 0 and prove P(n + 1): () 1 2 1. 1 1 1 r rr r r r  +1 +1 n n Proof by Induction Have P ( n ) by assumption: So let r be any number 1, then from P ( ) we have 1 2 1 1 1 r r r n n How do we proceed?
Background image of page 6
Proof by Induction 1 1 1 1 1 n nn r rr r r  +1 n adding r n +1 to both sides, 11 () 1 1( 1 ) 1 1 1 r r r r   +1 n But since r 1 was arbitrary, we conclude (by UG), that 1 2 1. 1 1 1 r r r r +1 +1 n n which is P ( n+1 ). This completes the induction proof.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Summation Try to prove:
Background image of page 8
Proving a Property Base Case (n = 1): Induction Step: Assume P(i) for some i 1 and prove P(i + 1):
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Proving an Inequality Base Case (n = 3): Induction Step: Assume P(i) for some i 3a n d p r o v e P(i+ 1):
Background image of page 10
Prove P(0). Then prove P(n+1) assuming all of P(0), P(1), …, P(n) (instead of just P(n)). Conclude n.P(n) Strong Induction 0 1, 1 2, 2 3, …, n-1 n. So by the time we got to n+1, already know all of P(1), …, P(n) Strong induction Ordinary induction equivalent
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Claim : Every integer > 1 is a product of primes. Prime Products Proof:(by strong induction) Base case is easy. Suppose the claim is true for all 2 <= i < n. Consider an integer n. In particular, n is not prime. So n = k·m for integers k, m where n > k,m >1. Since k,m smaller than n, By the induction hypothesis, both k and m are product of primes k = p 1 p 2  94 m = q 1 q 2 214
Background image of page 12
Prime Products …So n = k m = p 1 p 2  94 q 1 2 214 is a prime product.
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/22/2010 for the course CS 23022 taught by Professor Staff during the Spring '08 term at Kent State.

Page1 / 37

L06 - Induction and Recursion Odd Powers Are Odd Fact: If m...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online