<<

Introduction to

Ian Leslie with thanks to Robin Milner, Andrew Pitts and others...

Computer Laboratory Introduction to CS, 2003 – p.1 In the beginning. . .

Introduction to CS, 2003 – p.2 Mathematics and Logic: solution of Hilbert’s Entscheidungsproblem and Church-Turing notion of (un)computability. lambda calculus Turing machines

Origins (30s, 40s, 50s) What gave rise to Computer Science as a distinctive intellectual discipline?

Introduction to CS, 2003 – p.3 Origins (30s, 40s, 50s) What gave rise to Computer Science as a distinctive intellectual discipline?

Mathematics and Logic: solution of Hilbert’s Entscheidungsproblem and Church-Turing notion of (un)computability. lambda calculus Turing machines

Introduction to CS, 2003 – p.3 Posed by Hilbert at 1928 International Congress of Mathematicians; he thought the answer would be “yes”!

Church and Turing proved him wrong (1935-7).

Hilbert’s Entscheidungsproblem Is there an which, when fed any statement in of arithmetic, determines in a finite number of steps whether or not the statment can be proved from Peano’s axioms for natural numbers?

Introduction to CS, 2003 – p.4 Church and Turing proved him wrong (1935-7).

Hilbert’s Entscheidungsproblem Is there an algorithm which, when fed any statement in formal language of arithmetic, determines in a finite number of steps whether or not the statment can be proved from Peano’s axioms for natural numbers?

Posed by Hilbert at 1928 International Congress of Mathematicians; he thought the answer would be “yes”!

Introduction to CS, 2003 – p.4 Hilbert’s Entscheidungsproblem Is there an algorithm which, when fed any statement in formal language of arithmetic, determines in a finite number of steps whether or not the statment can be proved from Peano’s axioms for natural numbers?

Posed by Hilbert at 1928 International Congress of Mathematicians; he thought the answer would be “yes”!

Church and Turing proved him wrong (1935-7).

Introduction to CS, 2003 – p.4 Engineering: from Turing Machine to von Neumann architecture to real machines, driven by the numerical & data-processing needs of the scientific, military and industrial communities.

FORTRAN COBOL and of course COMPUTERS, eg EDSAC (Wilkes)

Origins (30s, 40s, 50s) What gave rise to Computer Science as a distinctive intellectual discipline?

Introduction to CS, 2003 – p.5 and of course COMPUTERS, eg EDSAC (Wilkes)

Origins (30s, 40s, 50s) What gave rise to Computer Science as a distinctive intellectual discipline?

Engineering: from Turing Machine to von Neumann architecture to real machines, driven by the numerical & data-processing needs of the scientific, military and industrial communities.

FORTRAN COBOL

Introduction to CS, 2003 – p.5 Origins (30s, 40s, 50s) What gave rise to Computer Science as a distinctive intellectual discipline?

Engineering: from Turing Machine to von Neumann architecture to real machines, driven by the numerical & data-processing needs of the scientific, military and industrial communities.

FORTRAN COBOL and of course COMPUTERS, eg EDSAC (Wilkes)

Introduction to CS, 2003 – p.5 Cognitive sciences: input from physiology, psychology, linguistics. Can machines exhibit human-like intelligence? Relationship between thinking and computation? Symbolic (non-numerical) computation.

LISP

Origins (30s, 40s, 50s) What gave rise to Computer Science as a distinctive intellectual discipline?

Introduction to CS, 2003 – p.6 Origins (30s, 40s, 50s) What gave rise to Computer Science as a distinctive intellectual discipline?

Cognitive sciences: input from physiology, psychology, linguistics. Can machines exhibit human-like intelligence? Relationship between thinking and computation? Symbolic (non-numerical) computation.

LISP

Introduction to CS, 2003 – p.6 The classical age. . .

Introduction to CS, 2003 – p.7 Classical era (60s, 70s) A single computer

“mainframes”, time-sharing

Architecture of computers processor and memory technologies

Architecture of structures for data & languages for analysis of correctness and efficiency

Artificial intelligence suffered from lack of computing power

Introduction to CS, 2003 – p.8 Classical era (60s, 70s) A single computer

“mainframes”, time-sharing

Architecture of computers processor and memory technologies

Architecture of computing structures for data & languages for algorithms analysis of correctness and efficiency

Artificial intelligence suffered from lack of computing power

Introduction to CS, 2003 – p.9 E.g slope lopes, poles, slope → sorted doters, sorted, stored, strode →

A classic example (Thanks to Steven Rudich, CMU and Jon Bentley’s “Programming Pearls”) We have a 70,000 word dictionary.

Task: write a program that

inputs a word

outputs all anagrams of that word occurring in the dictionary.

