CSE 131 Module 6: Recursion

Lab


Procedure

Preparation:
  1. Consider the old camp song:
    n bottles of beer on the wall, n bottles of beer; you take one down, pass it around, n-1 bottles of beer on the wall.

    n-1 bottles of beer on the wall, n-1 bottles of beer; you take one down, pass it around, n-2 bottles of beer on the wall.

    and so on down to 0 bottles of beer on the wall.


  2. Here is a simple but interesting recursive function.
       f(x) =    x-10     if x > 100
            = f(f(x+11))  if x <= 100
    

  3. Here is another interesting recursive function:
      g(x,y)  = y+1               if x = 0
              = g(x-1,1)          if x > 0 and y = 0
              = g(x-1, g(x, y-1)) if x > 0 and y > 0
    


  4. Consider the picture below.


Submitting your work (read carefully)



Last modified 16:27:20 CDT 19 October 2017
When you done with this lab, you must be cleared by the TA to receive credit.

This demo box is for lab 6
Last name WUSTL Key Propagate?
(NOT your numeric ID) Do not propagate
lower case only
e.g. Smith j.smith
1 Copy from 1 to all others
2 Copy from 2 to all others

Acknowledgements and assertion of integrity

You must select one of the options below
The work submitted here was performed in accordance with this course's policy on collaboration.
On your honor, you have neither given nor received any unauthorized aid on this assignment.

However, the following TAs, students, or professors were supportive in completing this assignment.
Their help was also in accordance with course policies.

Thanks to (leave blank if appropriate):

In spite of seeking help as allowable by this course's policy on collaboration, you were unable to complete this assignment. No credit will be received for this assignment.

You would like to be contacted by an instructor to facilitate staying on track in this course.

Comments about this:

You have NOT abided by this course's policy on collaboration. No credit will be received for this assignment, but by checking this box, no academic integrity violation will be filed for this assignment.

You would like to be contacted by an intructor to faciliate staying on track in this course.

Comments about this:


TA: Password: