Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.

Slides:



Advertisements
Similar presentations
Turing Machines January 2003 Part 2:. 2 TM Recap We have seen how an abstract TM can be built to implement any computable algorithm TM has components:
Advertisements

Chapter 11: Models of Computation
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.
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.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
FLAC Lecture 19 Turing Machines and Real Life * Reductions Mihai Budiu March 3, 2000.
Chapter 10 Models of Computation. What is a model? Captures the essence – the important properties – of the real thing Captures the essence – the important.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
CHAPTER 3 The Church-Turing Thesis
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Class 19: Undecidability in Theory and Practice David Evans cs302: Theory of Computation University of Virginia Computer.
More Theory of Computing
Computability and Modeling Computation What are some really impressive things that computers can do? –Land the space shuttle (and other aircraft) from.
By: Er. Sukhwinder kaur.  Computation Computation  Algorithm Algorithm  Objectives Objectives  What do we study in Theory of Computation ? What do.
Turing Machines Chapter Plan Turing Machines(TMs) – Alan Turing Church-Turing Thesis – Definitions Computation Configuration Recognizable vs. Decidable.
The Turing machine Olena Lastivka. Definition Turing machine is a theoretical device that manipulates symbols on a strip of tape according to a table.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
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.
©Brooks/Cole, 2003 Chapter 17 Theory of Computation.
Computer Science 101 Theory of Computing. Computer Science is... The study of algorithms, with respect to –their formal properties –their linguistic realizations.
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)
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
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.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich
Capabilities of computing systems Numeric and symbolic Computations A look at Computability theory Turing Machines.
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
Interactive computability Episode 13 0 Hard-play machines (HPMs) Easy-play machines (EPMs) Definition of interactive computability The interactive version.
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,
 2004 SDU 1 Algorithm Informally speaking, an algorithm is a collection of simple instructions for carrying out a task. Example:  Elementary arithmetic.
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Chapter 12 Theory of Computation Introduction to CS 1 st Semester, 2014 Sanghyun Park.
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
Theory of Computation Automata Theory Dr. Ayman Srour.
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.
CSE202: Introduction to Formal Languages and Automata Theory
Introduction to Computing Science and Programming I
Computable Functions.
CSE 311 Foundations of Computing I
Pumping Lemma Revisited
Turing Machines 2nd 2017 Lecture 9.
Chapter 9 TURING MACHINES.
Chapter 3: The CHURCH-Turing thesis
Jaya Krishna, M.Tech, Assistant Professor
فصل سوم The Church-Turing Thesis
Theory of Computation Turing Machines.
The Programming Language L
P.V.G’s College of Engineering, Nashik
CSE S. Tanimoto Turing Completeness
The Programming Language L
CO Games Development 2 Week 21 Turing Machines & Computability
Turing Machines Everything is an Integer
Presentation transcript:

Theory of Computation

Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely (mathematically).

Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely (mathematically). Examples: Adding two numbers in our brains, on a piece of paper or using a calculator.

Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely. (mathematically) Examples: Adding two numbers in our brains, on a piece of paper or using a calculator. Converting a decimal number to its binary presentation or vise versa.

Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely (mathematically). Examples: Adding two numbers in our brains, on a piece of paper or using a calculator. Converting a decimal number to its binary presentation or vise versa. Finding the greatest common divisors of two numbers. …

Theory of Computation A very fundamental and traditional branch of Theory of Computation seeks:

Theory of Computation A very fundamental and traditional branch of Theory of Computation seeks: 1. A more tangible definition for the intuitive notion of algorithm which results in a more concrete definition for computation.

Theory of Computation A very fundamental and traditional branch of Theory of Computation seeks: 1. A more tangible definition for the intuitive notion of algorithm which results in a more concrete definition for computation. 2. Finding the boundaries (limitations) of computation.

Algorithm A finite sequence of simple instructions that is guaranteed to halt in a finite amount of time.

Algorithm A finite sequence of simple instructions that is guaranteed to halt in a finite amount of time. This is a very abstract definition, since: – We didn’t specify the nature of this simple instructions. For example an instruction can be “increment a number by one” or “Calculate the triple integral”

