CS200: Computer Science, Spring 2003
|
Notes: Monday 26 February 2003
Schedule
- Before 10 March: Read rest of GEB part I (Chapters 2-4 and 6-9, in addition to Chapters 1 and 5 you have already read). Answer the GEB questions below.
- Friday, 14 March: Problem Set 5: Wahoo! Auctions
Notes Places, Frames and Envrionments
- Names identify places. (define x expr) and (lambda (x) expr) both create places named x.
- Frames hold names. All names must be inside a frame.
- An environment is a pointer to a frame.
- All frames except the outermost frame have pointers to a parent frame.
- The global environment is a pointer to the outermost frame. The outermost frame contains all the Scheme primitives.
(define nest (lambda (x) (lambda (x) (+ x x))))Compound Application RuleWhy must expressions be evaluated in an environment?
- Construct a new frame, enclosed in the environment of this procedure (that is, the parent of this frame is the frame this procedure's environment points to)
- Make places in that frame with the names of each parameter
- Put the values of the parameters in those places
- Evaluate the body in the new environment
How do we find the value associated with a name in an environment?
GEB Questions
Your reading assignment for Spring Break is to finish reading the first part of Gödel, Escher, Bach (up through and including Chapter IX). The questions below might help you think about the reading. Then again, they might not. I am quite certain, however, that they will not help you prepare for the quiz on March 10.
Answer all the answerable questions, but unask the unanswerable ones. This quiz will not be graded, but it won't be ungraded either. Bring your answers written out to class on Monday, 10 March.
1. Give the "correct" answer, the "more correct" answer, and the "most correct answer" to this question:
Why do programmers comment?a. (b), (c), and (d)
(a) Give compiler extra instructions
(b) Aid readability
(c) To hide code for debugging purposes
(d) (b) and (c)
(e) none of the above
b. (b), (c), (d) and a..
c. all of the above
d. all of the above except c.
e. none of the below
2. If you knew the answer to this question, what would it be?
3. Does this question have no answer?
4. Is the next question trickier than this one?
5. Was the previous question fairer than this one?
6. If this exam were graded, would your answer to the previous question be different?
6. If this exam were graded, would your answer to the previous question be different?
6. If this exam were graded, would your answer to the previous question be different?
7. If you were Gödel, how would you answer this?
8. Richard Feynman once said "If you think you know how quantum mechanics works, you're wrong." If Feynman were a logician instead, would he have said "If you think you don't understand Gödel's Theorem, then you do." or "If you don't think you don't understand Gödel's Theorem, then you don't."?
9. If this assignment was to be graded, would your answer to this question be different?
10. Ask and answer the question should I have asked instead of this one.
Links CS101 Exam
CS201 Exam
CS415 Assignment
CS588: Cryptology Midterm [Solutions] CS655 Problem Set [Answers]
PhD Qualifying ExamHofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
Byrd's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
|
cs200-staff@cs.virginia.edu Using these Materials |