University of Virginia, Department of Computer Science CS200: Computer Science, Spring 2004

Notes: Friday 5 March 2004

• Now: Problem Set 5
• Before 15 March: Read the rest of GEB Part I (see Notes 5)
• Monday, 22 March: Problem Set 6

The schedule for the rest of the semester has been revised:

• Problem Set 7 will be handed out on 22 March, and due on 2 April.
• Problem Set 8 will be handed out on 2 April, and due on 12 April (Part I) and 26 April (Final).
• Exam 2 will be handed out on 16 April and due on 19 April.
Quicksort
```(define (quicksort cf lst)
(if (null? lst) lst
(append
(quicksort cf
(filter (lambda (el) (cf el (car lst)))
(cdr lst)))
(list (car lst))
(quicksort cf
(filter (lambda (el) (not (cf el (car lst))))
(cdr lst))))))
```
Sort these evaluations according to how much time they are likely to take:
1. (quicksort < (intsto 100))
2. (quicksort < (rand-int-list 100))
3. (quicksort < (reverse (intsto 100)))
4. (quicksort > (reverse (intsto 100)))
5. (tuttlesort < (intsto 100))
6. (tuttlesort < (rand-int-list 100))
7. (map (lambda (x) x) (intsto 100))
8. (map (lambda (x) (* x x) (intsto 100))
9. (quicksort < (apply append (map (lambda (n) (intsto n)) (intsto 100))))

GEB Study Guide

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 that will not be given on March 15.

1. If you knew the answer to this question, what would it be?

2. Does this question have no answer?

3. Is the next question trickier than this one?

4. Was the previous question fairer than this one?

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."?