Introduction to CS, 2003 – p.10 A classic example (Thanks to Steven Rudich, CMU and Jon Bentley’s “Programming Pearls”) We have a 70,000 word dictionary.

Task: write a program that inputs a word outputs all anagrams of that word occurring in the dictionary.

E.g slope lopes, poles, slope → sorted doters, sorted, stored, strode → Introduction to CS, 2003 – p.10 This is v er y slo w on long inputs—e.g. at a microsecond/iteration, 17-letter word takes about a decade to process!

Novice hacker solution Loop through all possible ways of rearranging the input word

use binary search to look up each rearrangement in dictionary

if found, output it.

Introduction to CS, 2003 – p.11 Novice hacker solution Loop through all possible ways of rearranging the input word

use binary search to look up each rearrangement in dictionary

if found, output it. This is v er y slo w on long inputs—e.g. at a microsecond/iteration, 17-letter word takes about a decade to process!

Introduction to CS, 2003 – p.11 Much faster—comparing X with each of 70,000 Y takes about 15 seconds.

Intermediate hacker solution Subroutine ANAGRAM(X,Y): sort the letters in X and Y and test the resulting words for equality.

Main routine: input word X; run through the dictionary words Y in order, outputting Y if ANAGRAM(X,Y)=TRUE.

Introduction to CS, 2003 – p.12 Intermediate hacker solution Subroutine ANAGRAM(X,Y): sort the letters in X and Y and test the resulting words for equality.

Main routine: input word X; run through the dictionary words Y in order, outputting Y if ANAGRAM(X,Y)=TRUE.

Much faster—comparing X with each of 70,000 Y takes about 15 seconds.

Introduction to CS, 2003 – p.12 Überhacker solution IDEA: don’t keep the dictionary in dictionary order!—rearrange it into anagram classes.

Introduction to CS, 2003 – p.13 deorst aelr → elops sort letters aelr → elops deorst

Überhacker solution IDEA: don’t keep the dictionary in dictionary order!—rearrange it into anagram classes.

doters lear lopes real slope stored

Introduction to CS, 2003 – p.14 deorst aelr elops aelr elops deorst

Überhacker solution IDEA: don’t keep the dictionary in dictionary order!—rearrange it into anagram classes.

doters lear lopes → sort letters real slope → stored

Introduction to CS, 2003 – p.14 Überhacker solution IDEA: don’t keep the dictionary in dictionary order!—rearrange it into anagram classes.

doters deorst lear aelr lopes → elops sort letters real aelr slope → elops stored deorst

Introduction to CS, 2003 – p.14 lear aelr real aelr doters deorst stored deorst lopes elops slope elops

Überhacker solution IDEA: don’t keep the dictionary in dictionary order!—rearrange it into anagram classes.

deorst aelr ↓ elops sort list aelr ↓ elops deorst

Introduction to CS, 2003 – p.15 Überhacker solution IDEA: don’t keep the dictionary in dictionary order!—rearrange it into anagram classes.

lear aelr real aelr doters ↓ deorst sort list stored deorst lopes ↓ elops slope elops

Introduction to CS, 2003 – p.15 Now the program is: Input X; X’ := sorted version of X; use binary search to find the anagram class of X’ in the pre-processed dictionary

Very fast—what previously took a decade now runs in less than 1/1000 seconds.

Überhacker solution Pre-processing the dictionay into anagram classes is a one-time cost.

Introduction to CS, 2003 – p.16 Very fast—what previously took a decade now runs in less than 1/1000 seconds.

Überhacker solution Pre-processing the dictionay into anagram classes is a one-time cost.

Now the program is: Input X; X’ := sorted version of X; use binary search to find the anagram class of X’ in the pre-processed dictionary

Introduction to CS, 2003 – p.16 Überhacker solution Pre-processing the dictionay into anagram classes is a one-time cost.

Now the program is: Input X; X’ := sorted version of X; use binary search to find the anagram class of X’ in the pre-processed dictionary

Very fast—what previously took a decade now runs in less than 1/1000 seconds.

Introduction to CS, 2003 – p.16 Classical era (60s, 70s) A single computer

“mainframes”, time-sharing

Architecture of computers processor and memory technologies

Architecture of computing structures for data & languages for algorithms analysis of correctness and efficiency

Artificial intelligence suffered from lack of computing power

Introduction to CS, 2003 – p.17 A DISTINCTIVE INTELLECTUAL DISCIPLINE. VERY COMFORTABLE. BUT THEN. . .

Classical era (60s, 70s) A single computer

Architecture of computers

Architecture of computing

Artificial intelligence

Introduction to CS, 2003 – p.18 Classical era (60s, 70s) A single computer

Architecture of computers

Architecture of computing

Artificial intelligence

A DISTINCTIVE INTELLECTUAL DISCIPLINE. VERY COMFORTABLE. BUT THEN. . .

