Denison CS181/DA210 Homework

Before you turn this problem in, make sure everything runs as expected. This is a combination of restarting the kernel and then running all cells (in the menubar, select Kernel$\rightarrow$Restart And Run All).

Make sure you fill in any place that says YOUR CODE HERE or "YOUR ANSWER HERE".


Short Answer Questions

This notebook shows how things look for questions that expect the student to fill in a markdown cell with a fill-in descriptive answer. Feel free to use Markdown facilities to help format your answer, like using italics and boldface, or to use bullet lists or numbered lists, if appropriate. Under the Help menu, you can find a help page that gives basic Markdown help.

Consider the following piece of code:

def f(x):
    if x == 0 or x == 1:
        return x
    return f(x - 1) + f(x - 2)

Part A (1 point)

Describe, in words, what this code does, and how it does it.

YOUR ANSWER HERE


Part B (1 points)

For what inputs will this function not behave as expected? What will happen?

YOUR ANSWER HERE