david evans [email protected] 1001 things every self-respecting computer scientist should know...

56
David Ev [email protected]. http://www.cs.virginia.edu/evans/cs 1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and but might not learn in CS101-CS390

Upload: alisha-joy-manning

Post on 14-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

David [email protected]

http://www.cs.virginia.edu/evans/cs390

1001 Things Every Self-Respecting

Computer Scientist Should Know

2

Ethics and

but might not learn in CS101-CS390

Page 2: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 2

Why This Isn’t a Research Pitch• The students I want to work with are:

– Resourceful enough to learn about my research by visiting my web page and reading papers

– Smart enough to pick a thesis advisor by talking to current/recent students

• I only have one hour and there are more important things to tell you than about my own research– I may go over, feel free to leave at any time

Page 3: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 3

1001 Questions

0000 What is Computer Science?0001 What problem did the first electronic programmable

computer solve?0010 Why was the first “personal computer” built?0011 Is Computer Science a science, engineering or

other?0100 What are the world’s most complex programs?0101 How do Computer Scientists manage complexity?0110 Who was the first object-oriented programmer?0111 Who invented the Internet?1000 Why should we say goodbye to “Hello World!”?

Page 4: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 4

0. What is Computer Science?

Page 5: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 5

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.

Euclid’s Elements, Book VII, Proposition 2 (300BC)

Page 6: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 6

The note on the inflected line is only difficult to you, because it is so easy. There is in fact nothing in it, but you think there must be some grand mystery hidden under that word inflected!

Whenever from any point without a given line, you draw a long to any point in the given line, you have inflected a line upon a given line.

Ada Byron (age 19), letter to Annabella Acheson (explaining Euclid), 1834

Page 7: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 7

What is the difference between

Euclid and Ada?

“It depends on what your definition of ‘is’ is.”

Bill Gates (at Microsoft’s anti-trust trial)

Page 8: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 8

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”– About “computing” not “computers”– An unnatural science

Page 9: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 9

Computer Science“How to” knowledge:

• Ways of describing imperative processes (computations)

• Ways of reasoning about (predicting) what imperative processes will do

Language

Logic

Page 10: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 10

1. What problem did the first electronic programmable

computer solve?

Page 11: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 11

ColossusFirst Programmable Computer

• Bletchley Park, 1943• Designed by Tommy

Flowers• 10 Colossi in operation at

end of WWII• Destroyed in 1960, kept

secret until 1970s• (2 years before ENIAC –

calculating artillery tables)

Page 12: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 12

Colossus’ Problem• Decode Nazi high

command messages from Lorenz Machine

• XOR encoding:

Ci = Mi Ki

– Perfect cipher, if K is random and secret

Page 13: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 13

For any given ciphertext, all plaintexts are equally possible.

Ciphertext: 0100111110101

Key: 1100000100110

Plaintext: 1000111010011 = “CS”

Why perfectly secure?

1

0 B

Page 14: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 14

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

Page 15: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 15

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

Page 16: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 16

2. Why was the first personal computer built?

Page 17: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 17

Apollo Guidance Computer, 1961-69

1 cubic foot, 70 pounds

Why did they need to fit the guidance computer in the rocket?

4KB of read/write magnetic core memory64KB of read-only memory

Page 18: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 18

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

Page 19: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 19

3. Science, Engineering or Other?

Page 20: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 20

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

Page 21: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 21

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

Page 22: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 22

Computing Power 1969-2002(in Apollo Control Computer Units)

0

500000

1000000

1500000

2000000

2500000

3000000

3500000

4000000

45000001969

1971

1972

1974

1975

1977

1978

1980

1981

1983

1984

1986

1987

1989

1990

1992

1993

1995

1996

1998

1999

2001

2002

Moore’s Law: computing power doubles every 18 months!

If Apollo Guidance Computer power is 1 inch, you have 5 miles!(1GB/4KB = 262144)

Page 23: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 23

Constraints Computer Scientists Face

• Not like those for engineers:– Cost, weight, physics, etc.– If 8 Million times what NASA 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

Page 24: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 24

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 engineering-

type constraints

Must be a Liberal Art!

Page 25: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 25

The Liberal Arts

Trivium (3 roads)

language

Quadrivium (4 roads)

numbers

Grammar Rhetoric Logic Arithmetic

Geometry

Music

Astronomy

Page 26: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 26

Liberal Arts• Grammar: study of meaning in written

expression• Rhetoric: comprehension of verbal

and written discourse• Logic: argumentative discourse for

discovering truth• Arithmetic: understanding numbers• Geometry: quantification of space• Music: number in time• Astronomy: laws of the planets and

stars

Yes, we need to understandmeaning to describe

computations

Interfaces between components, discourse

between programs and users

Logic for controlling and reasoning about

computations

Yes

Yes (graphics)

Yes (read Gödel, Escher, Bach)

Yes, read Neil DeGrasse Tyson’s essay

Triv

ium

Qua

driv

ium

Page 27: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 27

4. What are the world’s most complex programs?

Page 28: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 28

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?

Page 29: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 29

Human Genome

Produces60 Trillion Cells (6 * 1013)50 Million die every second!

