101 Things Every Computer Scientist Should Know David Evans

advertisement
101 Things Every
Computer Scientist
Should Know
2
David Evans
evans@cs.virginia.edu
http://www.cs.virginia.edu/evans
University of Virginia
Department of Computer Science
101 Questions
0. What is Computer Science?
1. What problem did the first electronic
programmable computer solve?
2. Why was the first “personal computer”
built?
3. Is Computer Science a science,
engineering or other?
4. What are the world’s most complex
programs?
24 August 2002
101 Things
2
0. What is
Computer Science?
24 August 2002
101 Things
3
Let AB and CD be the two given numbers not
relatively prime. It is required to find the greatest
common measure of AB and CD.
If now CD measures AB, since it also measures
itself, then CD is a common measure of CD and
AB. And it is manifest that it is also the greatest, for
no greater number than CD measures CD. But, if
CD does not measure AB, then, when the less of
the numbers AB and CD being continually
subtracted from the greater, some number is left
which measures the one before it.
Euclid’s Elements, Book VII, Proposition 2 (300BC)
24 August 2002
101 Things
4
By the word operation, we mean any process which
alters the mutual relation of two or more things, be this
relation of what kind it may. This is the most general
definition, and would include all subjects in the universe.
Again, it might act upon other things besides number,
were objects found whose mutual fundamental relations
could be expressed by those of the abstract science of
operations, and which should be also susceptible of
adaptations to the action of the operating notation and
mechanism of the engine... Supposing, for instance,
that the fundamental relations of pitched sounds in the
science of harmony and of musical composition were
susceptible of such expression and adaptations, the
engine might compose elaborate and scientific pieces of
music of any degree of complexity or extent.
Ada, Countess of Lovelace, around 1830
24 August 2002
101 Things
5
What is the
difference
between
Euclid and
Ada?
“It depends on what your
definition of ‘is’ is.”
Bill Gates (at Microsoft’s antitrust trial)
24 August 2002
101 Things
6
Geometry vs. Computer Science
• Geometry (mathematics) is about
declarative knowledge: “what is”
If now CD measures AB, since it also measures itself,
then CD is a common measure of CD and AB
• Computer Science is about imperative
knowledge: “how to”
Computer Science has nothing to do
with beige (or translucent blue) boxes
called “computers” and is not a science.
24 August 2002
101 Things
7
Computer Science
“How to” knowledge:
• Ways of describing and carrying out
imperative processes (computations)
• Ways of reasoning about (predicting)
what imperative processes will do
24 August 2002
101 Things
8
1. What problem did the first
electronic programmable
computer solve?
24 August 2002
101 Things
9
Colossus
First Programmable Computer
• Bletchley Park, 1943
• Designed by Tommy
Flowers
• 10 Colossi in operation at
end of WWII
• Destroyed in 1960, kept
secret until 1970s
• (ENIAC: 1946 – calculating
artillery tables)
24 August 2002
101 Things
10
Colossus’ Problem
• Decode Nazi high
command messages
from Lorenz Machine
• XOR encoding:
Ci = Mi  Ki
– Perfect cipher, if K is
random and secret
24 August 2002
101 Things
11
Why perfectly secure?
For any given ciphertext, all plaintexts are
equally possible.
Ciphertext:
Key:
Plaintext:
24 August 2002
0100111110101
1
1100000100110
B
1000111010011
= “CS”
0
101 Things
12
Breaking Lorenz
• Operator and receiver need
same keys
• Generate key bits using rotor
machine, start with same
configuration
• One operator retransmitted a message (but
abbreviated message header the second
time!)
• Enough for Bletchley Park to figure out key –
and structure of machine that generated it!
• But still had to try all configurations
24 August 2002
101 Things
13
Colossus
• Read ciphertext and Lorenz wheel
patterns from tapes
• Tried each alignment, calculated
correlation with German
• Decoded messages (63M letters by 10
Colossus machines) that enabled Allies
to know German troop locations to plan
D-Day
24 August 2002
101 Things
14
2. Why was the first personal
computer built?
24 August 2002
101 Things
15
Apollo Guidance Computer, 1961-69
1 cubic foot,
70 pounds
4KB of read/write
magnetic core
memory
64KB of read-only
memory
Why did they need to fit the
guidance computer in the rocket?
24 August 2002
101 Things
16
AGC History
• Needed all guidance to be on board in
case Soviets jammed signals for Earth
• Design began in 1961
• Risky decision to use Integrated Circuits
(invented in 1958)
– Building 4 prototypes used 60% of all ICs
produced in the US in the early 60s!
– Spurred industry growth
24 August 2002
101 Things
17
3. Science, Engineering or
Other?
24 August 2002
101 Things
18
Science?
• Understanding Nature through
Observation
– About real things like bowling balls, black
holes, antimatter, electrons, comets, etc.
• Math and Computer Science are about
fake things like numbers, graphs,
functions, lists, etc.
– Computer Science is a useful tool for doing
real science, but not a real science
24 August 2002
101 Things
19
Engineering?
“Engineering is design under
constraint… Engineering is synthetic
- it strives to create what can be, but it
is constrained by nature, by cost, by
concerns of safety, reliability,
environmental impact,
manufacturability, maintainability and
many other such 'ilities.' ...”
William Wulf
24 August 2002
101 Things
20
Computing Power 1969-2002
(in Apollo Control Computer Units)
4500000
4000000
Moore’s Law: computing power
doubles every 18 months!
3500000
3000000
2500000
If Apollo Guidance
Computer power is 1
inch, you have 5 miles!
(1GB/4KB = 262144)
2000000
1500000
1000000
500000
21
2002
2001
1999
1998
1996
1995
1993
1992
1990
1989
1987
101 Things
1986
1984
1983
1981
1980
1978
1977
1975
1974
24 August 2002
1972
1971
1969
0
Constraints Computer Scientists Face
• Not like those for engineers:
– Cost, weight, physics, etc.
– If 4 Million times what people had in 1969
isn’t enough for you, wait until 2006 and
you will have 32 Million times…
• More like those for Musicians and
Poets:
– Imagination and Creativity
– Complexity of what we can understand
• Cost of human effort
24 August 2002
101 Things
22
So, what is computer science?
• Science
– No: its about fake things like numbers, not
about observing and understanding nature
• Engineering
– No: we don’t have to deal with engineeringtype constraints
Must be a Liberal Art!
24 August 2002
101 Things
23
The Liberal Arts
Trivium (3 roads)
Grammar
Rhetoric
Quadrivium (4 roads)
Logic Arithmetic
Music
Geometry
24 August 2002
101 Things
Astronomy
24
Liberal Arts
Quadrivium
Trivium
Yes, we need to understand
• Grammar: study of meaning in
meaning to describe
written expression
computations
• Rhetoric: comprehension of verbal Interfaces between
components, discourse
and written discourse
between programs and users
• Logic: argumentative discourse for Logic for controlling
and reasoning about
discovering truth
computations
• Arithmetic: understanding numbers
Yes
• Geometry: quantification of space
Yes (graphics)
• Music: number in time
Yes (read Gödel,
• Astronomy: laws of the planets and
Escher, Bach)
stars
Yes, read Neil DeGrasse Tyson’s essay
24 August 2002
101 Things
25
4. What are the world’s most
complex programs?
24 August 2002
101 Things
26
Complex Programs
• Apollo Guidance Software
– ~36K instructions
• F-22 Steath Fighter Avionics Software
– 1.5M lines of code (Ada)
• 5EEE (phone switching software)
– 18M lines
• Windows XP
– ~50M lines (1 error per kloc ~ 50,000 bugs)
• Anything more complex?
24 August 2002
101 Things
27
Human Genome
Produces
60 Trillion Cells (6 * 1013)
50 Million die every second!
24 August 2002
101 Things
28
How Big is the
Make-a-Human Program?
• 6 Billion Base Pairs
– Each nucleotide is 2 bits (4 possibilities)
– 6B bases * 1 byte/4 pairs = 1.5GB
1 CD ~ 650 MB
24 August 2002
101 Things
29
Encoding is Redundant
• DNA encodes proteins
• Every sequence of 3 base pairs one of
20 amino acids (or stop codon)
– 21 possible codons, but 43 = 64 possible
values
– So, really only 1.5GB * (21/64) ~ 500 MB
• Most of genome is inactive (perhaps
only 3% = 45MB matters)
24 August 2002
101 Things
30
Expressiveness of DNA
• Genetic code for 2 humans differs in
only 2.1 million bases
– 4 million bits = 0.5 MB
1/3 of a floppy disk
<1% of Windows 2000
• Trillions of creatures, over millions of
years, had to die to create this program!
24 August 2002
101 Things
31
Summary
• Computer Science is a real intellectual
discipline: not like “Automotive
Engineering”
• Lots of interesting computer science
happened before 2001 1950 1M years ago
• All you have left to do to get a PhD, is
convince 5 PhDs you deserve one!
24 August 2002
101 Things
32
Any Questions?
24 August 2002
101 Things
33
24 August 2002
101 Things
34
4. Who Invented the Internet?
24 August 2002
101 Things
35
4a. Who Invented Networking?
24 August 2002
101 Things
36
What is a Network?
A group of three or more connected
communicating entities
24 August 2002
101 Things
37
Beacon Chain Networking
Thus, from some far-away beleaguered
island, where all day long the men have
fought a desperate battle from their city
walls, the smoke goes up to heaven; but no
sooner has the sun gone down than the light
from the line of beacons blazes up and
shoots into the sky to warn the neighbouring
islanders and bring them to the rescue in
their ships.
Iliad, Homer, 700 BC
Chain of beacon’s signaled Agammemnon’s return (~1200BC),
spread on Greek peaks over 600km.
24 August 2002
101 Things
38
Chappe’s Semaphore Network
First Line (Paris to Lille), 1794
24 August 2002
Mobile Semaphore Telegraph
Used in the Crimean War 1853-1856
101 Things
39
Latency and Bandwidth
• Napoleon’s Network (Paris to Toulon, 475 miles)
• Latency: 13 minutes (1.6s per mile)
– What is the delay at each signaling station, how many
stations to reach destination
– At this rate, it would take ~1 hour to get a bit from
California
• Bandwidth: 2 symbols per minute (98 possible
symbols, so that is ~13 bits per minute
– How fast can signalers make symbols
– At this rate, it would take you 122 hours to download
department homepage (without pictures)
24 August 2002
101 Things
40
internetwork
A collection of multiple networks
connected together, so messages can
be transmitted between nodes on
different networks.
24 August 2002
101 Things
41
Okay, so who invented
the Internet?
24 August 2002
101 Things
42
The First Internet
• 1800: Sweden and Denmark worried about
Britain invading
• Edelcrantz proposes link across strait
separating Sweden and Denmark to connect
their (signaling) telegraph networks
• 1801: British attack Copenhagen, network
transmit message to Sweden, but they don’t
help.
• Denmark signs treaty with Britain, and stops
communications with Sweden
24 August 2002
101 Things
43
First Use of Internet
• October 1969: First packets on the
ARPANet from UCLA to Stanford.
Starts to send "LOGIN", but it crashes
on the G.
• 20 July 1969:
Live video (b/w) and
audio transmitted from
moon to Earth, and to
several hundred
televisions worldwide.
24 August 2002
101 Things
44
The Modern Internet
• Packet Switching: Leonard Kleinrock (UCLA)
thinks he did, Donald Davies and Paul Baran,
Edelcrantz’s signalling network (1809) sort of
did it
• Internet Protocol: Vint Cerf, Bob Kahn
• Vision, Funding: J.C.R. Licklider, Bob Taylor
• Government: Al Gore (first politician to promote
Internet, 1986; act to connect government networks
to form “Interagency Network”)
24 August 2002
101 Things
45
Licklider and Taylor’s Vision
Available within the network will be functions and services to
which you subscribe on a regular basis and others that you
call for when you need them. In the former group will be
investment guidance, tax counseling, selective dissemination
of information in your field of specialization, announcement of
cultural, sport, and entertainment events that fit your
interests, etc. In the latter group will be dictionaries,
encyclopedias, indexes, catalogues, editing programs,
teaching programs, testing programs, programming systems,
data bases, and – most important – communication, display,
and modeling programs. All these will be – at some late
date in the history of networking - systematized and
coherent; you will be able to get along in one basic
language up to the point at which you choose a
specialized language for its power or terseness.
24 August 2002
J. C. R. Licklider and Robert W. Taylor, The Computer
as a Communication Device, April 1968
101 Things
46
Download