Classical Age

Classical Age

Introduction to Computer Science 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 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? 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 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.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 very slow 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 very slow 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,

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    55 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us