17.  Recursion II:  Dynamic Programming:  Problems

Last revision:  March 23, 1998

Author: YourNameGoesHere

Multiple Definitions vs. Conditionals

The "recurGCD[]" function uses two definitions.  Rewrite it with only a single definition by using an "If[]" to treat the two cases.

Loon Numbers

The first three loon numbers are all 1.  Subsequent loon numbers are obtained by computing the sum of the previous three.  What is the 10th loon number?  What is the 300th loon number?  Hint: How can it help to compute the 100th and 200th numbers before trying the 300th?  If you get an error, clear and redefine before trying again (even if you don't change the definition).

Select

Many functions we know may be defined recursively.  Write a recursive definition for "recurSelect[]" which performs the same operations as "Select[]", even with three arguments.  Do not use the "Select[]" function in your definition.

ToUpperCase

Write a recursive definition for "toU[]", which is to mimic the operation of "ToUpperCase[]".  You may use "ToUpperCase[]" applied to a single character only.  Consider using the String... family of functions, including "StringDrop[]", "StringTake[]", and "StringJoin[]".