Computer Science 18. Turing Machines

Total Page:16

File Type:pdf, Size:1020Kb

Computer Science 18. Turing Machines COMPUTER SCIENCE Universality and computability SEDGEWICK/WAYNE Fundamental questions • What is a general-purpose computer? • Are there limits on the power of digital computers? • Are there limits on the power of machines we can build? Computer Science Pioneering work at Princeton in the 1930s. Computer 18. Turing Machines Science An Interdisciplinary Approach R O B E R T S E D G E W I C K KEVIN WAYNE David Hilbert Kurt Gödel Alsonzo Church Alan Turing Section 7.4 1862−1943 1906−1978 1903−1995 1912−1954 http://introcs.cs.princeton.edu Asked the questions Solved the math Solved the decision Provided THE answers problem problem 2 Context: Mathematics and logic COMPUTER SCIENCE SEDGEWICK/WAYNE Principia Mathematics Mathematics. Any formal system powerful enough to express arithmetic. Peano arithmetic Zermelo-Fraenkel set theory . Complete. Can prove truth or falsity of any arithmetic statement. Consistent. Cannot prove contradictions like 2 + 2 = 5. Decidable. An algorithm exists to determine truth of every statement. 18. Turing Machines •A simple model of computation Q. (Hilbert, 1900) Is mathematics complete and consistent? •Universality A. (Gödel's Incompleteness Theorem, 1931) NO (!!!) •Computability •Implications Q. (Hilbert's Entscheidungsproblem) Is mathematics decidable? A. (Church 1936, Turing 1936) NO (!!) 3 CS.18.A.Turing.Machine Starting point Previous lecture: DFAs Goals A DFA is an abstract machine that solves a pattern matching problem. • Develop a model of computation that encompasses all known computational processes. • A string is specified on an input tape (no limit on its length). • Make the model as simple as possible. • The DFA reads each character on input tape once, moving left to right. • The DFA lights "YES" if it recognizes the string, "NO" otherwise. Each DFA defines a set of strings (all the strings that it recognizes). Example: A familiar computational process. NO 1 0 1 0 3 1 4 2 Characteristics 7 1 8 2 YES • Discrete. 1 0 3 2 4 • Local. b b a a b b a b b • States. 5 6 This lecture: Turing machines Previous lecture: DFA details and example A Turing machine (TM) is an abstract model of computation. A DFA is an abstract machine with a finite number of states, each labelled Y or N and • A string is specified on a tape (no limit on its length). transitions between states, each labelled with a symbol. One state is the start state. • The TM reads and writes characters on the tape, moving left or right. • Begin in the start state. • The TM lights "YES" if it recognizes the string, "NO" otherwise. • Read an input symbol and move to the indicated state. • The TM may halt, leaving the result of the computation on the tape. • Repeat until the last input symbol has been read. • Turn on the "YES" or "NO" light according to the label on the current state. NO NO HALT a a a Does this DFA recognize Y b N b N this string? YES b YES . b b a a b b a b b 7 8 This lecture: Turing Machine details and example DFAs vs TMs A Turing Machine is an abstract machine with a finite number of states, each labelled Y, N, Similarities H, L, or R and transitions between states, each labelled with a read/write pair of symbols. • Simple model of computation. • Begin in the designated start state. • Input on tape is a finite string with symbols from a finite alphabet. • Read an input symbol, move to the indicated state and write the indicated output. • Finite number of states. • Move tape head left if new state is labelled L, right if it is labelled R. • State transitions determined by current state and input symbol. • Repeat until entering a state labelled Y, N, or H ( and turn on associated light). Differences NO 1:0 #:1 DFAs TMs R #:# L H HALT • Can read input symbols from the tape. • Can read from or write onto the tape. 0:1 • Can only move tape head to the right. • Can move tape head either direction. YES • Tape is finite (a string). • Tape does not end (either direction). • One state transition per input symbol. • No limit on number of transitions. # # # 1 0 1 1 0 0 1 1 1 # # # • Can recognize (turn on "YES" or "NO"). • Can also compute (with output on tape). 9 10 TM example 1: Binary decrementer TM example 1: Binary decrementer Q. What happens when we try to decrement 0? NO NO 0:1 0:1 #:# R #:# L 1:0 H HALT R #:# L 1:0 H HALT YES YES # # # 01 0 1 0 1 0 0 0 0 # # # # # # 1# # # # # 0 0 0 0 # # # A. Doesn't halt! TMs can have bugs, too. Input 1 0 1 0 1 0 0 0 0 Output 1 0 1 0 0 1 1 1 1 Fix to avoid infinite loop. Check for #. 11 12 TM example 2: Binary incrementer TM example 3: Binary adder (method) Note: This adds a 1 at the left as the To compute x + y last step when incrementing 111...1 NO • Move right to right end of y. ... # # 1 0 1 1 + 1 0 1 0 # # ... 1:0 #:1 R #:# L H HALT • Decrement y. ... # # 1 0 1 1 + 1 0 0 1 # # ... 0:1 YES • Move left to right end of x (left of +) . ... # # 1 0 1 1 + 1 0 0 1 # # ... • Increment x. ... # # 1 1 0 0 + 1 0 0 1 # # ... # # # 10 0 1 0 0 1 1 1 1 # # # • Continue until y = 0 is decremented. ... # 1 0 1 0 1 + 1 1 1 1 # # ... Found + when seeking 1? Just decremented 0. Input 1 0 1 0 0 1 1 1 1 • Clean up by erasing + and 1s. ... # 1 0 1 0 1 # # # # # # # ... Clean up Output 1 0 1 0 1 0 0 0 0 13 14 TM example 3: Binary adder Simulating an infinite tape with two stacks # 1 0 1 1 + 1 0 1 0 # NO Q. How can we simulate a tape that is infinite on both ends? 0:1 Find + A. Use two stacks, one for each end. # 1 0 1 1 + 1 0 0 1 # Decrement y L 1:0 L HALT private Stack<Character> left; +:# private Stack<Character> right; Halt +:+ # 1 0 1 1 + 1 0 0 1 # 1:# YES private char read() # # # 1 0 1 1 + 1 0 1 0 # # # { R #:# H if (right.isEmpty()) return '#'; return right.pop(); "tape head" is top of right stack # 1 1 0 0 + 1 0 0 1 # Clean Up } assumes #:# write just 1 0:1 private char write(char c) after each { right.push(c); } read 1 move 1 ... Increment x Find right end R L right private void moveRight() + + #:1 { 1 1 1 0 1 0 1 + 1 1 1 1 # 1:0 char c = '#'; move 0 1 0 if (!right.isEmpty()) c = right.pop(); left left.push(c); 0 0 0 1 } 1 0 1 0 1 # # # # # # 1 1 1 0 private void moveLeft() # # # 1 0 1 1 + 1 0 1 0 # # # { # # # # char c = '#'; empty? assume # is there if (!left.isEmpty()) c = left.pop(); right.push(c); } 15 16 Simulating the operation of a Turing machine COMPUTER SCIENCE SEDGEWICK/WAYNE public class TM fixes bug { 0:1 #:# private int state; R #:# L 1:0 H private int start; 0 1 2 private String[] action; private ST<Character, Integer>[] next; private ST<Character, Character>[] out; action[] next[] out[] /* Stack code from previous slide */ 0 1 # 0 1 # public TM(In in) { /* Fill in data structures */ } 0 R 0 0 0 1 0 0 1 # public String simulate(String input) 1 L 1 1 2 2 1 1 0 # { 18. Turing Machines state = start; 2 H 2 2 2 2 2 0 1 # for (int i = input.length()-1; i >= 0; i--) entries in gray are implicit in graphical representation right.push(input.charAt(i); while (action(state).equals("L") || •A simple model of computation action(state).equals("R")) % more dec.txt { 3 01# 0 char c = read(); •Universality R 0 0 1 0 1 # state = next[state].get(c); L 1 2 2 1 0 # write(out[state].get(c)); •Computability if (action[state].equals("R") moveRight(); H 2 2 2 0 1 # if (action[state].equals("L") moveLeft(); % java TM dec.txt } 000111 •Implications return action[state]; 000110 } 010000 public static void main(String[] args) 001111 { /* Similar to DFA's main() */ } 000000 } 111111 17 CS.18.B.Turing.Universality Representing a Turing machine Universal Turing machine (UTM) NO Turing's key insight. A TM is nothing more than a finite sequence of symbols. Universal Turing machine. A TM that takes as input HALT any TM and input for that TM on a TM tape. UTM dec.txt YES decrementer TM 0:1 #:# 3 01# 0 . # # # 1 1 0 0 0 3 0 1 # 0 R 0 0 1 0 1 $ L 1 2 1 1 0 $ H 2 2 2 0 1 $ / R 0 0 1 0 1 # R #:# L 1:0 H L 1 2 2 1 0 # 0 1 2 H 2 2 2 0 1 # input to decrementer TM decrementer TM Result. Whatever would happen if that TM were to NO Implication. Can put a TM and its input on a TM tape. run with that input (could loop or end in Y, N or H). UTM HALT YES . # # # 1 0 1 1 1 # # # 1 1 0 0 0 3 0 1 # 0 R 0 0 1 0 1 # L 1 2 1 1 0 # H 2 2 2 0 1 # result that decrementer TM would produce Turing.
Recommended publications
  • CS 154 NOTES Part 1. Finite Automata
    CS 154 NOTES ARUN DEBRAY MARCH 13, 2014 These notes were taken in Stanford’s CS 154 class in Winter 2014, taught by Ryan Williams. I live-TEXed them using vim, and as such there may be typos; please send questions, comments, complaints, and corrections to [email protected]. Thanks to Rebecca Wang for catching a few errors. CONTENTS Part 1. Finite Automata: Very Simple Models 1 1. Deterministic Finite Automata: 1/7/141 2. Nondeterminism, Finite Automata, and Regular Expressions: 1/9/144 3. Finite Automata vs. Regular Expressions, Non-Regular Languages: 1/14/147 4. Minimizing DFAs: 1/16/14 9 5. The Myhill-Nerode Theorem and Streaming Algorithms: 1/21/14 11 6. Streaming Algorithms: 1/23/14 13 Part 2. Computability Theory: Very Powerful Models 15 7. Turing Machines: 1/28/14 15 8. Recognizability, Decidability, and Reductions: 1/30/14 18 9. Reductions, Undecidability, and the Post Correspondence Problem: 2/4/14 21 10. Oracles, Rice’s Theorem, the Recursion Theorem, and the Fixed-Point Theorem: 2/6/14 23 11. Self-Reference and the Foundations of Mathematics: 2/11/14 26 12. A Universal Theory of Data Compression: Kolmogorov Complexity: 2/18/14 28 Part 3. Complexity Theory: The Modern Models 31 13. Time Complexity: 2/20/14 31 14. More on P versus NP and the Cook-Levin Theorem: 2/25/14 33 15. NP-Complete Problems: 2/27/14 36 16. NP-Complete Problems, Part II: 3/4/14 38 17. Polytime and Oracles, Space Complexity: 3/6/14 41 18.
    [Show full text]
  • Elementary Functions: Towards Automatically Generated, Efficient
    Elementary functions : towards automatically generated, efficient, and vectorizable implementations Hugues De Lassus Saint-Genies To cite this version: Hugues De Lassus Saint-Genies. Elementary functions : towards automatically generated, efficient, and vectorizable implementations. Other [cs.OH]. Université de Perpignan, 2018. English. NNT : 2018PERP0010. tel-01841424 HAL Id: tel-01841424 https://tel.archives-ouvertes.fr/tel-01841424 Submitted on 17 Jul 2018 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Délivré par l’Université de Perpignan Via Domitia Préparée au sein de l’école doctorale 305 – Énergie et Environnement Et de l’unité de recherche DALI – LIRMM – CNRS UMR 5506 Spécialité: Informatique Présentée par Hugues de Lassus Saint-Geniès [email protected] Elementary functions: towards automatically generated, efficient, and vectorizable implementations Version soumise aux rapporteurs. Jury composé de : M. Florent de Dinechin Pr. INSA Lyon Rapporteur Mme Fabienne Jézéquel MC, HDR UParis 2 Rapporteur M. Marc Daumas Pr. UPVD Examinateur M. Lionel Lacassagne Pr. UParis 6 Examinateur M. Daniel Menard Pr. INSA Rennes Examinateur M. Éric Petit Ph.D. Intel Examinateur M. David Defour MC, HDR UPVD Directeur M. Guillaume Revy MC UPVD Codirecteur À la mémoire de ma grand-mère Françoise Lapergue et de Jos Perrot, marin-pêcheur bigouden.
    [Show full text]
  • Computability and Incompleteness Fact Sheets
    Computability and Incompleteness Fact Sheets Computability Definition. A Turing machine is given by: A finite set of symbols, s1; : : : ; sm (including a \blank" symbol) • A finite set of states, q1; : : : ; qn (including a special \start" state) • A finite set of instructions, each of the form • If in state qi scanning symbol sj, perform act A and go to state qk where A is either \move right," \move left," or \write symbol sl." The notion of a \computation" of a Turing machine can be described in terms of the data above. From now on, when I write \let f be a function from strings to strings," I mean that there is a finite set of symbols Σ such that f is a function from strings of symbols in Σ to strings of symbols in Σ. I will also adopt the analogous convention for sets. Definition. Let f be a function from strings to strings. Then f is computable (or recursive) if there is a Turing machine M that works as follows: when M is started with its input head at the beginning of the string x (on an otherwise blank tape), it eventually halts with its head at the beginning of the string f(x). Definition. Let S be a set of strings. Then S is computable (or decidable, or recursive) if there is a Turing machine M that works as follows: when M is started with its input head at the beginning of the string x, then if x is in S, then M eventually halts, with its head on a special \yes" • symbol; and if x is not in S, then M eventually halts, with its head on a special • \no" symbol.
    [Show full text]
  • COMPSCI 501: Formal Language Theory Insights on Computability Turing Machines Are a Model of Computation Two (No Longer) Surpris
    Insights on Computability Turing machines are a model of computation COMPSCI 501: Formal Language Theory Lecture 11: Turing Machines Two (no longer) surprising facts: Marius Minea Although simple, can describe everything [email protected] a (real) computer can do. University of Massachusetts Amherst Although computers are powerful, not everything is computable! Plus: “play” / program with Turing machines! 13 February 2019 Why should we formally define computation? Must indeed an algorithm exist? Back to 1900: David Hilbert’s 23 open problems Increasingly a realization that sometimes this may not be the case. Tenth problem: “Occasionally it happens that we seek the solution under insufficient Given a Diophantine equation with any number of un- hypotheses or in an incorrect sense, and for this reason do not succeed. known quantities and with rational integral numerical The problem then arises: to show the impossibility of the solution under coefficients: To devise a process according to which the given hypotheses or in the sense contemplated.” it can be determined in a finite number of operations Hilbert, 1900 whether the equation is solvable in rational integers. This asks, in effect, for an algorithm. Hilbert’s Entscheidungsproblem (1928): Is there an algorithm that And “to devise” suggests there should be one. decides whether a statement in first-order logic is valid? Church and Turing A Turing machine, informally Church and Turing both showed in 1936 that a solution to the Entscheidungsproblem is impossible for the theory of arithmetic. control To make and prove such a statement, one needs to define computability. In a recent paper Alonzo Church has introduced an idea of “effective calculability”, read/write head which is equivalent to my “computability”, but is very differently defined.
    [Show full text]
  • Reconfigurable Embedded Control Systems: Problems and Solutions
    RECONFIGURABLE EMBEDDED CONTROL SYSTEMS: PROBLEMS AND SOLUTIONS By Dr.rer.nat.Habil. Mohamed Khalgui ⃝c Copyright by Dr.rer.nat.Habil. Mohamed Khalgui, 2012 v Martin Luther University, Germany Research Manuscript for Habilitation Diploma in Computer Science 1. Reviewer: Prof.Dr. Hans-Michael Hanisch, Martin Luther University, Germany, 2. Reviewer: Prof.Dr. Georg Frey, Saarland University, Germany, 3. Reviewer: Prof.Dr. Wolf Zimmermann, Martin Luther University, Germany, Day of the defense: Monday January 23rd 2012, Table of Contents Table of Contents vi English Abstract x German Abstract xi English Keywords xii German Keywords xiii Acknowledgements xiv Dedicate xv 1 General Introduction 1 2 Embedded Architectures: Overview on Hardware and Operating Systems 3 2.1 Embedded Hardware Components . 3 2.1.1 Microcontrollers . 3 2.1.2 Digital Signal Processors (DSP): . 4 2.1.3 System on Chip (SoC): . 5 2.1.4 Programmable Logic Controllers (PLC): . 6 2.2 Real-Time Embedded Operating Systems (RTOS) . 8 2.2.1 QNX . 9 2.2.2 RTLinux . 9 2.2.3 VxWorks . 9 2.2.4 Windows CE . 10 2.3 Known Embedded Software Solutions . 11 2.3.1 Simple Control Loop . 12 2.3.2 Interrupt Controlled System . 12 2.3.3 Cooperative Multitasking . 12 2.3.4 Preemptive Multitasking or Multi-Threading . 12 2.3.5 Microkernels . 13 2.3.6 Monolithic Kernels . 13 2.3.7 Additional Software Components: . 13 2.4 Conclusion . 14 3 Embedded Systems: Overview on Software Components 15 3.1 Basic Concepts of Components . 15 3.2 Architecture Description Languages . 17 3.2.1 Acme Language .
    [Show full text]
  • YANLI: a Powerful Natural Language Front-End Tool
    AI Magazine Volume 8 Number 1 (1987) (© AAAI) John C. Glasgow I1 YANLI: A Powerful Natural Language Front-End Tool An important issue in achieving acceptance of computer sys- Since first proposed by Woods (1970), ATNs have be- tems used by the nonprogramming community is the ability come a popular method of defining grammars for natural to communicate with these systems in natural language. Of- language parsing programs. This popularity is due to the ten, a great deal of time in the design of any such system is flexibility with which ATNs can be applied to hierarchically devoted to the natural language front end. An obvious way to describable phenomenon and to their power, which is that of simplify this task is to provide a portable natural language a universal Turing machine. As discussed later, a grammar front-end tool or facility that is sophisticated enough to allow in the form of an ATN (written in LISP) is more informative for a reasonable variety of input; allows modification; and, than a grammar in Backus-Naur notation. As an example, yet, is easy to use. This paper describes such a tool that is the first few lines of a grammar for an English sentence writ- based on augmented transition networks (ATNs). It allows ten in Backus-Naur notation might look like the following: for user input to be in sentence or nonsentence form or both, provides a detailed parse tree that the user can access, and sentence : := [subject] predicate also provides the facility to generate responses and save in- subject ::= noun-group formation.
    [Show full text]
  • Turing's Influence on Programming — Book Extract from “The Dawn of Software Engineering: from Turing to Dijkstra”
    Turing's Influence on Programming | Book extract from \The Dawn of Software Engineering: from Turing to Dijkstra" Edgar G. Daylight∗ Eindhoven University of Technology, The Netherlands [email protected] Abstract Turing's involvement with computer building was popularized in the 1970s and later. Most notable are the books by Brian Randell (1973), Andrew Hodges (1983), and Martin Davis (2000). A central question is whether John von Neumann was influenced by Turing's 1936 paper when he helped build the EDVAC machine, even though he never cited Turing's work. This question remains unsettled up till this day. As remarked by Charles Petzold, one standard history barely mentions Turing, while the other, written by a logician, makes Turing a key player. Contrast these observations then with the fact that Turing's 1936 paper was cited and heavily discussed in 1959 among computer programmers. In 1966, the first Turing award was given to a programmer, not a computer builder, as were several subsequent Turing awards. An historical investigation of Turing's influence on computing, presented here, shows that Turing's 1936 notion of universality became increasingly relevant among programmers during the 1950s. The central thesis of this paper states that Turing's in- fluence was felt more in programming after his death than in computer building during the 1940s. 1 Introduction Many people today are led to believe that Turing is the father of the computer, the father of our digital society, as also the following praise for Martin Davis's bestseller The Universal Computer: The Road from Leibniz to Turing1 suggests: At last, a book about the origin of the computer that goes to the heart of the story: the human struggle for logic and truth.
    [Show full text]
  • Church-Turing Thesis: Every Function F: {0,1}* -> {0,1}* Which Is "Effectively Computable" Is Computable by a Turing Machine
    Church-Turing Thesis: Every function f: {0,1}* -> {0,1}* which is "effectively computable" is computable by a Turing Machine. Observation: Every Turing Machine (equivalently, every python program, or evey program in your favorite language) M can be encoded by a finite binary string #M. Moreover, our encoding guarantees #M != #M' whenever M and M' are different Turing Machines (different programs). Recall: Every finite binary string can be thought of as a natural number written in binary, and vice versa. Therefore, we can think of #M as a natural number. E.g. If #M = 1057, then we are talking about the 1057th Turing Machine, or 1057th python program. Intuitive takeaway: At most, there are as many different Turing Machines (Programs) as there are natural numbers. We will now show that some (in fact most) decision problems f: {0,1}* -> {0,1} are not computable by a TM (python program). If a decision problem is not comptuable a TM/program then we say it is "undecidable". Theorem: There are functions from {0,1}* to {0,1} which are not computable by a Turing Machine (We say, undecidable). Corollary: Assuming the CT thesis, there are functions which are not "effectively computable". Proof of Theorem: - Recall that we can think of instead of of {0,1}* - "How many" functions f: -> {0,1} are there? - We can think of each each such function f as an infinite binary string - For each x in (0,1), we can write its binary expansion as an infinite binary string to the right of a decimal point - The string to the right of the decimal point can be interpreted as a function f_x from natural numbers to {0,1} -- f_x(i) = ith bit of x to the right of the decimal point - In other words: for each x in (0,1) we get a different function f_x from natural numbers to {0,1}, so there are at least as many decision problems as there are numbers in (0,1).
    [Show full text]
  • Computers Friday, February 12, 2021 11:00 AM
    1 Introduction: Computers Friday, February 12, 2021 11:00 AM Welcome! CMSC 240 - Principles of Computer Organization Class website: https://cs.brynmawr.edu/Courses/cs240/Spring2021/ What is a computer? A device with • A processor (CPU - Central Processing Unit) • Storage/memory (RAM, Disk, USB Stick) • A keyboard • A mouse • A monitor • A printer Not all computers have all of the above. Except the CPU and memory. Japan's Fugaku Supercomputer is one of the world's fastest computer as of Summer 2020. Performance is over 400 petaflops (over a million times faster than the desktop shown on the right). Question: What was the first ever computer? 240 Lectures Page 1 1 Computers - Old & New Friday, February 12, 2021 11:00 AM The Difference Engine #2: A Mechanical Computer ENIAC Electronic Numerical Integrator and Computer February 15, 1946. ENIAC Day is this week! https://eniacday.org/ Check it out. Question: What is the difference between the ENIAC, the Apple Mac, the Iphone, and the Fugaku??? 240 Lectures Page 2 1 Turing Machines Friday, February 12, 2021 11:00 AM 1937: Alan M. Turing Turing Machine [A mathematical abstraction of mechanical computation.] Turing Machines for adding and multiplying Universal Turing Machine Church-Turing Thesis (tl;dr) Anything that can be computed can be computed by a Turing machine. Key Idea: A computer is essentially a Turing Machine. A computer is a universal computing device. 240 Lectures Page 3 1 Put on Watch List… Friday, February 12, 2021 8:55 AM 240 Lectures Page 4 1 von Neumann Architecture Friday, February 12, 2021 11:00 AM John von Neumann, 1945 Stored Program Computers Aka von Neumann Architecture Most computers today are based on this architecture.
    [Show full text]
  • Computability Theory
    CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2019 Computability Theory This section is partly inspired by the material in \A Course in Mathematical Logic" by Bell and Machover, Chap 6, sections 1-10. Other references: \Introduction to the theory of computation" by Michael Sipser, and \Com- putability, Complexity, and Languages" by M. Davis and E. Weyuker. Our first goal is to give a formal definition for what it means for a function on N to be com- putable by an algorithm. Historically the first convincing such definition was given by Alan Turing in 1936, in his paper which introduced what we now call Turing machines. Slightly before Turing, Alonzo Church gave a definition based on his lambda calculus. About the same time G¨odel,Herbrand, and Kleene developed definitions based on recursion schemes. Fortunately all of these definitions are equivalent, and each of many other definitions pro- posed later are also equivalent to Turing's definition. This has lead to the general belief that these definitions have got it right, and this assertion is roughly what we now call \Church's Thesis". A natural definition of computable function f on N allows for the possibility that f(x) may not be defined for all x 2 N, because algorithms do not always halt. Thus we will use the symbol 1 to mean “undefined". Definition: A partial function is a function n f :(N [ f1g) ! N [ f1g; n ≥ 0 such that f(c1; :::; cn) = 1 if some ci = 1. In the context of computability theory, whenever we refer to a function on N, we mean a partial function in the above sense.
    [Show full text]
  • Universal Turing Machine
    15-251 Great Theoretical Ideas in Computer Science Lecture 21 - Dan Kilgallin Turing Machines Goals Describe the nature of computation Mathematically formalize the behavior of a program running on a computer system Compare the capabilities of different programming languages Turing Machines What can we do to make a DFA better? Idea: Give it some memory! How much memory? Infinite! What kind of memory? Sequential access (e. g. CD, hard drive) or RAM? An infinite amount of RAM requires remembering really big numbers and needlessly complicates proofs Turing Machines: Definition A Turing Machine consists of A DFA to store the machine state, called the controller An array that is infinitely long in both directions, called the tape A pointer to some particular cell in the array, called the head Operation The head begins at cell 0 on the tape The DFA begins in some initial state Symbols from some alphabet are written on a finite portion of the tape, beginning at cell 1 Operation At each step, the machine uses as input: The state of the controller The symbol written on the cell which the head is at Using this, the machine will: Transition to some state in the DFA (possibly the same state) Write some symbol (possibly the same symbol) on the tape Move the head left or right one cell Two Flavors! The machine will stop computation if the DFA enters one of a pre-defined set of "halting" states A "decision" machine will, if it reaches a halting state, output either "Yes" or "No" (i.e. there are "accepting" and "rejecting" halt states) A "function" machine will, if it reaches a halting state, have some string of symbols written on the tape.
    [Show full text]
  • Sources a Brief History of Computer Science ●Schneider and Gersting, an Invitation to Computer Science ●Primary Source CSCE 181, Yoonsuck Choe ●Slides from Prof
    * Sources A Brief History of Computer Science ●Schneider and Gersting, An Invitation to Computer Science ●primary source CSCE 181, Yoonsuck Choe ●Slides from Prof. John Keyser Slides with dark blue background header: Prof. Jennifer Welch’s slides ●American University’s Computing History Museum • ●http://www.computinghistorymuseum.org/ from Spring 2010 CSCE 181. ●Virginia Tech’s History of Computing website: ●http://ei.cs.vt.edu/~history Slides with blank background: Yoonsuck Choe • ●Computer History Museum ●http://www.computerhistory.org/ ●IEEE Annals of the History of Computing (Journal) ●http://www.computer.org/portal/site/annals/index.jsp ●Andrew Hodges’ website about Alan Turing ●http://http://www.turing.org.uk/turing/index.html * More Sources Early Mathematics & Computation ●Babylonians and Egyptians, > 3000 yrs ago James Burke, Connections, MacMillan: London, 1978. • ●numerical methods for generating tables of square Photos taken by Yoonsuck Choe at the Computer History roots, multiplication, trig • ●Applications: navigation, agriculture, taxation Museum in Mountainview, CA. December 2011. ●Greeks, > 3000 yrs ago ●geometry and logic ●Indians, ~ 600 AD ●started using placeholders and a decimal number system, similar to modern ●idea spread to Middle East ●Arabs and Persians ~ 800 AD ●algorithms * * A Famous Arab Mathematician Abu Jafar Mohammed Ibn Musa Al-Khowarizmi Early Computing Devices ●In early 800s AD ●Abacus ●Worked at center of learning in Baghdad ●About 3000 BC ●Wrote book: Hisab Al Jabr Wal- ●Different types, developed
    [Show full text]