Algorithm A finite sequence of simple instructions that is guaranteed to halt in a finite amount of time. This is a very abstract definition, since: – We didn’t specify the nature of this simple instructions. For example an instruction can be “increment a number by one” or “Calculate the triple integral” – We didn’t specify the entity which can execute these instructions.

Algorithm A finite sequence of simple instructions that is guaranteed to halt in a finite amount of time. This is a very abstract definition, since: – We didn’t specify the nature of this simple instructions. For example an instruction can be “increment a number by one” or “Calculate the triple integral” – We didn’t specify the entity which can execute these instructions. For example is this entity a person, a computer, … If it is a computer what is the processor type? How much memory does it have? …. ?

An Abstract Machine To make a more solid definition of algorithm we need to define an abstract (general) machine which can perform any algorithm that can be executed by any computer.

An Abstract Machine To make a more solid definition of algorithm we need to define an abstract (general) machine which can perform any algorithm that can be executed by any computer. Then, We need to show that indeed this machine can run any algorithm that can be executed by any other computer. Then,

An Abstract Machine To make a more solid definition of algorithm we need to define an abstract (general) machine which can perform any algorithm that can be executed by any computer. Then, We need to show that indeed this machine can run any algorithm that can be executed by any other computer. Then, – We can associate the notion of algorithm with this abstract machine. – We can study this machine to find the limitations of computations. (Problems with no computation available to solve.)

Turing Machine A conceptual model for general purpose computers proposed by Alan Turing in 1936.

Turing Machine A conceptual model for general purpose computers proposed by Alan Turing in A Turing machine has an unlimited and unrestricted amount of memory.

Turing Machine A conceptual model for general purpose computers proposed by Alan Turing in A Turing machine has an unlimited and unrestricted amount of memory. A Turing machine can do everything a real computer can do.

Turing Machine A conceptual model for general purpose computers proposed by Alan Turing in A Turing machine has an unlimited and unrestricted amount of memory. A Turing machine can do everything a real computer can do. Nevertheless there are problems that a Turing machine cannot solve.

Turing Machine A conceptual model for general purpose computers proposed by Alan Turing in A Turing machine has an unlimited and unrestricted amount of memory. A Turing machine can do everything a real computer can do. Nevertheless there are problems that a Turing machine cannot solve. In a real sense, these problems are beyond the theoretical limits of computations.

Turing Machine Specification Components of Turing Machine: 1.An unlimited length tape of discrete cells.

Turing Machine Specification Components of Turing Machine: 1.An unlimited length tape of discrete cells. 2.A head which reads and writes on tape.

Turing Machine Specification Components of Turing Machine: 1.An unlimited length tape of discrete cells. 2.A head which reads and writes on tape. 3.A control device with a finite number of states which can

Turing Machine Specification Components of Turing Machine: 1.An unlimited length tape of discrete cells. 2.A head which reads and writes on tape. 3.A control device with a finite number of states which can a)Instruct the head to read the symbol on the tape currently under head.

Turing Machine Specification Components of Turing Machine: 1.An unlimited length tape of discrete cells. 2.A head which reads and writes on tape. 3.A control device with a finite number of states which can a)Instruct the head to read the symbol on the tape currently under head. b)Instruct the head to write a symbol on the cell of the tape currently under tape.

Turing Machine Specification Components of Turing Machine: 1.An unlimited length tape of discrete cells. 2.A head which reads and writes on tape. 3.A control device with a finite number of states which can a)Instruct the head to read the symbol on the tape currently under head. b)Instruct the head to write a symbol on the cell of the tape currently under tape. c)Move the head one cell to left or right.

Turing Machine Specification Components of Turing Machine: 1.An unlimited length tape of discrete cells. 2.A head which reads and writes on tape. 3.A control device with a finite number of states which can a)Instruct the head to read the symbol on the tape currently under head. b)Instruct the head to write a symbol on the cell of the tape currently under tape. c)Move the head one cell to left or right. d)Change its current state.

A Turning Machine

