SUNY Geneseo Department of Computer Science


Introduction to Induction

{Date}

CSci 141, Fall 2004
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

Voter registration and information Tuesday, Sept. 28, 11:00 - 8:30, College Union

I won't be here Monday (Sept. 27); lab will be "open lab" format (do at your own pace/time; ask questions via office hours, lecture, etc.)

Hand out Lab 4

Questions?

Reading Summary

Section 7.1 through the "Introduction" part of 7.1.2 (top of page 216)

Analysis of recursion via induction

Outline of induction

Domino effect

(Implicit induction

Strong and weak induction

Mathematical Induction

Use induction to prove that 3n is odd, for all natural numbers n

Use induction to prove that for all n >= 4, n! > 2n

Induction and Recursive Algorithms

Prove last week's algorithm for initializing a SuperArray correct

    // In class SuperArray...
    init( int i )
        if i >= 0
            A[i] = 0
            this.init( i - 1 )

Postcondition: A[0] = A[1] = ... = A[i] = 0

Base case, i = 0

Or base case, i = -1

Do induction part as mini-assignment

Next

Inductive proofs about recursive algorithms

Read remainder of Section 7.1 (i.e., top of page 216 through top of page 222)


Next Lecture