Introduction to CS, 2003 – p.18 O Brave New World. . .

Introduction to CS, 2003 – p.19 AND WE ALL RELY ON IT MUCH MORE!

Modern era (80s on) Many computers

, parallelism, networking

Interaction computer-computer

human-computer

The communications revolution

computing and communications converge

Introduction to CS, 2003 – p.20 AND WE ALL RELY ON IT MUCH MORE!

Modern era (80s on) Many computers

microprocessors, parallelism, networking

Interaction computer-computer

human-computer

The communications revolution

computing and communications converge

Previous methods often become inappropriate (e.g. may not be able to preprocess a distributed dictionary)

Introduction to CS, 2003 – p.20 Modern era (80s on) Many computers

microprocessors, parallelism, networking

Interaction computer-computer

human-computer

The communications revolution

computing and communications converge

AND WE ALL RELY ON IT MUCH MORE!

Introduction to CS, 2003 – p.20 BREADTH AND QUALITY!

Computer Laboratory research Systems Research Security Automated Reasoning Theory and Semantics Programming Research Rainbow Group (graphics, HCI, . . . ) Intelligent Systems Natural Language & Inf. Processing

Introduction to CS, 2003 – p.21 Computer Laboratory research Systems Research Security Automated Reasoning Theory and Semantics Programming Research Rainbow Group (graphics, HCI, . . . ) Intelligent Systems Natural Language & Inf. Processing

BREADTH AND QUALITY!

Introduction to CS, 2003 – p.21 Computer Science and the Computer Industry

Introduction to CS, 2003 – p.22 Edsger W Dijkstra, 1930–2002

“About 10 years ago I tried to make up my mind on the question of whether Computing Science could save the computer industry, and my conclusion was negative; since then I felt it my duty to try to prevent the computer industry from killing Computing Science, but I doubt that I have been successful . . . ”

(“Under the spell of Leibniz’s dream”, EWD1298, 2000)

Introduction to CS, 2003 – p.23 Edsger W Dijkstra, 1930–2002

“About 10 years ago I tried to make up my mind on the question of whether Computing Science could save the computer industry, and my conclusion was negative; since then I felt it my duty to try to prevent the computer industry from killing Computing Science, but I doubt that I have been successful . . . ”

(“Under the spell of Leibniz’s dream”, EWD1298, 2000)

Introduction to CS, 2003 – p.23 The future. . .

Introduction to CS, 2003 – p.24 The next era

ubiquitous computing quantum computation conscious computers ???solve the crisis!

Introduction to CS, 2003 – p.25 The next era Whatever the future, facets of Computer Science important today are likely to remain so:

Theory

Abstraction

Design

Social & professional context

Introduction to CS, 2003 – p.25 The next era The future of Computer Science belongs to those who have

Content: an up-to-date grasp of fundamental problems and solutions

Method: principles and techniques to solve the vast array of unfamiliar problems arising in a rapidly changing field

Introduction to CS, 2003 – p.25 Your future . . .

Introduction to CS, 2003 – p.26 Computer Lab has about 3500 former students (undergraduate, postgraduate).

They have had very diverse careers, but for example, they have founded over 80 companies (that we know about).

For the moment, academic but . . . No harm to pay some attention to the long term:

Introduction to CS, 2003 – p.27 For the moment, academic but . . . No harm to pay some attention to the long term:

Computer Lab has about 3500 former students (undergraduate, postgraduate).

They have had very diverse careers, but for example, they have founded over 80 companies (that we know about).

Introduction to CS, 2003 – p.27 You can gain insight into their careers. They come back to tell you about their experiences, and will give career advice. Through the graduate association (“The Cambridge Computer Lab Ring”) website you can find them, find job opportunities, get a list of Ring events (typically one a month).

We hope that you too one day will come back...

Learn from former graduates . . .

Introduction to CS, 2003 – p.28 We hope that you too one day will come back...

Learn from former graduates . . .

You can gain insight into their careers. They come back to tell you about their experiences, and will give career advice. Through the graduate association (“The Cambridge Computer Lab Ring”) website you can find them, find job opportunities, get a list of Ring events (typically one a month).

Introduction to CS, 2003 – p.28 Learn from former graduates . . .

You can gain insight into their careers. They come back to tell you about their experiences, and will give career advice. Through the graduate association (“The Cambridge Computer Lab Ring”) website you can find them, find job opportunities, get a list of Ring events (typically one a month).

We hope that you too one day will come back...

Introduction to CS, 2003 – p.28 we’re here to help you learn how to shape it

The future belongs to you:

we aren’t here to teach you how to cope with it

Introduction to CS, 2003 – p.29 The future belongs to you: we aren’t here to teach you how to cope with it

we’re here to help you learn how to shape it

Introduction to CS, 2003 – p.29 HAVE FUN!

29-1