CS150:
Computer Science

from Ada and Euclid to Quantum Computing and the World Wide Web

Instructor:
Greg Humphreys

Teaching Assistants:
Kristen Walcott
Gillian Smith

Staffed Lab Hours (Small Hall)
Sunday, 4-7pm
Wednesday, 3-4:30pm
Thursday, 7-8:30pm
Friday, 2-3:30pm
Saturday 1-4pm

Office Hours (Olsson 216)
MWF 11-12am

Syllabus | Problem Sets | Exams | Guides

 

# Date Title Misc
1 1/18 Introduction
2 1/20 Formal Systems and Languages
3 1/23 Evaluation and Application
4 1/25 Programming with Data  
5 1/27 Sugar  
6 1/30 Scheme Practice  
7 2/1 Scheme Practice (Cont)
8 2/3 More Recursion (last one!)
9 2/6 Sorting
10 2/8

Quicker Sorting
Some Useful Code From Class

11 2/10 Golden Ages and Orders of Growth
  • Great Books of the Western World (How many were written in the last 15 years? When was the golden age of literature?)
  • Steve Jobs: Personal computer enters 'third golden age'
  • Golden Age of Jazz
  • Masterpieces of Dutch and Danish Painting
  • Grade inflation articles (relate them to Tyson's essay): Grade Inflation at Virginia Universities: Does A Stand for Average?, Virginia-Pilot, Sunday, 9 February 2003; Cavalier Daily, Making the Grade, 19 March 2003 (the Cavalier Daily also published a letter on this subject).
  • Students Receive Fewer A's, and Princeton Calls It Progress, New York Times, 20 September 2005.
  • 12 2/13 Quickest Sorting

    Sir Tony Hoare developed the QuickSort algorithm in 1960. His first assignment at a job with a small computer manufacturer was to implement a sorting routing based on the best then-known algorithm (Shell Sort, which is a Θ(n2) algorithm that is a slight improvement on the InsertSort alrogithm we saw in class). He thought he could do better, and his boss bet him sixpence that he couldn't. Quicksort was the algorithm that resulted. Since it is Θ(n log n) on average, it is clearly better than Shell Sort theoretically (that is, it is always eventually faster once n is large enough), and is also better than Shell Sort in practice for nearly all applications.

    Hoare received the 1980 Turing Award (the highest award given in Computer Science, it is named for Alan Turing, one of the codebreakers who worked at Bletchley Park during WWII. We will learn about Turing's contributions to Computer Science after Spring Break) for contributions to the design of programming languages. His award speech, The Emperor's Old Clothes, presents principles from his experiences designing programming languages. One of his claims is,

    I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.
    CS150 students would be wise to follow this advice in all your programs!
    13 2/15 Problems vs. Procedures  
    14 2/17 Ridiculously Hard Problems P vs. NP, Clay Mathematics Institute, Millenium Prize Problem.
    15 2/20 P vs. NP  
    16 2/22 NP-Completeness  
    17 2/24 Sex, Religion, and Politics  
    18 2/27 Mutation  
    19 3/1 Think Globally, Mutate Locally  
    20 3/3 Objects

    Here's how Alan Kay describes his first assignment in graduate school:

    Head whirling, I found my desk. On it was a pile of tapes and listings, and a note: "This is the Algol for the 1108. It doesn't work. Please make it work." The latest graduate student gets the latest dirty task.

    The documentation was incomprehensible. Supposedly, this was the Case-Western Reserve 1107 Algol--but it had been doctored to make a language called Simula; the documentation read like Norwegian transliterated into English, which in fact it was. There were uses of words like activity and process that didn't seem to coincide with normal English usage.

    Finally, another graduate student and I unrolled the program listing 80 feet down the hall and crawled over it yelling discoveries to each other. The weirdest part was the storage allocator, which did not obey a stack discipline as was usual for Algol. A few days later, that provided the clue. What Simula was allocating were structures very much like the instances of Sketchpad. There were descriptions that acted like masters and they could create instances, each of which was an independent entity. What Sketchpad called masters and instances, Simula called activities and processes. Moreover, Simula was a procedural language for controlling Sketchpad-like objects, thus having considerably more flexibility than constraints (though at some cost in elegance) [Nygaard, 1966, Nygaard, 1983].

    This was the big hit, and I've not been the same since.

    Alan Kay, The Early History of Smalltalk, 1993.

    21 3/13 Inheritance If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton (on inheritance?)

    If I have not seen as far as others, it is because giants were standing on my shoulders.
    Hal Abelson (on subtyping?)

    22 3/15 Gödel's Theorem

    In connection with the interview for his US citizenship, Gödel once told me that for this occasion he had studied how the Indians had come to America. Einstein and O.Morgenstern were his witnesses, and Morgenstern has told different people about aspects of the event. The following account is given by H-Zemanek and E.Kvhler. Even though the routine examination G was to take was an easy matter, G prepared seriously for it and studied the US Constitution carefully. On the day before the interview G told Morgenstern that he had discovered a logical-legal possibility of transforming the United States into a dictatorship. Morgenstern saw that the hypothetical possibility and its likely remedy involved a complex chain of reasoning and was clearly not suitable for consideration at the interview. He urged G to keep quiet about his discovery. The next morning Morgenstern drove Einstein and G from Princeton to Trenton. Einstein was informed; on the way he told one tale after another, to divert G from his Constitution-theoretical explanations, apparently with success. At the office in Trenton, the official in charge was Judge Philip Forman, who had inducted Einstein in 1940 and struck up a friendship with him. He greeted them warmly and invited all three to attend the (normally private) examination of G.
    The judge began, "You have German citizenship up to now." G interrupted him, "Excuse me sir, Austrian." "Anyhow, the wicked dictator! but fortunately that is not possible in America." "On the contrary," G interjected, "I know how that can happen." All three joined forces to restrain G so as to turn to the routine examination.
    From Hao Wang, Reflections on Kurt Gödel.

    Years ago, the Princeton physicist John Wheeler began to wonder whether Heisenberg's uncertainty principle might not have some deep connection to Gödel's incompleteness theorem (probably the second most misunderstood discovery of the 20th century). Both, after all, seem to place inherent limits on what it is possible to know. But such speculation can be dangerous. "Well, one day [Wheeler recounts] I was at the Institute of Advanced Study, and I went to Gödel's office, and there was Gödel. It was winter and Gödel had an electric heater and had his legs wrapped in a blanket. I said, 'Professor Gödel, what connection do you see between your incompleteness theorem and Heisenberg's uncertainty principle?' And Gödel got angry and threw me out of his office."
    Jim Holt, Uncertainty About the Uncertainty Principle: Can't anybody get Heisenberg's big idea right?,
    Slate, 6 March 2002.

    23 3/17 Fat Air  
    24 3/20 Computability and the Halting Problem

    There is a remarkably close parallel between the problems of the physicist and those of the cryptographer. The system on which a message is enciphered corresponds to the laws of the universe, the intercepted messages to the evidence available, the keys for a day or a message to important constants which have yet to be determined. The correspondence is very close, but the subject matter of cryptography is very easily dealt with by discrete machinery, physics not so easily.
    Alan Turing

    25 3/22 Undecidable Problems
    26 3/24 Modeling Computing Computing is normally done by writing certain symbols on paper. We may suppose this paper is divided into squares like a child's arithmetic book. In elementary arithmetic the two-dimensional character of the paper is sometimes used. But such a use is always avoidable, and I think that it will be agreed that the two-dimensional character of paper is no essential of computation. I assume then that the computation is carried out on one-dimensional paper, i.e. on a tape divided into squares. I shall also suppose that the number of symbols which may be printed is finite. If we were to allow an infinity of symbols, then there would be symbols differing to an arbitrarily small extent. The effect of this restriction of the number of symbols is not very serious. It is always possible to use sequences of symbols in the place of single symbols. Thus an Arabic numeral such as 17 or 999999999999999 is normally treated as a single symbol. Similarly in any European language words are treated as single symbols (Chinese, however, attempts to have an enumerable infinity of symbols). The differences from our point of view between the single and compound symbols is that the compound symbols, if they are too lengthy, cannot be observed at one glance. This is in accordance with experience. We cannot tell at a glance whether 9999999999999999 and 999999999999999 are the same.

    The behaviour of the computer at any moment is determined by the symbols which he is observing. and his “state of mind” at that moment. We may suppose that there is a bound B to the number of symbols or squares which the computer can observe at one moment. If he wishes to observe more, he must use successive observations. We will also suppose that the number of states of mind which need be taken into account is finite. The reasons for this are of the same character as those which restrict the number of symbols. If we admitted an infinity of states of mind, some of them will be “arbitrarily close” and will be confused. Again, the restriction is not one which seriously affects computation, since the use of more complicated states of mind can be avoided by writing more symbols on the tape. ...

    We may now construct a machine to do the work of this computer. To each state of mind of the computer corresponds an “m-configuration” of the machine. The machine scans B squares corresponding to the B squares observed by the computer. In any move the machine can change a symbol on a scanned square or can change anyone of the scanned squares to another square distant not more than L squares from one of the other scanned squares. The move which is done, and the succeeding configuration, are determined by the scanned symbol and the m-configuration....

    Alan Turing, On computable numbers, with an application to the Entscheidungsproblem, 1936.

    27 3/27 Universal Turing Machines  
    28 3/29 The Meaning of Truth  
    29 5/31 Ray Tracing (no slides -- class outside)  
    30 4/3 Computability in Theory and Practice  
    31 4/5 Trick-or-Treat Protocols
    32 4/7 Vocational Skills
    33 4/12 Cookie Monsters  
    34 4/14 Computing with Photons  
    35 4/17 Compting with Life  
    36 4/21 Decoding DNA
    37 4/24 Public Key Cryptography
    38 4/26 Aliens
    39 4/28 Google Here is the paper for Friday: Sergey Brin and Lawrence Page, The Anatomy of a Large Scale Hypertextual Web Search Engine [PDF]. Seventh International World Wide Web Conference, 1988.