1 CO1301 - Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.

Slides:



Advertisements
Similar presentations
Lecture Ref. handout page
Advertisements

CS211 Problems: unsolvable, unfeasible and unsolved Topic 2: Halting problem.
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Class 39: Universality cs1120 Fall 2009 David Evans University of Virginia.
Programming Languages Wrap-up. Your Toolkit Object-oriented Imperative Functional Logic.
Week 7 - Wednesday.  What did we talk about last time?  Set proofs and disproofs  Russell’s paradox.
Computability and Complexity 4-1 Existence of Undecidable Problems Computability and Complexity Andrei Bulatov.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Humans, Computers, and Computational Complexity J. Winters Brock Nathan Kaplan Jason Thompson.
CHAPTER 4 Decidability Contents Decidable Languages
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 29: Computability, Turing Machines, Can Computers Think?
Turing Machines CS 105: Introduction to Computer Science.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
Introduction to Computer Science. A Quick Puzzle Well-Formed Formula  any formula that is structurally correct  may be meaningless Axiom  A statement.
Universal Turing Machine
Class 37: Computability in Theory and Practice cs1120 Fall 2011 David Evans 21 November 2011 cs1120 Fall 2011 David Evans 21 November 2011.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Lambda Calculus History and Syntax. History The lambda calculus is a formal system designed to investigate function definition, function application and.
The Recursion Theorem Pages 217– ADVANCED TOPICS IN C O M P U T A B I L I T Y THEORY.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
CS 345: Chapter 8 Noncomputability and Undecidability Or Sometimes You Can’t Get It Done At All.
Course Overview and Road Map Computability and Logic.
Halting Problem Introduction to Computing Science and Programming I.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
CSE 311 Foundations of Computing I Lecture 29 Computability: Turing machines, Undecidability of the Halting Problem Autumn 2012 CSE 3111.
Turing Machines and the Halting Problem This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To.
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas in Computer Science.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Computation Motivating questions: What does “computation” mean? What are the similarities and differences between computation in computers and in natural.
Fundamentals of Informatics Lecture 13 Reduction Bas Luttik.
Capabilities of computing systems Numeric and symbolic Computations A look at Computability theory Turing Machines.
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
On computable numbers, with an application to the ENTSCHEIDUNGSPROBLEM COT 6421 Paresh Gupta by Alan Mathison Turing.
Week 7 - Wednesday.  What did we talk about last time?  Proving the subset relationship  Proving set equality  Set counterexamples  Laws of set algebra.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 5 Reducibility Some slides are in courtesy.
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
The Acceptance Problem for TMs
Introduction to Computing Science and Programming I
Computable Functions.
The Halting Problem.
COMPUTER ARCHITECTURE AND THE CYNAIDE COATED APPLE.
Class 30: Models of Computation CS200: Computer Science
CSE 311 Foundations of Computing I
Great Theoretical Ideas in Computer Science
Homework: Friday Read Section 4.1. In particular, you must understand the proofs of Theorems 4.1, 4.2, 4.3, and 4.4, so you can do this homework. Exercises.
Jaya Krishna, M.Tech, Assistant Professor
فصل سوم The Church-Turing Thesis
Theory of Computation Turing Machines.
Decidable Languages Costas Busch - LSU.
Class 24: Computability Halting Problems Hockey Team Logo
Class 34: Models of Computation CS200: Computer Science
Class 26: Modeling Computing CS150: Computer Science
CO Games Development 2 Week 21 Turing Machines & Computability
Presentation transcript:

1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby

2 Foundations of Mathematics David Hilbert Is Maths: Complete? Consistent? Decidable? The Entscheidungsproblem (the "decision problem") Is there an algorithm which will be able to decide whether a given statement is provable from its axioms? Gödel's incompleteness theorem: all consistent axiomatic formulations of number theory include undecidable propositions (propositions which can't be either proved or disproved).

3 Alan Turing Attempting to clarify the foundations of mathematics. 1936: "On Computable Numbers, with an Application to the Entscheidungsproblem". Can find it in a number of places on the internet, just put the whole title into a search engine. Wanted to make precise what is meant by a calculation (or an effectively computable function).

4 Turing's Approach Turning defined a class of abstract machines now called Turing Machines. Consider computation as performed by a human and, by dismissing the extraneous and superfluous elements, to arrive at a description of the fundamental steps of computation. Break maths down to its most basic operations.

5 Approach Imagine a man in a room. He has: Pencil A rubber. A notepad which he can record a number. There's a number written on it at the beginning of the proceedings. There is a single window onto the room. Another person hands a sheet of paper over to him On it is written a single symbol

6 Approach He has a book of instructions. He looks up the symbol in the book and matches it the number written in the notepad. The instructions tell him what precisely to do. He will find a instruction. The instruction will tell him to rub out the symbol on the sheet of paper and to write a new symbol on the sheet (it could actually be the same as the original one). The instructions will also tell him if he needs to change the number in the notepad. The instructions will also say whether to go back or go forward.

7 Approach The instructions will also say when to stop. Hands back the sheet of paper. Depending on the instructions he will tell the person to get the previous sheet in sequence, or to get the next sheet in sequence. Note the man knows nothing about maths. He just reads symbols, acts on the instructions and writes symbols. The symbols may be meaningless to him.

