A good answer might be:
The base case is when a rock fragment is small enough.
No more work needs to be done.
Recursion with Triangle Numbers
Here are the two parts to recursion:
- If the problem is easy, solve it immediately.
- An easy problem is a base case.
- If the problem can't be solved immediately,
divide it into smaller problems, then:
- Solve the smaller problems by applying this procedure to each of them.
And here is how this applies to triangle numbers:
- Triangle( 1 ) = 1
- Triangle( N ) = N + Triangle( N-1 )
The problem "
Triangle(N)" is divided into two
problems: "add N to something"
Sometimes the latter can be solved immediately
(when it is the base case). Other times you need to re-apply the solution to the
Using the above, what is
(Fill in the boxes starting with the top row and work your way down.)