Today is the 50th anniversaryof the most important scientificpaper of the 20th century!Molecular structure of Nucleic Acids, James Watson and Francis Crick. Letter to Nature, sent 2 April 1953 (2 pages)

Page 30: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 30

How Big is the Make-a-Human Program?

• 3 Billion Base Pairs– Each nucleotide is 2 bits (4 possibilities)– 3B bases * 1 byte/4 pairs = 750 MB

1 CD ~ 650 MB

Wal-Mart’s databaseis 280 Terabytes

Page 31: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 31

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 750GB * (21/64) ~ 246 MB

• Trillions of creatures, over millions of years, had to die to create this program!

Page 32: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 32

Expressiveness of DNA

• Genetic code for 2 humans differs in only 2 million bases– 4 million bits = 0.5 MB

1/3 of a floppy disk<1% of Windows 2000

Page 33: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 33

5. How do Computer Scientists manage

complexity?

Page 34: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 34

Abstraction

Adapted from Gerard Holzmann’s FSE Slides

Page 35: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 35

Abstraction in Computer Science

• Procedural Abstraction (CS101)– Abstract what to do from specific values to do

it to

• Data Abstraction (CS201)– Abstract away representation details by

specifying what you can do with something

• Abstraction by Specification (CS340)– Abstract away how details by saying what a

procedure does

Page 36: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 36

6. Who was the first Object-Oriented Programmer?

Page 37: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 37

What is an Object?

• Packaging state and procedures – state: the rep

• What a thing is

– procedures: methods and constructors• What you can do with it

Page 38: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 38

“Object-oriented programming is programming with inheritance. Data abstraction is programming using user-defined types. With few exceptions, object-oriented programming can and ought to be a superset of data abstraction. These techniques need proper support to be effective. Data abstraction primarily needs support in the form of language features and object-oriented programming needs further support from a programming environment. To be general purpose, a language supporting data abstraction or object-oriented programming must enable effective use of traditional hardware.”

Bjarne Stroustrup’s Answer

Page 39: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 39

“I invented the term

Object-Oriented and I can tell you I did not have C++

in mind.”Alan Kay

Page 40: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 40

• Object-Oriented Programming is a state of mind where you program by thinking about objects

• It is difficult to reach that state of mind if your language doesn’t have:– Mechanisms for packaging state and procedures

• Java has class

– Subtyping• Java has extends (subtype and subclass) and

implements (subtype)

• Other things can help: dynamic dispatch, implementation inheritance, automatic memory management, mixins, good Indian food, Krispy Kremes, etc.

Page 41: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 41

Who was the first object-oriented programmer?

Page 42: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 42

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

Ada Byron, 1843

Page 43: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 43

7. Who Invented the Internet?

Page 44: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 44

What is a Network?

A group of three or more connected entities communicating indirectly

Ancient Greeks had beacon chainnetworks on Greek island mountaintops

Page 45: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 45

Chappe’s Semaphore Network

Mobile Semaphore Telegraph Used in the Crimean War 1853-1856

First Line (Paris to Lille), 1794

Page 46: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 46

internetwork

A collection of multiple networks connected together, so messages can be transmitted between nodes on different networks.

Page 47: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 47

The First Internetwork• 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, transmit message to Sweden, but they don’t help.

• Denmark signs treaty with Britain, and stops communications with Sweden

Page 48: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 48

First Use of The 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.

Page 49: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 49

Licklider and Taylor’s VisionAvailable 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.

J. C. R. Licklider and Robert W. Taylor, The Computer as a Communication Device, April 1968

Page 50: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 50

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”)

Page 51: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 51

9. Why should we say “goodbye” to

“Hello World!”?

Page 52: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 52

A C++ Program

// Canonical first program

// Dana Wahoo, January 15, 2003, version 1

#include <iostream>

#include <string>

using namespace std;

int main() {cout << "Hello world! " << endl;

return 0;

}

Page 53: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 53

Goodbye “Hello World”• Doesn’t compute anything

– Computers exist for computing things

• Makes an easy human task tedious– Computers are supposed to automate

tedious tasks, not make easy tasks tedious

• Makes simple things mysterious– Even after finishing CS101 and CS201, very

few students could explain everything in it! (even without counting the #include’d files)

Page 54: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 54

Components of a C++ ProgramComments

Cruft to keep compiler happy

Mysterious meaningless return value

Mysterious overloaded operator thatbreaks abstraction barriers(are both <<’s the same?)

Mysterious magicconstants

// Canonical first program

// Dana Wahoo, January 15, 2003, version 1

#include <iostream>

#include <string>

using namespace std;

int main() {cout << "Hello world! " << endl ;

return 0 ;

}

Page 55: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 55

Summary• Computer Science is a real intellectual

discipline: not like “Automotive Engineering” or “Toaster Science”

• Computer Science is the subject most consistent with the traditional Liberal Arts offered at UVa today

• Biology became part of CS 50 years ago today

• Al Gore really did create the Internet• Goodbye “Hello World!”

Page 56: David Evans evans@cs.virginia.edu  1001 Things Every Self-Respecting Computer Scientist Should Know 2 Ethics and

2 April 2003 1001 Things 56

Any Questions?