Read this before starting:

Studio Sessions Overview:

The results of your studio session are to be reported and documented in a file that you save in your workspace. You are to print and turn in one copy of that report for your group. In the descriptions of the studio exercises, verbs like report and document are indications of activities you should summarize and discuss in your report.

In your groups, take turns documenting results, looking over shoulders, and staffing the keyboard.

It is unacceptable to copy anything without understanding it. At any point, the TA or instructor can point to something you've done and ask you why it works, or change it and ask what would happen with the modification.


By the end of this session, a TA will have completed a Studio Observation form for your group. You will have to attach your team's observations so keep track and type things in as you go along for printing by the end of studio.

First, read over the problems enumerated below.

Next, pick one of the first two problems to start. If you are personally interested in a problem not favored by your group, feel free to find another group, but do not work on your own.

After that, try the third or fourth problem.

Be careful how you use the web. You are required to develop solutions as a group by thinking not by finding solutions that have been thought out by others. You must be able to explain anything that you have done.

Pick one of these two, or both:

  1. Here is a simple but interesting recursive function.
       f(x) =    x-10     if x > 100
            = f(f(x+11))  if x <= 100
    
    1. Using the substitution model, sketch the computation of f(99)
    2. Using the data flow model, sketch the computation of f(98)
    3. Using the model of your choice, sketch the computation of f(87)
    4. Discuss whether this function will terminate for all positive integers supplied as arguments.
    5. What do you expect this function to do for values of x > 100?
    6. How will it behave for values <= 100?
    7. Implement it and test it to develop or valdiate your hypotheses.
  2. Here is another interesting recursive function:
      f(x,y)  = y+1               if x = 0
              = f(x-1,1)          if x > 0 and y = 0
              = f(x-1, f(x, y-1)) if x > 0 and y > 0
    
    1. Using the data flow model, sketch the computation of f(1,0)
    2. Using the substitution model, sketch the computation of f(1,2)
    3. Using the model of your choice, sketch the computation of f(2,2)
    4. Discuss whether this function will terminate for all positive integers supplied as arguments.
    5. How do you expect this function behave with respect to x and y?
    6. Implement it and try it out for values of x < 4 and various values of y.
    7. Now try it for x = 4 and various values of y.
    8. What do you see?
    9. Why does the function behave this way?


Consider one of the following, or both:

  1. Consider the picture:

    Develop an approach for drawing the figure recursively. Investigate the YOPS Polygon if it helps your implementation.

  2. Develop your own fractal image like the one above and design an algorithm to draw it.