6.001 Spring 1998: Quiz 2 grades

Quiz 2 grade distribution

Mean=74   Median=75
RangeNumber
0 < x <= 30 0
30 < x <= 50 22
50 < x <= 60 45
60 < x <= 70 77
70 < x <= 80 114
80 < x <= 90 97
90 < x <= 95 30
95 < x <= 100 11
We are posting the scores so you can see how the class did on the quiz generally. But we do not grade 6.001 on a curve. You are not in competition with others in the class. We would be perfectly happy to give everyone A's if class performance merited it.

Questions about grades

If you have questions or think we made a mistake in grading your paper, speak to your tutor, who will get the grade corrected if necessary.

Answers to the quiz


Question 1

Your student ID number and magic word were individualized based on
Problem Set 7.

Maximum grade for the question was 4 points, and was based on you
correctly listing your own magic word.



Question 2

The correct definition for change-value is

(define (change-value slot op input-value)
   (mutate-slot! slot  
      (op (slot-value slot) input-value)))

and the correct definition for mutate-slot! is n

(define (mutate-slot! slot val)
   (set-car! (cdr slot) val))

The question was worth a maximum of 12 points, with 4 points for part
(a) and  8 points for part (b).

Common errors in part (a)

* -2 for not using the selector 
* -2 for not applying op to the right arguments

Common errors in part (b)

* -3 for not using set-car! correctly
* -3 for not providing right part of structure to mutate


Question 3

The expression needed (although equivalent forms are possible) is

(lambda (form)
  (update-form form
               'taxes-owed
               (lambda (current new) new)
               (* .25 (- (income-value form)
                        (deductions-value form)))))


Maximum value for the questino is 14 points.

Common errors

* -2 for not using update-form
* -2 for not quoting the key
* -6 for not providing an appropriate procedure to execute the update
* -2 for failing to use appropriate data abstraction selectors



Question 4

The correct answers (worth 3, 2, 2, and 3 points each) are

(a) True
(b) False
(c) False
(d) True



Question 5

In the environment diagram, the following bindings hold:

create-taxes-bound, create-1040-form, create-income and trial-1040 are
all bound in the Global Environment.

Object P3 points to E2 and object P5 points to E3.

The enclosing environment for E1, E2, and E4 is the Global
Environment, and the enclosing environment for E3 is E4.

income and taxes-paid are both bound in E2.


The bindings for the variables are:

create-taxes-paid is bound to P4, create-1040-form is bound to P2,
create-income is bound to P1, trial-1040 is bound to P3, income is
bound to P5 and taxes-paid is bound to P6.

Each answer is worth 1 point.


Question 6

To be consistent with the object oriented system, the  RECOMPUTE method is:

        (lambda (self income deductions)
          (set! value (* .25 (- (ask income 'value)
                                (ask deductions 'value))))
          value)

Maximum value for the problem was 15 points.

Common errors

* -2 not using a procedure as the method
* -3 for giving an incorrect set of arguments, not that self is
required even though it is not used in the rest of the method
* -4 for not mutating the value correctly
* -4 for not using ask to get the correct new values


Question 7

Each part was worth 4 points.

Part (a) The correct answer  is D.

Part (b) The correct answer is A.


Question 8

In part (a), there are 5 possible outcomes:
4 12 14 24 144

Note that temp can be overwritten by Alyssa between Ben's two reads.
This was  the most commonly missed set of answers.

In part (b), only 14 144 remain.

Maximum value was 7 points -- grading was 1 point for each correct
answer and -1 point for each incorrect answer.


Question 9

Part (a) more-mystery is the stream of odd numbers, starting at 1

In part (b), the system will enter an infinite loop.  Since the input
is an infinite stream, the end condition for the iter loop is never
reached, and no output is provided.  If the stream ever terminated,
then the output would be in reverse order.


Return to 6.001 Home Page

Send comments about this site to 6001-webmaster@ai.mit.edu.
Copyright © 1997 by Massachusetts Institute of Technology. All rights reserved.
Last modified: April 19 1998, 10:51 AM