David Evans CS150: Computer Science University of Virginia Computer Science Lecture 40: Computing with Glue and Photons.

Slides:



Advertisements
Similar presentations
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Advertisements

Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
CS211 Problems: unsolvable, unfeasible and unsolved Topic 3: P and NP.
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 13: Turing Machines.
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Cs1120 Fall 2009 David Evans Lecture 16: Power Analysis.
David Evans CS200: Computer Science University of Virginia Computer Science Class 30: Models of Computation.
Class 39: Universality cs1120 Fall 2009 David Evans University of Virginia.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 39: Lambda Calculus.
March 11, 2015CS21 Lecture 271 CS21 Decidability and Tractability Lecture 27 March 11, 2015.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
CS1001 Lecture 23. Overview Incompleteness and the Halting Problem Incompleteness and the Halting Problem Methods in Artificial Intelligence Methods in.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
Turing Machines CS 105: Introduction to Computer Science.
Class 19: Undecidability in Theory and Practice David Evans cs302: Theory of Computation University of Virginia Computer.
Cs3102: Theory of Computation Class 20: Busy Beavers Spring 2010 University of Virginia David Evans Office hours: I am not able to hold my Thursday morning.
David Evans CS200: Computer Science University of Virginia Computer Science Class 31: Universal Turing Machines.
Lecture 14: Church-Turing Thesis Alonzo Church ( ) Alan Turing ( )
Lecture 20: λ Calculus λ Calculus & Computability Yan Huang Dept. of Comp. Sci. University of Virginia.
Class 37: Computability in Theory and Practice cs1120 Fall 2011 David Evans 21 November 2011 cs1120 Fall 2011 David Evans 21 November 2011.
Randomized Turing Machines
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
David Evans CS588: Security and Privacy University of Virginia Computer Science Lecture 15: Complexity Notes This is selected.
David Evans CS200: Computer Science University of Virginia Computer Science Class 38: Fixed Points and Biological Computing.
Lecture 8: The Meaning of Life, Searching for Truth and The Stuff Primitives are Made Of (and a smattering of Quantum Physics) David Evans
David Evans CS150: Computer Science University of Virginia Computer Science Class 33: Computing with Photons From The.
Cs3102: Theory of Computation Class 14: Turing Machines Spring 2010 University of Virginia David Evans.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
Class 21: Introducing Complexity David Evans cs302: Theory of Computation University of Virginia Computer Science.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 36: Modeling Computing.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Computer Theory Michael J. Watts
28 April 2005 CS588 Spring 2005 David Evans Phun with Photons.
Costas Busch - LSU1 Turing’s Thesis. Costas Busch - LSU2 Turing’s thesis (1930): Any computation carried out by mechanical means can be performed by a.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 14: P = NP?
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
Recall last lecture and Nondeterministic TMs Ola Svensson.
David Evans CS150: Computer Science University of Virginia Computer Science Class 32: Computability in Theory and Practice.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
David Evans CS200: Computer Science University of Virginia Computer Science Class 26: Halting Problem It is plain at any.
Turing’s Thesis Costas Busch - LSU.
Lecture 6: Lambda Calculus
Part VI NP-Hardness.
Class 27: Universal Turing Machines CS150: Computer Science
Class 30: Models of Computation CS200: Computer Science
Lecture 37: A Universal Computer
Lambda Calculus Revisited
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Theory of Computation Turing Machines.
Class 36: The Meaning of Truth CS200: Computer Science
Lecture 24: Metalinguistics CS200: Computer Science
Class 37: Making Lists, Numbers and Recursion from Glue Alone
Lecture 27: In Praise of Idleness CS200: Computer Science
Class 33: Making Recursion M.C. Escher, Ascending and Descending
Recall last lecture and Nondeterministic TMs
Class 24: Computability Halting Problems Hockey Team Logo
Class 31: Universal Turing Machines CS200: Computer Science
Class 34: Models of Computation CS200: Computer Science
CSE 105 theory of computation
Class 33: Learning to Count CS200: Computer Science
Class 26: Modeling Computing CS150: Computer Science
CSE 105 theory of computation
Presentation transcript:

David Evans CS150: Computer Science University of Virginia Computer Science Lecture 40: Computing with Glue and Photons The Tinkertoy Computer and Other Machinations by A. K. Dewdney I will have extra office hours after class Friday (1-3pm), in addition to the normal office hours after class Wednesday and Thursday 3:30-4:30.