8 Turing Machine Recasts this idea as a machine which he supposes can perform all of the functions that the man does. Turning defined a class of abstract machines now called Turing Machines.

9 Turing Machine 1.A finite alphabet of input and output symbols. 2.A tape divided into a linear sequence of boxes. Each box contains one symbol. Tape can move in both directions. 3.A tape head that can read from, and then write to, one box at a time. 4.A control or processing unit. The unit can assume one a finite number of states (finite state machine) 5.A program: rules or instructions which define the action of the machine when in a particular state reading a particular character. The permitted actions are to change state (or stay in the same state), write a particular symbol (could be the same the original symbol).

10 Turing Machine Tape Tape Head Processor

11 Turing Machine Imagine a TM with the following program: in state a, reading 1, write B (blank), move Right, go to state a in state a, reading B, write B, STOP, go to state b This is a program to erase the tape. Examples of TMs are easy to find, e.g.

12 Turing Machine B111B Write 'B', move R BB11B BBB1B BBBBB Write 'B', STOP

13 Capabilities It can be demonstrated that a TM can simulate another TM. A Universal Turing Machine is one that can simulate any TM. It can also be demonstrated that a binary TM can simulate any TM.

14 Capabilities The Universal TM can: do recursion add do functions It is suggested that this comprises the whole of maths. All mathematical operations can be created using these actions. This is not a formal proof, but it appears to work. You can create any mathematical operation we know about using these basic operations.

15 Universal TM A TM computes one particular function. Universal TM is one which can simulate any other machine. It takes as input a description of a particular machine in addition to a copy of the input tape. A Universal TM is a universal algorithm device. A Universal TM can do any computation. Any calculation defined recursively by algorithm can be performed by TM. Any set defined by a recursive definition can be defined by a TM.

16 Turing's Thesis The definition of computation is "something which can be done by a TM" Turing's Thesis: The class of effectively computable functions can be identified with the class of Turing machine computable functions. A binary alphabet is sufficient to construct a machine to compute any function. Universal TM can perform all of the basic functions of computation (or calculation).

17 Alonzo Church Church and Turing worked independently. Church published first. Church described the Lambda calculus. Expresses maths in terms of functions. Even numbers are expressed as functions. Note: a subset of the LISP programming language can be used to write Lambda calculus functions. Demonstrated that any computation can be done using the Lambda calculus. Later a formal proof that anything written using Lambda calculus can be done using a Universal TM, and vice versa.

18 The Halting Problem The halting problem: the determination of whether a TM will come to a halt given a particular input program. The halting problem is just a particular expression of the Entscheidungsproblem (the "decision problem") but now expressed in terms of a TM. Disproof by showing a contraction. It posits the existence of a program to solve the Halting Problem and then demonstrates that it would lead to a contradiction.

19 Proof Imagine a program called Halt(P, I) P is a string. You can think of P as being a program. I is a string. Again you can think of as being a program. Halt solves the halting problem. It returns true if program P halts when it given string I.

20 Proof Imagine a program called Test Test takes an input string X. You can think of X as being a program. Test( X ) { if( Halt( X, X ) ) infinite loop else halt }

21 Proof What happens if the program Test is run with itself as the input? Test halts on input of Halt. But this means that the test condition is true. Hence the program goes into an infinite loop. This is in contradiction with the statement in the condition that Halt is true (and so would halt, rather than going into an infinite loop). Test doesn't halt on input of Halt. But this means that the test condition is false. Hence the program halts. This is in contradiction with the statement in the condition that Halt is false (and would not halt).

22 Proof In other words we've shown that the halting problem cannot, in general, be solved. The reason that it cannot be solved is that it gives rise to an inherent contradiction.

23 Proof The conclusion is that you cannot answer the question "does a program halt?" You can answer it for a specific algorithm. However, each algorithm requires its own proof. There is no general all encompassing way to answer the question. To rephrase: there is no way to prove that an algorithm is complete except by doing it. It proves that maths is not a complete system. There are problems which are known to have known algorithmic solution.

24 Humans A Universal TM can compute anything which is computable. It has been argued (for example by Turing himself) that a Universal TM should, in principle, be capable of intelligence. Human minds might be Universal TMs. There has been a lot of discussion based on this: John Searle, Daniel Dennett

25 Cellular Automata Elementary cellular automata: one dimensional CA. Rule 110 CA has been proven to Turing complete. In theory it is possible for the Rule 110 1D to calculate anything a Universal TM can.

26 Real computers Universal TM is comparable to a real computer. Anything a real computer can compute can be computed by a TM. Note that one implication is that there are things computers cannot compute, however everything that can be computed can be computed by a computer (given enough time and storage). Ironically it can be a lot easier to describe certain algorithms using a TM than a real computer. Similar to the use of recursive proofs or predicate logic.

27 Real computers A universal TM is unbounded: the tape can be infinite, the number of instructions unlimited, and no time is imposed on its computations. A real computer is bounded: both time and space are limited. The number of configurations a real computer can take are limited. They are finite (hence FSM). A TM expresses algorithms in general terms. A real program needs to consider things such as precision (floating point imprecision) and error conditions.

28 Real computers The TM uses a sequential tape. A real computer uses registers and random-access storage. It can use registers to store other registers and access data across a spectrum. TMs do not model concurrency easily.