SUNY Geneseo Department of Computer Science


Induction, Part 2

{Date}

CSci 141, Fall 2003
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

Hand out Lab 5

Questions?

Third problem in lab 4 (counting red tiles)

Induction Example

Play-act the proof that sum of first n naturals = n(n+1)/2

(See book for proof)

People in class "proved" that this theorem holds for specific values of n. First had to do the arithmetic (induction's base case), but others could all just point to the fact that we know that whenever the theorem is true of one number it's true of the next, and to the fact that it was true for the previous person, to make their case (induction step, which must apply to any number and its successor in general).

Template for induction proof:

Example

Mini-Assignment: Use induction to show that whenever n >= 4, n! > 2n

Base case: n = 4.

Induction

Connection to Recursion

Recursion in an algorithm uses a small problem to solve bigger one

Induction step uses knowledge about a small theorem to prove a bigger one

To prove (or discover) something about recursive case assume the algorithm works for small problem, prove (or figure out) how that solves a bigger problem

Base cases solve/prove smallest problems/theorems, in order to get things started

Next

Read Section 7.1.2


Next Lecture