More Study guide for quiz on Monday, 21 October 

Forum: Com Sci 12500, U Chicago, Autumn 2002, Discuss Classwork, old
Re: News Incoming: quiz Monday 21 October, midterm around end of October (Mike O'Donnell)
Date: 2002, Oct 17
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

This Monday, 21 October, I will give a quiz in the first 15 minutes of the class. Please bring blank paper and pencil. You may not use any aids during the quiz. Time pressure will be significant. The direct impact on your grade will be small. But the quiz will cover important skills. You will probably not do well in the rest of the course unless you become fluent in these skills. The quiz will either give us confidence that you are fluent, or provide a warning shot and suggest some urgent study and practice next week.

I took the quiz myself. Including a bit of fumbling around, and pushing buttons on my stopwatch, it took me 7 minutes and 15 seconds. You will have 15 minutes. Since you didn't make up the problems, you will probably feel time pressure. I'd rather find out what you can accomplish in 15 minutes than let the thing drag out, so I'll collect the papers strictly on time. I'll ask you to finish any remaining problems outside of class.

Here is a description of the problems on the quiz:

1. S-expressions as nested lists and binary trees

I took about 4 minutes on this one, mostly making sure that I had parentheses matched properly. Do this one deliberately and carefully. Rushing will cost you time. This is definitely a case where "haste makes waste" applies.

  1. Draw the standard binary tree pictures for an S-expression that I give you (it has 4 symbols and 3 empty lists in it).

  2. Draw the standard binary tree picture for another S-expression (4 symbols, no empty lists). Write the expression in all possible ways in Scheme notation.

  3. Draw the standard binary tree picture for yet another S-expression, with an empty list at the bottom right corner. Figure out how many different ways it can be written in Scheme notation.

Make up your own binary trees, and practice finding all the different notations for them, between now and Monday morning.

2. Evaluation

I took about 2 and 1/2 minutes on this one. There is a bit less detail than in part 1, but the concept is a bit deeper. I also recommend working deliberately and carefully on this one, rather than jumping to conclusions.

  1. Evaluate an S-expression that I give you.
  2. Evaluate its value.
  3. Continue, and explain what stops you.
  4. Try a small variation.
  5. Try another small variation
  6. Answer a question depending on the relationship between the single quote mark and the symbol quote.

So, between now and Monday morning, read about quote with an eye for precise distinctions between things that go on in reading and printing vs. evaluation.Think up your own examples of expressions that can be evaluated several times. Think of more imaginative ones than '''''''''a.

3. Generic iteration on lists

I took about 1 minute on this one. If you really study my procedure in advance, you should be able to do it just as quickly.

Here is a procedure for generic left-to-right accumulation by iteration on lists.


(define ((accumulate_lr startval elteval combiner) listin)

    (cond ((null? listin) startval)

          (else           ((accumulate_rl
                             (combiner startval (elteval (car listin)))
                             elteval
                             combiner)
                               (cdr listin)))))

Define a procedure to solve a list-manipulation problem that I pose. The solution is small. I did it by providing three arguments to accumulate_lr. The whole three arguments, including spaces within and between them, only came to 45 characters.

If you don't run a bunch of examples with accumulate_lr before Monday morning, defining some list-manipulating procedures as well as arithmetic ones, then you're really shooting yourself in the foot.


Messages

1. More I reversed the order of quiz questions by Mike O'Donnell, 2002, Oct 17
2. Question scheme notation by Katie Edmonds, 2002, Oct 20
1. Feedback All legitimate input forms are Scheme notations by Mike O'Donnell, 2002, Oct 20
3. Question List question by Mark Gillam, 2002, Oct 21
1. Agree Recursive call should be accumulate_lr by Mike O'Donnell, 2002, Oct 21

to: "Study guide for quiz on Monday, 21 October"