# Class 20: Recursion with Natural Numbers (1)

Held: Tuesday, 30 September 2003

Summary: Today we consider recursion over a different domain, that of the natural numbers.

Related Pages:

Due

Notes:

• Extra credit for attending Thursday night's talk on feminist responses to science. Forum, 7 p.m. More details on misspelled signs scatered around campus.
• Are there final questions on the exam?

Overview:

• Short introduction to numeric recursion.
• Lab.

## Recursion with Numbers

• While most of the recursion we've been doing has used lists as the structure to recurse over, you can recurse with many different kinds of values.
• It is fairly common to recurse using numbers.
• The natural base cases for integers are when you hit 0 or when you hit 1.
• The natural simplification step for recursive procedure using numbers calls typically involves subtracting 1 from the argument.
• Other simplifications, such as dividing in half, are also possible.

## History

Thursday, 28 August 2003 [Samuel A. Rebelsky]

• Created automatically.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Tue Dec 9 13:59:42 2003.
The source to the document was last modified on Mon Sep 1 13:30:51 2003.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2003F/Outlines/outline.20.html`.

You may wish to validate this document's HTML ; ; Check with Bobby

Samuel A. Rebelsky, rebelsky@grinnell.edu