16.001 Jeopardy500400300200100data500500500500500500400400400400400400300300300300300300200200200200200200100100100100100100not on the finalterminologycomputing theoryenvironmentmodelevaluationschemeexpressionsFinal JeopardyScheme Expressions: 100These are the two methods which may be called on any object in the object-oriented programming system from Project 4.Scheme Expressions: 100These are the two methods which may be called on any object in the object-oriented programming system from Project 4.*What are IS-A and TYPE ?back to contentsScheme Expressions: 200This is printed in response to the second expression:(define f (lambda (/) (lambda (a b) (b / a))))((f 6) 2 -)Scheme Expressions: 200This is printed in response to the second expression:(define f (lambda (/) (lambda (a b) (b / a))))((f 6) 2 -)* What is 4?back to contents2Scheme Expressions: 300The usual name for the built-in Scheme function computed by this procedure:(define (what? p x) (fold-right (lambda (a b) (cons (p a) b)) nil x))Scheme Expressions: 300The usual name for the built-in Scheme function computed by this procedure:(define (what? p x) (fold-right (lambda (a b) (cons (p a) b)) nil x))* What is map?back to contentsScheme Expressions: 400If double is a procedure that takes a procedure of one argument and returns a procedure that applies the original procedure twice, this is the value returned by:(((double (double double)) inc) 5) Scheme Expressions: 400If double is a procedure that takes a procedure of one argument and returns a procedure that applies the original procedure twice, this is the value returned by:(((double (double double)) inc) 5)* What is 21?back to contentsScheme Expressions: 500This function of one argument, an infinite stream, produces as output an infinite stream whose values are the pair-wise averages of the input stream. e.g.(smooth <stream 1 3 6 2 ... >)-> <stream 2 4.5 4 ... >Scheme Expressions: 500* What is(define (smooth s)(cons-stream (/ (+ (stream-car s) (stream-car (stream-cdr s))) 2)(smooth (stream-cdr s)))) ?back to contents3Data: 100The number of cons cells in the following data structure:(list (cons (list 1 2) (list)) 3)Data: 100The number of cons cells in the following data structure:(list (cons (list 1 2) (list)) 3)* What is 5?back to contentsData: 200A mathematical description for the stream:(define foo(cons-stream 1 (add-streams foo foo)))Data: 200A mathematical description for the stream:(define foo(cons-stream 1(add-streams foo foo)))* What are the powers of two?back to contentsData: 300It is the printed value of the last expression:(define x ‘(a b x))(define y (list x x (list ‘x x)))(set-cdr! (cdr y) (list (quote x)))yData: 300It is the printed value of the last expression:(define x ‘(a b x))(define y (list x x (list ‘x x)))(set-cdr! (cdr y) (list (quote x)))y*What is ((a b x) (a b x) x) ?back to contents4Daily Double!Data: 400This scheme code (which doesn't use quotation) would print out as: ((1 . 2) 3 . 4)Data: 400This scheme code (which doesn't use quotation) would print out as: ((1 . 2) 3 . 4)* What is(cons (cons 1 2) (cons 3 4)) ?back to contentsData: 500The scheme expression(s) needed to create this data structure:x:Data: 500The scheme expression(s) needed to create this data structure:* What is (define x (list 1 2 3))(set-car! x (cddr x))(set-car! (cdr x) x)(set-car! (cddr x) (cdr x))(set-cdr! (cddr x) x) ?x:back to contentsEvaluation: 100The value of the following expression: (let ((a 3))(let ((a 4)(b a))(list a b)))5Evaluation: 100The value of the following expression: (let ((a 3))(let ((a 4)(b a))(list a b)))*What is (4 3) ?back to contentsEvaluation: 200The number of times m-eval is invoked when the following expression is entered into the evaluator:((lambda (x) (* x 2)) 3)Evaluation: 200The number of times m-eval is invoked when the following expression is entered into the evaluator:((lambda (x) (* x 2)) 3)* What is 7: combination, lambda, 3, (* x 2), *, x, 2 ?back to contentsEvaluation: 300Using this type of evaluation some constructs (such as if, and, & or) would not need to be special forms.Evaluation: 300Using this type of evaluation some constructs (such as if, and, & or) would not need to be special forms.* What is normal order/lazy application?back to contentsEvaluation: 400The result of evaluating this expression:(letrec((fact (lambda (n)(* n (fact (decr n)))))(decr (lambda (x) (- x 1))))(fact 4))6Evaluation: 400The result of evaluating this expression:(letrec((fact (lambda (n)(* n (fact (decr n)))))(decr (lambda (x) (- x 1))))(fact 4))* What is an infinite loop?back to contentsEvaluation: 500The correct matching of the following three expressions:A: In applicative order...B: In normal order without memoization...C: In normal order with memoization......the arguments passed in to a combination...1: ... are evaluated at most once.2: ... are evaluated exactly once.3: ... may be evaluated many times or not at all.Evaluation: 500The correct matching of the following three expressions:* What is A-2, B-3, C-1?back to contentsEnvironment Model: 100If you program without these, the order of evaluation is not important and the substitution model is sufficient. Repeated evaluation of sub-expressions may affect performance, but not the resulting value.Environment Model: 100If you program without these, the order of evaluation is not important and the substitution model is sufficient. Repeated evaluation of sub-expressions may affect performance, but not the resulting value.* What is a side effect?back to contentsEnvironment Model: 200The opposite of syntax, changing this may affect how the environment model is drawn.7Environment Model: 200The opposite of syntax, changing this may affect how the environment model is drawn.* What are the semantics of a language?back to contentsEnvironment Model: 300The environment diagram resulting from the evaluation of this expression:(define f ((lambda () (define x 10)(lambda (y) (+ x y)))))Environment Model: 300What is:?f:p: yb: (+ x y)p: noneb: (define x 10) (lambda (y)(+ x y))x: 10back to contentsEnvironment Model: 400Under dynamic scoping, the value of the last expression below:(define op square)(define (foo op) (op a))(define a 4)(let ((a 9)(op (lambda (x) x))) (foo sqrt))Environment Model: 400Under dynamic scoping, the value of the last expression below:(define op square)(define (foo op) (op a))(define a 4)(let ((a 9)(op (lambda (x) x))) (foo sqrt))* What is 3?back to contentsEnvironment Model: 500This
View Full Document