2 Lecture 40: Computing with Glue and Photons Equivalent Computers? zzzzzzz 1 Start HALT ), X, L 2: look for ( #, 1, -  ), #, R  (, #, L (, X, R #, 0, - Finite State Machine... Turing Machine  term = variable | term term | (term) | variable. term y. M   v. (M [y v]) where v does not occur in M. ( x. M)N   M [ x N ] Lambda Calculus

3 Lecture 40: Computing with Glue and Photons Lambda Calculus is a Universal Computer? zzzzzzzzzzzzzzzzzzzz 1 Start HALT ), X, L 2: look for ( #, 1, -  ), #, R  (, #, L (, X, R #, 0, - Finite State Machine Read/Write Infinite Tape Mutable Lists Finite State Machine Numbers Processing Way to make decisions (if) Way to keep going

4 Lecture 40: Computing with Glue and Photons What is 42? 42 forty-two XLII cuarenta y dos

5 Lecture 40: Computing with Glue and Photons Meaning of Numbers “42-ness” is something who’s successor is “43-ness” “42-ness” is something who’s predecessor is “41-ness” “Zero” is special. It has a successor “one-ness”, but no predecessor.

6 Lecture 40: Computing with Glue and Photons Meaning of Numbers pred (succ N )  N succ (pred N )  N succ (pred (succ N ))  succ N zero? zero  T zero? (succ zero)  F

7 Lecture 40: Computing with Glue and Photons Is this enough? Can we define add with pred, succ, zero? and zero? add  xy. if ( zero? x) y ( add ( pred x) ( succ y))

8 Lecture 40: Computing with Glue and Photons Can we define lambda terms that behave like zero, zero?, pred and succ? Hint: what if we had cons, car and cdr?

9 Lecture 40: Computing with Glue and Photons Numbers are Lists... zero?  null? pred  cdr succ  x. cons F x The length of the list corresponds to the number value.

10 Lecture 40: Computing with Glue and Photons Making Pairs (define (make-pair x y) (lambda (selector) (if selector x y))) (define (car-of-pair p) (p #t)) (define (cdr-of-pair p) (p #f))

11 Lecture 40: Computing with Glue and Photons cons and car cons  x. y. z.zxy cons M N = ( x. y. z.zxy) M N   ( y. z.z M y) N   z.z MN car  p.p T car (cons M N)  car ( z.z MN)  ( p.p T) ( z.z MN)   ( z.z MN) T   TMN   ( xy. x ) MN   ( y. M)N   M T  xy. x

12 Lecture 40: Computing with Glue and Photons cdr too! cons  xyz.zxy car  p.p T cdr  p.p F cdr cons M N cdr z.z MN = ( p.p F) z.z MN   ( z.z MN) F   FMN   N

13 Lecture 40: Computing with Glue and Photons Null and null? null  x. T null?  x.(x y. z. F) null? null  x.(x y. z. F) ( x. T)   ( x. T) ( y. z. F)   T

14 Lecture 40: Computing with Glue and Photons Null and null? null  x. T null?  x.(x y. z. F) null? (cons M N)  x.(x y. z. F) z.z MN   ( z.z MN) ( y. z. F)   ( y. z. F) MN   F

15 Lecture 40: Computing with Glue and Photons Counting 0  null 1  cons F 0 2  cons F 1 3  cons F 2... succ  x.cons F x pred  x.cdr x

16 Lecture 40: Computing with Glue and Photons 42 = xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y xy.( z.z xy) xy. y x. T

17 Lecture 40: Computing with Glue and Photons Lambda Calculus is a Universal Computer zzzzzzzzzzzzzzzzzzzz 1 Start HALT ), X, L 2: look for ( #, 1, -  ), #, R  (, #, L (, X, R #, 0, - Finite State Machine Read/Write Infinite Tape Mutable Lists Finite State Machine Numbers to keep track of state Processing Way of making decisions (if)  Way to keep going We have this, but we cheated using  to make recursive definitions!

18 Lecture 40: Computing with Glue and Photons Way to Keep Going ( f. (( x. f (xx)) ( x. f (xx)))) ( z.z)   ( x. ( z.z)(xx)) ( x. ( z.z)(xx))   ( z.z) ( x.( z.z)(xx)) ( x.( z.z)(xx))   ( x.( z.z)(xx)) ( x.( z.z)(xx))   ( z.z) ( x.( z.z)(xx)) ( x.( z.z)(xx))   ( x.( z.z)(xx)) ( x.( z.z)(xx))  ... This should give you some belief that we might be able to do it. We won’t cover the details of why this works in this class.

19 Lecture 40: Computing with Glue and Photons Lambda Calculus is a Universal Computer zzzzzzzzzzzzzzzzzzzz 1 Start HALT ), X, L 2: look for ( #, 1, -  ), #, R  (, #, L (, X, R #, 0, - Finite State Machine Read/Write Infinite Tape Mutable Lists Finite State Machine Numbers to keep track of state Processing Way of making decisions (if) Way to keep going

20 Lecture 40: Computing with Glue and Photons Equivalent Computers! zzzzzzz 1 Start HALT ), X, L 2: look for ( #, 1, -  ), #, R  (, #, L (, X, R #, 0, - Finite State Machine... Turing Machine term = variable | term term | (term) | variable. term y. M   v. (M [y v]) where v does not occur in M. ( x. M)N   M [ x N ] Lambda Calculus can simulate

21 Lecture 40: Computing with Glue and Photons Universal Computer Lambda Calculus can simulate a Turing Machine –Everything a Turing Machine can compute, Lambda Calculus can compute also Turing Machine can simulate Lambda Calculus (we didn’t prove this) –Everything Lambda Calculus can compute, a Turing Machine can compute also Church-Turing Thesis: this is true for any other mechanical computer also

22 Lecture 40: Computing with Glue and Photons Normal Steps Turing machine: –Read one square on tape, follow one FSM transition rule, write one square on tape, move tape head one square Lambda calculus: –One beta reduction Your PC: –Execute one instruction (?) What one instruction does varies

23 Lecture 40: Computing with Glue and Photons Generalized Normal Steps Require a constant amount of time Perform a fixed amount of work –Read/write a constant amount of stuff –Make a constant number of decisions –Localized –Cannot scale (indefinitely) with input size

24 Lecture 40: Computing with Glue and Photons What about “non-mechanical” computers?

25 Lecture 40: Computing with Glue and Photons Quantum Physics for Dummies Light behaves like both a wave and a particle at the same time A single photon is in many states at once Can’t observe its state without forcing it into one state Schrödinger’s Cat –Put a live cat in a box with cyanide vial that opens depending on quantum state –Cat is both dead and alive at the same time until you open the box

26 Lecture 40: Computing with Glue and Photons Quantum Computing Feynman, 1982 Quantum particles are in all possible states Can try lots of possible computations at once with the same particles In theory, can test all possible factorizations/keys/paths/etc. and get the right one! In practice, very hard to keep states entangled: once disturbed, must be in just one possible state

27 Lecture 40: Computing with Glue and Photons Qubit Regular bit: either a 0 or a 1 Quantum bit: 0, 1 or in between –p% probability it is a 1 A single qubit is in 2 possible states at once If you have 7 bits, you can represent any one of 2 7 different states If you have 7 qubits, you have 2 7 different states (at once!)

28 Lecture 40: Computing with Glue and Photons Quantum Computers Today Several quantum algorithms –Shor’s algorithm: factoring using a quantum computer Actual quantum computers –5-qubit computer built by IBM (2001) –Implemented Shor’s algorithm to factor: “World’s most complex quantum computation” –D-Wave 16-qubit quantum computer (2007) Solves Sudoku puzzles To exceed practical normal computing need > 50 qubits –Adding another qubit is more than twice as hard 15 (= 5 * 3)

29 Lecture 40: Computing with Glue and Photons Nondeterministic Computing 1 Start 2 Input: 1 Write: 1 Move:  # # 3 Input: # Write: # Move:  Input: 1 Write: 1 Move:  There can be multiple transitions on the same input. NTM takes all of them at once. Each gets its own independent copy of the tape. If any path finds halting state, that is the result.

30 Lecture 40: Computing with Glue and Photons Two Ways of Thinking about Nondeterminstic Computing Omniscient (all-knowing): machine always guesses right (the right guess is the one that eventually leads to a halting state) Omnipotent (all-powerful): machine can split in two every step, all resulting machines execute on each step, if one of the machines halts its tape is the output

31 Lecture 40: Computing with Glue and Photons Computability Is a nondeterministic TM more powerful than a deterministic TM? No! We can simulate a nondeterminstic TM with a regular TM.

32 Lecture 40: Computing with Glue and Photons Speed Is a nondeterministic TM faster than a deterministic TM? Unknown! This is the most famous open problem in CS.

33 Lecture 40: Computing with Glue and Photons Charge Friday’s class: P versus NP (the nondeterministic TM question) Qualification for Monday’s presentations –Send me a URL for your site before 11:59pm Friday –Basic functionality should be working –You can keep developing after this (if something breaks, you won’t be disqualified, but be smart and keep a copy of what works!)