Transcript Jeopardy

Lecture 40:
CS200
Jeopardy
Who wants to
be a
quadrillionaire?
CS200: Computer Science
University of Virginia
Computer Science
David Evans
http://www.cs.virginia.edu/~evans
Menu
Final
Project
Demos
Jeopardy
Picture
29 April 2002
University of Virginia CS 200
2
Final
Take-home
 Use anything you want except other people and
Scheme interpreter, cite any sources you use
 Pick up at end of class today
 Don’t spend more than 3 hours on the exam.
 Turn in before 5:00pm on Monday 6 May,
Olsson 236A

29 April 2002
University of Virginia CS 200
3
Project Demos
29 April 2002
University of Virginia CS 200
4
Thanks!
29 April 2002
University of Virginia CS 200
5
Jeopardy
29 April 2002
University of Virginia CS 200
6
Jeopardy Rules
$1Q, $2Q, $4Q – raise hand to answer, first
team spotted will be asked to answer, whoever
is picked must answer right away
 Lose value for wrong answer.
 All teams answer $10Q questions, answer value
at complete discretion of judges
 After all questions, there will be Final Jeopardy
 Team with the highest total, gets prizes (don’t
get cash)

29 April 2002
University of Virginia CS 200
7
CS200 Jeopardy
Lines of
Code
History
Questions too
Mostly about trivial to be in
Nematodes
this game
1
1
1
1
2
2
2
2
4
4
4
4
10
10
10
10
Final Jeopardy
(All values in $Quadrillions)
Lines of Code 1
What is the value of the
Scheme expression:
((lambda (x)
((lambda (y) (* x y)) x))
3)
29 April 2002
University of Virginia CS 200
9
Lines of Code 1
9
((lambda (x)
((lambda (y) (* x y)) x))
3)
=>
((lambda (y) (* 3 y)) 3))
=>
(* 3 3)
Return
29 April 2002
University of Virginia CS 200
10
Buffer
29 April 2002
University of Virginia CS 200
11
Lines of Code 2
With the Lazy Scheme evaluator, what
does this expression evaluate to?
((lambda (x) (if #t 200 (x 100)))
((lambda (y)
(lambda (z) (* y 2))
#f) #f))
29 April 2002
University of Virginia CS 200
12
Lines of Code 2
200
((lambda (x) (if #t 200 (x 100)))
((lambda (y)
(lambda (z) (* y 2))
#f) #f))
Bonus: what does it evaluate to with
the standard applicative order
evaluator?
Return
29 April 2002
University of Virginia CS 200
13
Buffer
29 April 2002
University of Virginia CS 200
14
Lines of Code 4
Name two programming
languages that have latent,
dynamic types.
29 April 2002
University of Virginia CS 200
15
Lines of Code 4
Scheme, PHP
Return
29 April 2002
University of Virginia CS 200
16
Buffer
29 April 2002
University of Virginia CS 200
17
Lines of Code 10

Order these by their size (smallest to biggest):
A. Primosaic Code (PS5)
B. Metacircular Evaluator Code (PS7)
C. Fugu Fish Genome (100 bases = 1 loc)
D. Human Genome (100 bases = 1 loc)
E. F-22 Stealth Fighter Jet Avionics Software
F. Windows XP
G. US Tax Code (1 page = 60 loc)
29 April 2002
University of Virginia CS 200
18
Lines of Code 10
B. Metacircular Evaluator (244 loc)
A. Primosaic Code (518 loc)
G. US Tax Code (6000 pages ~ 360 000 loc)
E. F-22 Stealth Fighter Jet Avionics Software
(1.5M lines)
C. Fugu Fish Genome (100 bases = 1 loc)
(400M bases ~ 4M loc)
D. Human Genome (3B bases ~ 30M loc)
F. Windows XP (45M lines)
Return
29 April 2002
University of Virginia CS 200
19
Buffer
29 April 2002
University of Virginia CS 200
20
History 1
Alan Perlis (first Turing award winner and
author of the SICP preface) said:
The best book on programming for the
layman is “----- -- ----------”; but that’s
because it's the best book on anything
for the layman.
It was written by
Fill in the blank.
29 April 2002
His
pen Hint
name
was
Charles
Dodgson,
Lewis
Carroll
a mathematician
and
logician at Oxford
University of Virginia CS 200
21
History 1
Alan Perlis (first Turing award winner and
author of the SICP preface) said:
The best book on programming for the
layman is “Alice in Wonderland”; but
that’s because it's the best book on
anything for the layman.
Return
29 April 2002
University of Virginia CS 200
22
Buffer
29 April 2002
University of Virginia CS 200
23
History 2
Charles Babbage
was the Lucasian
Chair of
Mathematics at
Cambridge
University. Who
is the current
Lucasian Chair?
29 April 2002
University of Virginia CS 200
24
History 2
Stephen Hawking
Others include Sir Isaac Newton, Paul
Dirac, George Stokes
Return
29 April 2002
University of Virginia CS 200
25
Buffer
29 April 2002
University of Virginia CS 200
26
History 4
 A.
 B.
 C.
 D.
 E.
 F.
Return
Who of the following were
Names
women?
Ada Lovelace
First Computer Scientist
Admiral Hopper
Creator of first compiler
First 6 programmers of ENIAC Betty Holberton, etc.
Designer of first language for (FORMAC) Jean
symbolic mathematical
Sammet
computation
Originator of most widely-used (COBOL) Admiral
language of 60s, 70s and 80s
Grace Hopper
Designer of first language to
Barbara Liskov
support data abstraction
29 April 2002
University of Virginia CS 200
27
History 4
Return
29 April 2002
University of Virginia CS 200
28
Buffer
29 April 2002
University of Virginia CS 200
29
History 10
Put these events in chronological order:
A. Alan Turing publishes “On Computable
Numbers”
B. First Mechanical Adding Machine
C. First Programmable Electronic Computer
D. First Video Game
E. LISP
F. Scheme
G. Smalltalk
29 April 2002
University of Virginia CS 200
30
History 10
B.
A.
C.
E.
D.
G.
F.
First Mechanical Adding Machine
1642 (Blaise Pascal)
Alan Turing publishes “On Computable Numbers”
1937
First Programmable Electronic Computer
Collossus, 1943
LISP
1959
First Video Game 1962
Smalltalk
1972
Scheme
1975
Return
29 April 2002
University of Virginia CS 200
31
Buffer
29 April 2002
University of Virginia CS 200
32
Mostly Nematodes 1
What fraction of all
animals in the
world are
Nematodes?
29 April 2002
University of Virginia CS 200
33
Mostly Nematodes 1
4/5ths
80% of all animals
are Nematodes!
http://elegans.swmed.edu/Nematodes/
Return
29 April 2002
University of Virginia CS 200
34
Buffer
29 April 2002
University of Virginia CS 200
35
Mostly Nematodes 2
How many cells are
in an adult Nematode
(Caenorhabditis elegans)?
29 April 2002
University of Virginia CS 200
36
Mostly Nematodes 2
959 (always exactly the
same number)
(~300 are neurons)
Return
29 April 2002
University of Virginia CS 200
37
Buffer
29 April 2002
University of Virginia CS 200
38
Bonus Question
How many cells
die every second in
an adult human?
29 April 2002
University of Virginia CS 200
39
50 Million
(out of about 50
Trillion)
Return
29 April 2002
University of Virginia CS 200
40
Buffer
29 April 2002
University of Virginia CS 200
41
Mostly Nematodes 4
Scheme was
named after what
two languages?
29 April 2002
University of Virginia CS 200
42
Mostly Nematodes 4
Planner and Conniver
Return
29 April 2002
University of Virginia CS 200
43
Buffer
29 April 2002
University of Virginia CS 200
44
Mostly Nematodes 10
What do the following acronyms stand for
(sometimes a creative, incorrect answer is
better than a dull correct answer):
cdr
LISP
NP
PHP (before 1995)
PHP (now)
29 April 2002
University of Virginia CS 200
45
Mostly Nematodes 10
cdr
contents of the decrement register
LISP – LISt Processing
NP - Non-Deterministic Polynomial
PHP (before 1995)
Personal Home Page Tools
PHP (before 1995)
PHP: Hypertext Processor
29 April 2002
University of Virginia CS 200
Return 46
Buffer
29 April 2002
University of Virginia CS 200
47
Too Trivial 1
When does the
movie Enigma
open in
Charlottesville?
29 April 2002
University of Virginia CS 200
48
Too Trivial 1
May 24
(Vinegar Hill)
Return
29 April 2002
University of Virginia CS 200
49
Buffer
29 April 2002
University of Virginia CS 200
50
Too Trivial 2
MIT’s Lab for Computer Science has 3
hockey teams:
Garbage Collectors
Execution Time
Halting Problem
Order them by the league they play in (D
league – worst, C league, B league – best)
29 April 2002
University of Virginia CS 200
51
Too Trivial 2
Halting Problem
Garbage Collectors
Execution Time
29 April 2002
D League
C League
B League
University of Virginia CS 200
52
Return
Buffer
29 April 2002
University of Virginia CS 200
53
Too Trivial 4
Who won the Cavalier
Daily’s “computergeek-for-life” award
last week?
29 April 2002
University of Virginia CS 200
54
Too Trivial 4
Portman Wills is the rightful recipient
of the computer-geek-for-life award. Yes,
he was a good fourth-year class
president. But, man, he sure knows how
to use a zip drive.
Cavalier Daily, 26 April 2002
Return
29 April 2002
University of Virginia CS 200
55
Buffer
29 April 2002
University of Virginia CS 200
56
Too Trivial 10
Put these in order from biggest to smallest:
A. Base pairs in Nematode Genome
B. US GDP (dollars)
C. Number of books in the Library of Congress
D. Comparisons to BubbleSort LOC directory
E. Comparisons to QuickSort LOC directory
F. Possible configurations of 12-rotor Lorenz machine
G. Number of steps to solve 5x5 puzzle
29 April 2002
University of Virginia CS 200
57
Too Trivial 10
G. Number of steps to solve 5x5 puzzle
(25! = 15 511 210 043 330 985 984 000 000)
D. Comparisons to BubbleSort LOC directory
(18M2 = 324T = 324 000 000 000 000
B. US GDP (dollars)
($10T = 10 000 000 000 000)
29 April 2002
University of Virginia CS 200
58
Too Trivial 10
E. Comparisons to QuickSort LOC directory
(18M log2 18M = 434M)
F. Configurations of 12-rotor Lorenz machine
(512 = 244 140 625)
A. Base pairs in Nematode Genome
(100 Million = 100 000 000)
C. Number of books in the Library of Congress
(18 Million – Jefferson donated 6,487)
29 April 2002
University of Virginia CS 200
Return
59
Buffer
29 April 2002
University of Virginia CS 200
60
Final Jeopardy:
Lambda Calculus
29 April 2002
University of Virginia CS 200
61
Final Jeopardy
Prove that all lambda
calculus terms have fixed
points. ( F,  X 
such that FX = X)
Hint: Let W =  x.F(xx)
29 April 2002
University of Virginia CS 200
62
Graduation Picture
29 April 2002
University of Virginia CS 200
63
Answer
 F,  X  such that FX = X
Let W =  x.F(xx) and X = WW.
X = WW = ( x.F(xx))W
  F (WW) = FX
29 April 2002
University of Virginia CS 200
64
Charge
Turn in your Finals before 5PM Monday
 Enjoy your summer!

29 April 2002
University of Virginia CS 200
65