Turing Machine Instructions Instructions of Turing Machine have the following format: (Current State, Current Symbol, Write, Move L/R or No move, New State) Ex: (2, 0, 1, L, 3) (3, 1, blank, N, 4) (1, #, 0, R, 7)

Turing Machine Instructions The interpretation of the TM (Turing Machine) instructions:  (2, 0, 1, L, 3) – When Turing machine (the control unit of TM) is at state 2 and the current tape symbol is 0, write symbol 1 at current tape cell and go to state 3.

Visualization of TM instruction (2, 0, 1, L, 3)

TM Conventions We always use state 1 as the initial state. (That is the execution of the algorithm or program begins with stating of the TM being 1.

TM Conventions We always use state 1 as the initial state. (That is the execution of the algorithm or program begins with stating of the TM being 1. The tape is used for recording input and output, one symbol per cell. Initially, the string to serve as input to our computation is recorded beginning from the leftmost tape cell.

TM Conventions We always use state 1 as the initial state. (That is the execution of the algorithm or program begins with stating of the TM being 1. The tape is used for recording input and output, one symbol per cell. Initially, the string to serve as input to our computation is recorded beginning from the leftmost tape cell. Initially, the position of head is at left most cell.

Initial Configuration of TM

The Output of TM The output of a TM program or algorithm is the sequence of symbols on the tape when the TM halts on that program.

TM Programs A Turing machine program is a set of TM instructions.

TM Programs A Turing machine program is a set of TM instructions. Turing machine halts on a program if there is no instruction in the program which its current state is the current state of the machine and its current symbol is the current symbol of the tape of the machine (symbol under head of the machine).

Example 1 { (1, 1, 1, R, 2), (2, 1, 1, R, 2), (2, blank, blank, R, 3), (3, 1, blank, L, 4), (4, blank, 1, R, 2) }

Example 1 { (1, 1, 1, R, 2), (2, 1, 1, R, 2), (2, blank, blank, R, 3), (3, 1, blank, L, 4), (4, blank, 1, R, 2) } This program outputs the sum of two integers m and n given as input.

Example 1 { (1, 1, 1, R, 2), (2, 1, 1, R, 2), (2, blank, blank, R, 3), (3, 1, blank, L, 4), (4, blank, 1, R, 2) } This program outputs the sum of two integers m and n given as input. The numbers are in base 1 (unary notation).

Example 1 { (1, 1, 1, R, 2), (2, 1, 1, R, 2), (2, blank, blank, R, 3), (3, 1, blank, L, 4), (4, blank, 1, R, 2) } This program outputs the sum of two integers m and n given as input. The numbers are in base 1 (unary notation). Examples of integers in unary notation: 1 = 1 2 = 11 3 = = 1111 …. number n = n number of 1s.

Example 1 The input on tape (the initial configuration): 1 1 b b b b … state = 1 ^ Inputs : operands 2 and 4.

Example 1 The input on tape (the initial configuration): 1 1 b b b b … state = 1 ^ Inputs : operands 2 and 4. The output on tape (when the program halts): b b b … state = 3 output : 6 b stands for blank.

Example 1 Executing the program:

Example b b b … state = 1 ^ Instruction which is going to be executed: (1, 1, 1, R, 2)

Example b b b … state = 2 ^ Instruction which is going to be executed: (2, 1, 1, R, 2)

Example b b b … state = 2 ^ Instruction which is going to be executed: (2, blank, blank, R, 3)

Example b b b … state = 3 ^ Instruction which is going to be executed: (3, 1, blank, L, 4)

Example b b b b … state = 4 ^ Instruction which is going to be executed: (4, blank, 1, R, 2)

Example b b b … state = 2 ^ Instruction which is going to be executed: (2, blank, blank, R, 3),

Example b b b … state = 3 ^ Instruction which is going to be executed: (3, 1, blank, L, 4)

Example b b 1 1 b b … state = 4 ^ Instruction which is going to be executed: (4, blank, 1, R, 2)

Example b 1 1 b b … state = 2 ^ Instruction which is going to be executed: (2, blank, blank, R, 3)

Example b 1 1 b b … state = 3 ^ Instruction which is going to be executed: (3, 1, blank, L, 4)

Example b b 1 b b … state = 4 ^ Instruction which is going to be executed: (4, blank, 1, R, 2)

Example b 1 b b … state = 2 ^ Instruction which is going to be executed: (2, blank, blank, R, 3)

Example b 1 b b … state = 3 ^ Instruction which is going to be executed: (3, 1, blank, L, 4)

Example b b b b … state = 4 ^ Instruction which is going to be executed: (4, blank, 1, R, 2)

Example b b b … state = 2 ^ Instruction which is going to be executed: (2, blank, blank, R, 3)

Example b b b … state = 3 ^ There is no instruction starting with: (3,blank, …. ) => HALT Output : b b b …

Example b b b … state = 3 ^ There is no instruction starting with: (3,blank, …. ) => HALT Output : b b b … What is the function computed by this TM prorgram?

Example 2 {(1, 0, 0, R, 2), (1, 1, 1, R, 2), (2, 0, 0, R, 2), (2, 1, 1, R, 2), (2, blank, 0, R, 3), (3, blank, 0, R, 4 )} Number of states: 4 Used alphabet : 0, 1

Example b b b … state = 1 ^ (1, 0, 0, R, 2) > (1, 1, 1, R, 2) (2, 0, 0, R, 2) (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b b … state = 2 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) (2, 0, 0, R, 2) > (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b b … state = 2 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) > (2, 0, 0, R, 2) (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b b … state = 2 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) > (2, 0, 0, R, 2) (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b b … state = 2 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) (2, 0, 0, R, 2) > (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b b … state = 2 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) > (2, 0, 0, R, 2) (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b b … state = 2 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) (2, 0, 0, R, 2) > (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b b … state = 2 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) (2, 0, 0, R, 2) > (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b b … state = 2 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) (2, 0, 0, R, 2) (2, 1, 1, R, 2) > (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example b b … state = 3 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) (2, 0, 0, R, 2) (2, 1, 1, R, 2) (2, blank, 0, R, 3) > (3, blank, 0, R, 4 )

Example b … state = 4 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) (2, 0, 0, R, 2) (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 )

Example 2 HALT. Output: b … state = 4 ^ INPUT: What is the function that is being computed by this program?

Example 2 OUTPUT: INPUT: Input is base-2 presentation of number 203 and output is the base-2 presentation of number 812.

Example 2 OUTPUT: INPUT: Input is base-2 presentation of number 203 and output is the base-2 presentation of number 812. Thus, f(x) = 4x

The definition of Algorithm We have reasons to believe (Although we will not provide the reasoning here in this course) that for any algorithm (finite sequence of steps which stops in a finite amount of time) that can be executed on any machine, there is a TM algorithm (program) which can be executed on TM and performs the same action.

Conclusion Intuitive notion of Turing machine algorithm equals algorithm The Church-Turing Thesis

Decidable Problems Problems, for which we can’t find an algorithm that answer all possible instances of the problem.

Decidable Problems Problems, for which we can’t find an algorithm that answer all possible instances of the problem. That is there is no TM program which answer all possible instances of the problem in a finite amount of time.

Decidable Problems For a decidable problem there is a program such that if an instance of the problem has solution, the program eventually halts with answer. But if there is no solution for that instance, the program will not ever halt.

Decidable Problems For a decidable problem there is a program such that if an instance of the problem has solution, the program eventually halts with answer. But if there is no solution for that instance, the program will not ever halt. Can we consider such programs as algorithms?

Decidable Problems For a decidable problem there is a program such that if an instance of the problem has solution, the program eventually halts with answer. But if there is no solution for that instance, the program will not ever halt. Can we consider such programs as algorithms? Answer: No, because they might not halt.

An Un-decidable Problem The problem of finding an integral solution for a collection of multi-variable polynomial equations, is not decidable. For example consider the following two instances of problem:

Examples

Assume, we have a program which assigns all possible combination of 3 integers to variables x, y and z. For the first case there is at least one solution (x = 2, y = 1, z =5). Thus, the program will eventually stops. But for the second case we don’t know if this system has a solution. If there is no solution for the second system, then the program never stops.