# Recursion

## Logistics

- Due: Thursday, May 28th no later than 5pm.
- Submission instructions: complete the assigned number of activities in each of the assigned subsections of Chapter 16. You do not need to submit anything to Brightspace.
- Deadline reminder: once this deadline passes, Runestone Interactive will no longer allow you to collect points for completing the activities.

## Key ideas

### From chapter 16:

- A recursive algorithm must obey 3 laws:
- A recursive algorithm must have a base case.
- A recursive algorithm must change its state and move toward the base case.
- A recursive algorithm must call itself, recursively.

- For some problems, a recursive solution may be more elegant than an iterative solution.

## Assignment

- Complete the required number of activities for each subsection in Recursion.

## Grading - 10 points

- 10 points - the required number of activities were completed for each subsection before the deadline.

## Grading turnaround

This reading assignment will be graded with scores in Brightspace by office hours the following class day.

### Optional activities

## Activity 1

The factorial of a number, written n!, is the product of the integers 1 through n. For example, 5! equals 1*2*3*4*5, or 120. We choose to define 0! to be 1, the multiplicative identity. Write two Python functions, `iterative_factorial`

and `recursive_factorial`

, which take in an integer greater than or equal to zero and return the factorial of the integer. `iterative_factorial`

should use iteration and `recursive_factorial`

should use recursion.