# Class 13: Recursion with Natural Numbers

Back to Recursion with Lists . On to Preconditions and postconditions.

Held Friday, September 15, 2000

Summary

In recent classes, we've studied recursive procedures in which the argument is a list and the result a list, a number, or a boolean value. We now turn our attention to recursive procedures in which the argument is a number.

Notes

• Today's reading: Recursion with numbers
• Today's lab: Recursion with numbers
• Monday's reading: Preconditions and Postconditions
• Due today: homework 2
• Monday's brown-bag lunch seems interesting. I encourage you to attend.
• This weekend is the science student research poster session. Come and see interesting summer and academic-year research.
• Today is the last day to drop a course. Please talk to me if you plan to drop 151.
• It's probably time to reflect on how the class is going.
• Are the introductory announcements helpful?
• Are you feeling comfortable with the pace?
• What kinds of sessions do you prefer?
• What can I do to help you get through the material?

Overview

Can we recurse on values other than lists? Certainly. One natural set of values to recurse on is the natural numbers.

• What do you expect are typical base cases?
• What are typical ways of making things smaller?

Some examples: factorial, sum-of-squares.

## History

Thursday, 24 August 2000

• Created as a blank outline.

Back to Recursion with Lists . On to Preconditions and postconditions.

Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.