7turing

# 7turing - Fundamental Questions Universality and...

This preview shows pages 1–4. Sign up to view the full content.

Introduction to Computer Science Sedgewick and Wayne Copyright © 2007 Universality and Computability 2 Fundamental Questions Q. What is a general-purpose computer? Q. Are there limits on the power of digital computers? Q. Are there limits on the power of machines we can build? Pioneering work in the 1930s. ! Princeton == center of universe. ! Hilbert, Gödel, Turing, Church, von Neumann. ! Automata, languages, computability, universality, complexity, logic. David Hilbert Kurt Gödel Alan Turing Alonzo Church John von Neumann Introduction to Computer Science Sedgewick and Wayne Copyright © 2007 7.4 Turing Machines (revisited) Alan Turing 4 Turing Machine Desiderata. Simple model of computation that is "as powerful" as conventional computers. Intuition. Simulate how humans calculate. Ex. Addition. 0 0 0 0 0 0 0 1 0 0 0 0 2 3 4 5 0 0 + 3 0 0 0 0 1 4 1 5 0 0 0 0 0 0 0 6 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
5 Turing Machine: Tape Tape. ! Stores input, output, and intermediate results. ! One arbitrarily long strip, divided into cells. ! Finite alphabet of symbols. Tape head. ! Points to one cell of tape. ! Reads a symbol from active cell. ! Writes a symbol to active cell. ! Moves left or right one cell at a time. tape head tape tape head tape # 1 1 0 0 + 1 0 1 1 # 6 L 0 L 1 1 : 0 R 2 L 3 # : # + : + R 4 H 5 0 : 1 # : 1 1 : 0 0 : 1 + : # # : # 1 : # Turing Machine: States State. What machine remembers. State transition diagram. Complete description of what machine will do. if in state 3 and tape head is 0 : write a 1 go to state 2 move tape head right # 1 1 0 0 + 1 0 1 1 # tape (before) 7 State. What machine remembers. State transition diagram. Complete description of what machine will do. L 0 L 1 1 : 0 R 2 L 3 # : # + : + R 4 H 5 0 : 1 # : 1 1 : 0 0 : 1 + : # # : # 1 : # Turing Machine: # 1 1 + 1 0 1 1 # tape (after) 1 0 if in state 3 and tape head is 0 : write a 1 go to state 2 move tape head right 8 Binary Adder # 1 0 1 0 + 1 1 1 1 # L L 1 : 0 R L # : # + : + R H 0 : 1 # : 1 Fnd right end of y add one to x subtract one from y Fnd plus sign 1 : 0 0 : 1 x y + : # # : # halt clean up 1 : #
9 7.5 Universality 10 Universality Q. Which one of the following does not belong? Espresso maker iMac Palm Pilot Dell PC Cray Xbox Tivo Turing machine TOY Java language MS Excel Python language Java cell phone Quantum computer DNA computer 11 Java: As Powerful As Turing Machine Turing machines are equivalent in power to TOY and Java. ! Can use Java to solve any problem that can be solved with a TM. ! Can use TM to solve any problem that can be solved with a TOY. ! Can use TOY to solve any problem that can be solved with Java. Java simulator for Turing machines. State state = start ; while ( true ) { char c = tape . readSymbol (); tape . write ( state . symbolToWrite ( c )); state = state . next ( c ); if ( state . isLeft ()) tape . moveLeft (); else if ( state . isRight ()) tape . moveRight (); else if ( state . isHalt ()) break; } 12 Turing Machine: As Powerful As TOY Machine Turing machines are equivalent in power to TOY and Java.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## 7turing - Fundamental Questions Universality and...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online