TM1 - Turing Machines and Computability Part I Introduction...

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: Turing Machines and Computability Part I Introduction to Cognitive and Information Sciences April 19, 2011 Sym Sys 100: Turing Machines and Computability, Part I 1 The Course Up to Now Sym Sys 100: Turing Machines and Computability, Part I 2 The Course Up to Now ￿ In Week 1, we had some history, plus a talk by Ken Taylor with philosophical reflections on what thinking might be. Sym Sys 100: Turing Machines and Computability, Part I 2 The Course Up to Now ￿ In Week 1, we had some history, plus a talk by Ken Taylor with philosophical reflections on what thinking might be. ￿ In Weeks 2 and 3, with Jay McClelland, we saw some of the central ideas and modeling tools in contemporary cognitive science. Sym Sys 100: Turing Machines and Computability, Part I 2 The Course Up to Now ￿ In Week 1, we had some history, plus a talk by Ken Taylor with philosophical reflections on what thinking might be. ￿ In Weeks 2 and 3, with Jay McClelland, we saw some of the central ideas and modeling tools in contemporary cognitive science. ￿ This week we begin on foundational ideas from the information science side, discussing the abstract notion of computation. Sym Sys 100: Turing Machines and Computability, Part I 2 The Course Up to Now ￿ In Week 1, we had some history, plus a talk by Ken Taylor with philosophical reflections on what thinking might be. ￿ In Weeks 2 and 3, with Jay McClelland, we saw some of the central ideas and modeling tools in contemporary cognitive science. ￿ This week we begin on foundational ideas from the information science side, discussing the abstract notion of computation. ￿ One question to keep in mind is, how might these topics fit together? We shall return to this question on Thursday, as well as later in the course. Sym Sys 100: Turing Machines and Computability, Part I 2 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; 3. Let m := n, and n := r. Return to Step 2. Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; 3. Let m := n, and n := r. Return to Step 2. For example: what is the GCD of 1365 and 3654? Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; 3. Let m := n, and n := r. Return to Step 2. For example: what is the GCD of 1365 and 3654? 3654 ÷ 1365 = 3, Remainder 924 Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; 3. Let m := n, and n := r. Return to Step 2. For example: what is the GCD of 1365 and 3654? 3654 ÷ 1365 = 3, Remainder 924 1365 ÷ 924 = 1, Remainder 441 Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; 3. Let m := n, and n := r. Return to Step 2. For example: what is the GCD of 1365 and 3654? 3654 ÷ 1365 = 3, Remainder 924 1365 ÷ 924 = 1, Remainder 441 924 ÷ 441 = 2, Remainder 42 Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; 3. Let m := n, and n := r. Return to Step 2. For example: what is the GCD of 1365 and 3654? 3654 ÷ 1365 = 3, Remainder 924 1365 ÷ 924 = 1, Remainder 441 924 ÷ 441 = 2, Remainder 42 441 ÷ 42 = 10, Remainder 21 Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; 3. Let m := n, and n := r. Return to Step 2. For example: what is the GCD of 1365 and 3654? 3654 ÷ 1365 = 3, Remainder 924 1365 ÷ 924 = 1, Remainder 441 924 ÷ 441 = 2, Remainder 42 441 ÷ 42 = 10, Remainder 21 42 ÷ 21 = 2, Remainder 0 Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability Consider the following problem: Given two natural numbers a and b, what is the greatest common divisor of a and b? Around 300 B.C. Euclid proposed a general method to solve this question, now called Euclid’s Algorithm: 1. Let m := max(a,b), and n := min(a,b); 2. Divide m by n and get the remainder r. If r = 0, then n is the greatest common divisor of a and b; 3. Let m := n, and n := r. Return to Step 2. For example: what is the GCD of 1365 and 3654? 3654 ÷ 1365 = 3, Remainder 924 1365 ÷ 924 = 1, Remainder 441 924 ÷ 441 = 2, Remainder 42 441 ÷ 42 = 10, Remainder 21 42 ÷ 21 = 2, Remainder 0 Hence, the answer the is 21. Sym Sys 100: Turing Machines and Computability, Part I 3 The Idea of Computability ￿ Euclid’s Algorithm is a paradigm case of a computable procedure : Sym Sys 100: Turing Machines and Computability, Part I 4 The Idea of Computability ￿ Euclid’s Algorithm is a paradigm case of a computable procedure : • When executed correctly, it always gives the right answer. Sym Sys 100: Turing Machines and Computability, Part I 4 The Idea of Computability ￿ Euclid’s Algorithm is a paradigm case of a computable procedure : • When executed correctly, it always gives the right answer. • It is always guaranteed to stop after some finite amount of time. Sym Sys 100: Turing Machines and Computability, Part I 4 The Idea of Computability ￿ Euclid’s Algorithm is a paradigm case of a computable procedure : • When executed correctly, it always gives the right answer. • It is always guaranteed to stop after some finite amount of time. • It requires no “insight” by the person carrying out the algorithm. Sym Sys 100: Turing Machines and Computability, Part I 4 The Idea of Computability ￿ Euclid’s Algorithm is a paradigm case of a computable procedure : • When executed correctly, it always gives the right answer. • It is always guaranteed to stop after some finite amount of time. • It requires no “insight” by the person carrying out the algorithm. ￿ The problem of determining the GCD of two natural numbers is therefore a computable problem, because there is a computable procedure for solving it. Sym Sys 100: Turing Machines and Computability, Part I 4 The Idea of Computability ￿ Euclid’s Algorithm is a paradigm case of a computable procedure : • When executed correctly, it always gives the right answer. • It is always guaranteed to stop after some finite amount of time. • It requires no “insight” by the person carrying out the algorithm. ￿ The problem of determining the GCD of two natural numbers is therefore a computable problem, because there is a computable procedure for solving it. ￿ Question: Is there some way of giving a general characterization of the problems that can be solved this way? Can we give a definition of a computable problem or procedure? Sym Sys 100: Turing Machines and Computability, Part I 4 The Idea of Computability ￿ Though there were important predecessors, Alan Turing was the first to capture the notion of computability in an intuitively satisfying way, with what became known as the Turing Machine. (Turing called them logical computing machines.) Sym Sys 100: Turing Machines and Computability, Part I 5 The Idea of Computability ￿ Though there were important predecessors, Alan Turing was the first to capture the notion of computability in an intuitively satisfying way, with what became known as the Turing Machine. (Turing called them logical computing machines.) ￿ Turing Machines are important for a number of reasons: Sym Sys 100: Turing Machines and Computability, Part I 5 The Idea of Computability ￿ Though there were important predecessors, Alan Turing was the first to capture the notion of computability in an intuitively satisfying way, with what became known as the Turing Machine. (Turing called them logical computing machines.) ￿ Turing Machines are important for a number of reasons: • They were central to the development of modern computers; Sym Sys 100: Turing Machines and Computability, Part I 5 The Idea of Computability ￿ Though there were important predecessors, Alan Turing was the first to capture the notion of computability in an intuitively satisfying way, with what became known as the Turing Machine. (Turing called them logical computing machines.) ￿ Turing Machines are important for a number of reasons: • They were central to the development of modern computers; • They are still central in theoretical computer science; Sym Sys 100: Turing Machines and Computability, Part I 5 The Idea of Computability ￿ Though there were important predecessors, Alan Turing was the first to capture the notion of computability in an intuitively satisfying way, with what became known as the Turing Machine. (Turing called them logical computing machines.) ￿ Turing Machines are important for a number of reasons: • They were central to the development of modern computers; • They are still central in theoretical computer science; • They have had an important impact on cognitive science; Sym Sys 100: Turing Machines and Computability, Part I 5 The Idea of Computability ￿ Though there were important predecessors, Alan Turing was the first to capture the notion of computability in an intuitively satisfying way, with what became known as the Turing Machine. (Turing called them logical computing machines.) ￿ Turing Machines are important for a number of reasons: • • • • They were central to the development of modern computers; They are still central in theoretical computer science; They have had an important impact on cognitive science; As we shall see, they are central in the foundations of mathematics. Sym Sys 100: Turing Machines and Computability, Part I 5 Turing Machines Basic Idea Sym Sys 100: Turing Machines and Computability, Part I 6 Turing Machines Basic Idea ￿ Imagine a person performing numerical calculations by blindly following antecedently given rules. (In Turing’s day this was an actual occupation.) Sym Sys 100: Turing Machines and Computability, Part I 6 Turing Machines Basic Idea ￿ Imagine a person performing numerical calculations by blindly following antecedently given rules. (In Turing’s day this was an actual occupation.) ￿ Turing wanted to boil this process down to its bear essentials, with the simplest model possible. Sym Sys 100: Turing Machines and Computability, Part I 6 Turing Machines Basic Idea ￿ Imagine a person performing numerical calculations by blindly following antecedently given rules. (In Turing’s day this was an actual occupation.) ￿ Turing wanted to boil this process down to its bear essentials, with the simplest model possible. ￿ Simplifications and idealizations: Sym Sys 100: Turing Machines and Computability, Part I 6 Turing Machines Basic Idea ￿ Imagine a person performing numerical calculations by blindly following antecedently given rules. (In Turing’s day this was an actual occupation.) ￿ Turing wanted to boil this process down to its bear essentials, with the simplest model possible. ￿ Simplifications and idealizations: • Computing only over 0’s and 1’s; (not essential) Sym Sys 100: Turing Machines and Computability, Part I 6 Turing Machines Basic Idea ￿ Imagine a person performing numerical calculations by blindly following antecedently given rules. (In Turing’s day this was an actual occupation.) ￿ Turing wanted to boil this process down to its bear essentials, with the simplest model possible. ￿ Simplifications and idealizations: • Computing only over 0’s and 1’s; (not essential) • One task at a time; (not essential) Sym Sys 100: Turing Machines and Computability, Part I 6 Turing Machines Basic Idea ￿ Imagine a person performing numerical calculations by blindly following antecedently given rules. (In Turing’s day this was an actual occupation.) ￿ Turing wanted to boil this process down to its bear essentials, with the simplest model possible. ￿ Simplifications and idealizations: • Computing only over 0’s and 1’s; (not essential) • One task at a time; (not essential) • Infinite workspace; (essential) Sym Sys 100: Turing Machines and Computability, Part I 6 Turing Machines Basic Idea ￿ Imagine a person performing numerical calculations by blindly following antecedently given rules. (In Turing’s day this was an actual occupation.) ￿ Turing wanted to boil this process down to its bear essentials, with the simplest model possible. ￿ Simplifications and idealizations: • • • • Computing only over 0’s and 1’s; (not essential) One task at a time; (not essential) Infinite workspace; (essential) Discrete time. (essential) Sym Sys 100: Turing Machines and Computability, Part I 6 Turing Machines Elements of a Turing Machine Sym Sys 100: Turing Machines and Computability, Part I 7 Turing Machines Elements of a Turing Machine ￿ Infinite tape, unbounded in both directions; Sym Sys 100: Turing Machines and Computability, Part I 7 Turing Machines Elements of a Turing Machine ￿ Infinite tape, unbounded in both directions; ￿ Two symbols, 0 and 1, that appear in the cells of the tape; bold, underlined font denotes the current cell ; Sym Sys 100: Turing Machines and Computability, Part I 7 Turing Machines Elements of a Turing Machine ￿ Infinite tape, unbounded in both directions; ￿ Two symbols, 0 and 1, that appear in the cells of the tape; bold, underlined font denotes the current cell ; ... Sym Sys 100: Turing Machines and Computability, Part I 0 0 1 1 1 0 ... 7 Turing Machines Elements of a Turing Machine ￿ Infinite tape, unbounded in both directions; ￿ Two symbols, 0 and 1, that appear in the cells of the tape; bold, underlined font denotes the current cell ; ... ￿ 0 0 1 1 1 0 ... Finitely many internal states of the machine; Sym Sys 100: Turing Machines and Computability, Part I 7 Turing Machines Elements of a Turing Machine ￿ Infinite tape, unbounded in both directions; ￿ Two symbols, 0 and 1, that appear in the cells of the tape; bold, underlined font denotes the current cell ; ... 0 0 1 1 1 0 ￿ Finitely many internal states of the machine; ￿ ... And... Sym Sys 100: Turing Machines and Computability, Part I 7 Turing Machines ￿ Rules that provide instructions for what to do next: Sym Sys 100: Turing Machines and Computability, Part I 8 Turing Machines ￿ Rules that provide instructions for what to do next: 0 1 1 1L2 1R1 2 0R3 1L2 . . . . . . . . . 45 Sym Sys 100: Turing Machines and Computability, Part I 0R46 1L45 8 Turing Machines ￿ Rules that provide instructions for what to do next: 0 1 1 1L2 1R1 2 0R3 1L2 . . . . . . . . . 45 0R46 1L45 • The left-most column lists the states. • The top row specifies whether the symbol in the current cell is 1 or 0 • The other cells give instructions for: ￿ ￿ ￿ what to write, where to go, and which state to enter. Sym Sys 100: Turing Machines and Computability, Part I 8 Turing Machines ￿ Rules that provide instructions for what to do next: 0 1 1 1L2 1R1 2 0R3 1L2 . . . . . . . . . 45 0R46 1L45 • The left-most column lists the states. • The top row specifies whether the symbol in the current cell is 1 or 0 • The other cells give instructions for: ￿ ￿ ￿ ￿ what to write, where to go, and which state to enter. Thus, if we are in state 1 and see a 0 in the current cell, we look at instruction 1L2, which tells us to rewrite 1 as 1, move left one cell on the tape, and transition to state 2. Sym Sys 100: Turing Machines and Computability, Part I 8 Turing Machines ... 0 0 1 2 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1L2 0R3 1 1 0 ... 1 1R1 1L2 9 Turing Machines ... 0 0 1 2 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1L2 0R3 1 1 0 ... 1 1R1 1L2 10 Turing Machines ... 0 0 1 2 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1L2 0R3 1 1 0 ... 1 1R1 1L2 11 Turing Machines ... 0 0 1 2 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1L2 0R3 1 1 0 ... 1 1R1 1L2 12 Turing Machines ... 0 0 1 2 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1L2 0R3 1 1 1 ... 1 1R1 1L2 13 Turing Machines ... 0 0 1 2 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1L2 0R3 1 1 1 ... 1 1R1 1L2 14 Turing Machines Sym Sys 100: Turing Machines and Computability, Part I 0 0 1 1 2 ... 0 1L2 0R3 1 1 1 ... 1 1R1 1L2 15 Turing Machines ... 0 0 1 2 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1L2 0R3 1 1 1 ... 1 1R1 1L2 16 Turing Machines Sym Sys 100: Turing Machines and Computability, Part I 0 0 1 1 2 ... 0 1L2 0R3 1 1 1 ... 1 1R1 1L2 17 Turing Machines What numerical function does this Turing Machine compute? Sym Sys 100: Turing Machines and Computability, Part I 18 Turing Machines Conventions on Computing Functions Sym Sys 100: Turing Machines and Computability, Part I 19 Turing Machines Conventions on Computing Functions ￿ For functions of one argument, the input is written in unary. For example, 3 is written as a sequence of three 1’s, taking up three cells. Sym Sys 100: Turing Machines and Computability, Part I 19 Turing Machines Conventions on Computing Functions ￿ For functions of one argument, the input is written in unary. For example, 3 is written as a sequence of three 1’s, taking up three cells. ￿ The current cell always begins on the leftmost 1 of the input. Sym Sys 100: Turing Machines and Computability, Part I 19 Turing Machines Conventions on Computing Functions ￿ For functions of one argument, the input is written in unary. For example, 3 is written as a sequence of three 1’s, taking up three cells. ￿ The current cell always begins on the leftmost 1 of the input. ￿ All other cells contain 0. Sym Sys 100: Turing Machines and Computability, Part I 19 Turing Machines Conventions on Computing Functions ￿ For functions of one argument, the input is written in unary. For example, 3 is written as a sequence of three 1’s, taking up three cells. ￿ The current cell always begins on the leftmost 1 of the input. ￿ All other cells contain 0. ￿ Beginning in state 1, we always carry out the instructions given by the table until there are no more applicable rules. Sym Sys 100: Turing Machines and Computability, Part I 19 Turing Machines Conventions on Computing Functions ￿ For functions of one argument, the input is written in unary. For example, 3 is written as a sequence of three 1’s, taking up three cells. ￿ The current cell always begins on the leftmost 1 of the input. ￿ All other cells contain 0. ￿ Beginning in state 1, we always carry out the instructions given by the table until there are no more applicable rules. ￿ The output is the number of 1’s written on the tape. Sym Sys 100: Turing Machines and Computability, Part I 19 Turing Machines Conventions on Computing Functions ￿ For functions of one argument, the input is written in unary. For example, 3 is written as a sequence of three 1’s, taking up three cells. ￿ The current cell always begins on the leftmost 1 of the input. ￿ All other cells contain 0. ￿ Beginning in state 1, we always carry out the instructions given by the table until there are no more applicable rules. ￿ The output is the number of 1’s written on the tape. ￿ By convention, we require that programs always end with the first 1 of the output in the current cell, with no 0’s separating 1’s. (This is important if we want to compose functions together.) Sym Sys 100: Turing Machines and Computability, Part I 19 Turing Machines Conventions on Computing Functions ￿ For functions of one argument, the input is written in unary. For example, 3 is written as a sequence of three 1’s, taking up three cells. ￿ The current cell always begins on the leftmost 1 of the input. ￿ All other cells contain 0. ￿ Beginning in state 1, we always carry out the instructions given by the table until there are no more applicable rules. ￿ The output is the number of 1’s written on the tape. ￿ By convention, we require that programs always end with the first 1 of the output in the current cell, with no 0’s separating 1’s. (This is important if we want to compose functions together.) Definition Let M be a given Turing machine, and f : N → N a numerical function. If for all x ∈ N, whenever x is given as input M always gives f (x ) as output, then we say M computes the function f . Sym Sys 100: Turing Machines and Computability, Part I 19 Turing Machines Given these conventions, can you think of a smarter, quicker way of computing x + 1? Sym Sys 100: Turing Machines and Computability, Part I 20 Turing Machines Sym Sys 100: Turing Machines and Computability, Part I 0 0 1 1 2 ... 0 1L2 0R3 1 1 0 ... 1 1L1 – 21 Turing Machines Sym Sys 100: Turing Machines and Computability, Part I 0 0 1 1 2 ... 0 1L2 0R3 1 1 0 ... 1 1L1 – 22 Turing Machines ... 0 1 1 2 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1L2 0R3 1 1 0 ... 1 1L1 – 23 Turing Machines Sym Sys 100: Turing Machines and Computability, Part I 0 1 1 1 2 ... 0 1L2 0R3 1 1 0 ... 1 1L1 – 24 Turing Machines ￿ Consider a slightly more difficult example. Say, 2x . Sym Sys 100: Turing Machines and Computability, Part I 25 Turing Machines ￿ Consider a slightly more difficult example. Say, 2x . ￿ Any ideas for what the machine should do at a high level? Sym Sys 100: Turing Machines and Computability, Part I 25 Turing Machines ... 0 1 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 0 0 0R7 0R3 1R4 1L5 0L6 0R1 0 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 26 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 0 0 0R7 0R3 1R4 1L5 0L6 0R1 0 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 27 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 0 0 0R7 0R3 1R4 1L5 0L6 0R1 0 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 28 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 0 0 0R7 0R3 1R4 1L5 0L6 0R1 0 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 29 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 0 0 0R7 0R3 1R4 1L5 0L6 0R1 0 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 30 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 0 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 31 Turing Machines 0 0 1 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1 1 2 3 4 5 6 ... 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 32 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 33 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 34 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 35 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 36 Turing Machines ... 0 0 1 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 37 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 38 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 39 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 40 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 41 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 0 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 42 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 0 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 43 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 44 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 45 Turing Machines 0 0 0 Sym Sys 100: Turing Machines and Computability, Part I 1 0 1 1 2 3 4 5 6 ... 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 46 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 47 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 48 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 49 Turing Machines ... 0 0 0 1 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 50 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 51 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 52 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 53 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 54 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 55 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 0 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 56 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 0 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 57 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 58 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 59 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 60 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 61 Turing Machines 0 0 0 Sym Sys 100: Turing Machines and Computability, Part I 0 0 1 1 2 3 4 5 6 ... 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 62 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 63 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 64 Turing Machines ... 0 0 0 0 0 1 2 3 4 5 6 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 65 Turing Machines 0 0 0 Sym Sys 100: Turing Machines and Computability, Part I 0 0 1 1 2 3 4 5 6 ... 0 0R7 0R3 1R4 1L5 0L6 0R1 1 1 1 1 1 0 ... 1 0R2 1R2 1R3 – 1L5 1L6 66 Turing Machines How might we compute functions of two arguments? Sym Sys 100: Turing Machines and Computability, Part I 67 Turing Machines How might we compute functions of two arguments? ￿ Write the two sequences in a row, separated by a single 0. Sym Sys 100: Turing Machines and Computability, Part I 67 Turing Machines How might we compute functions of two arguments? ￿ Write the two sequences in a row, separated by a single 0. ￿ We begin the computation with the leftmost 1 of the first input as current cell. Sym Sys 100: Turing Machines and Computability, Part I 67 Turing Machines How might we compute functions of two arguments? ￿ Write the two sequences in a row, separated by a single 0. ￿ We begin the computation with the leftmost 1 of the first input as current cell. ￿ Otherwise, all conventions are the same. Sym Sys 100: Turing Machines and Computability, Part I 67 Turing Machines How might we compute functions of two arguments? ￿ Write the two sequences in a row, separated by a single 0. ￿ We begin the computation with the leftmost 1 of the first input as current cell. ￿ Otherwise, all conventions are the same. For a relatively easy case, consider the function x + y . Sym Sys 100: Turing Machines and Computability, Part I 67 Turing Machines ... 1 0 1 1 0 1 1 0 ... We need to compute 3+2. Sym Sys 100: Turing Machines and Computability, Part I 68 Turing Machines ... 0 1 1 1 2 3 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R3 1L3 0R4 0 1 1 0 ... 1 0R2 1R2 1L3 69 Turing Machines ... 0 0 1 1 2 3 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R3 1L3 0R4 0 1 1 0 ... 1 0R2 1R2 1L3 70 Turing Machines ... 0 0 1 1 2 3 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R3 1L3 0R4 0 1 1 0 ... 1 0R2 1R2 1L3 71 Turing Machines ... 0 0 1 1 2 3 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R3 1L3 0R4 0 1 1 0 ... 1 0R2 1R2 1L3 72 Turing Machines 0 Sym Sys 100: Turing Machines and Computability, Part I 0 1 1 1 2 3 ... 0 0R3 1L3 0R4 1 1 1 0 ... 1 0R2 1R2 1L3 73 Turing Machines ... 0 0 1 1 2 3 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R3 1L3 0R4 1 1 1 0 ... 1 0R2 1R2 1L3 74 Turing Machines ... 0 0 1 1 2 3 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R3 1L3 0R4 1 1 1 0 ... 1 0R2 1R2 1L3 75 Turing Machines 0 Sym Sys 100: Turing Machines and Computability, Part I 0 1 1 1 2 3 ... 0 0R3 1L3 0R4 1 1 1 0 ... 1 0R2 1R2 1L3 76 Turing Machines ￿ It is always important to ensure the machine works on borderline cases, e.g. input 0. ￿ How does the previous machine work on 0 + 2, for example? Sym Sys 100: Turing Machines and Computability, Part I 77 Turing Machines ... 0 0 0 1 2 3 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R3 1L3 0R4 1 0 0 0 ... 1 0R2 1R2 1L3 78 Turing Machines ... 0 0 0 1 2 3 Sym Sys 100: Turing Machines and Computability, Part I 1 0 0R3 1L3 0R4 1 0 0 0 ... 1 0R2 1R2 1L3 79 Turing Machines 0 Sym Sys 100: Turing Machines and Computability, Part I 0 0 1 1 2 3 ... 0 0R3 1L3 0R4 1 0 0 0 ... 1 0R2 1R2 1L3 80 Turing Machines ￿ Given Turing machine programs for computing various functions, we can also compose them, simply by putting one set of instructions on top of another. Sym Sys 100: Turing Machines and Computability, Part I 81 Turing Machines ￿ Given Turing machine programs for computing various functions, we can also compose them, simply by putting one set of instructions on top of another. ￿ For example, (x + y ) + 1 will be computed by: 1 2 3 4 5 Sym Sys 100: Turing Machines and Computability, Part I 0 0R3 1L3 0R4 1L5 0R6 1 0R2 1R2 1L3 1L4 – 81 Turing Machines ￿ How strong, in fact, are these machines? Sym Sys 100: Turing Machines and Computability, Part I 82 Turing Machines ￿ How strong, in fact, are these machines? ￿ Would we gain computing power by adding another tape? Sym Sys 100: Turing Machines and Computability, Part I 82 Turing Machines ￿ How strong, in fact, are these machines? ￿ Would we gain computing power by adding another tape? ￿ By adding symbols to our alphabet? Sym Sys 100: Turing Machines and Computability, Part I 82 Turing Machines Coding ￿ In fact, Turing Machines can do much more than compute with natural numbers in unary. Sym Sys 100: Turing Machines and Computability, Part I 83 Turing Machines Coding ￿ ￿ In fact, Turing Machines can do much more than compute with natural numbers in unary. Consider, for example, strings corresponding to the rules of Turing Machines themselves. How could we represent, e.g. 0R1, in terms of only 0’s and 1’s? Sym Sys 100: Turing Machines and Computability, Part I 83 Turing Machines Coding ￿ ￿ ￿ In fact, Turing Machines can do much more than compute with natural numbers in unary. Consider, for example, strings corresponding to the rules of Turing Machines themselves. How could we represent, e.g. 0R1, in terms of only 0’s and 1’s? Consider the following rewriting rules for strings of this form: 0 → 00 1 → 10 L → 110 R → 1110 And let us separate rules by 1111. Sym Sys 100: Turing Machines and Computability, Part I 83 Turing Machines Coding ￿ ￿ ￿ In fact, Turing Machines can do much more than compute with natural numbers in unary. Consider, for example, strings corresponding to the rules of Turing Machines themselves. How could we represent, e.g. 0R1, in terms of only 0’s and 1’s? Consider the following rewriting rules for strings of this form: 0 → 00 1 → 10 L → 110 R → 1110 ￿ And let us separate rules by 1111. Then we could represent the following rules by 0’s and 1’s: 0 1 1 1L2 1R1 2 0R0 1L2 Sym Sys 100: Turing Machines and Computability, Part I 83 Turing Machines Coding ￿ ￿ ￿ In fact, Turing Machines can do much more than compute with natural numbers in unary. Consider, for example, strings corresponding to the rules of Turing Machines themselves. How could we represent, e.g. 0R1, in terms of only 0’s and 1’s? Consider the following rewriting rules for strings of this form: 0 → 00 1 → 10 L → 110 R → 1110 ￿ And let us separate rules by 1111. Then we could represent the following rules by 0’s and 1’s: 0 1 1 1L2 1R1 2 0R0 1L2 Becomes: 1011010101111101110101111001110001111101101010 Sym Sys 100: Turing Machines and Computability, Part I 83 Turing Machines Universal Turing Machines ￿ Using clever coding tricks, Turing was able to construct a Universal Machine, which takes as input (the code of) a Turing Machine M and an input x appropriate to M , and gives as output the result of running machine M on input x . Sym Sys 100: Turing Machines and Computability, Part I 84 Turing Machines Universal Turing Machines ￿ Using clever coding tricks, Turing was able to construct a Universal Machine, which takes as input (the code of) a Turing Machine M and an input x appropriate to M , and gives as output the result of running machine M on input x . ￿ The universal machine thus simulates any machine on any input. Sym Sys 100: Turing Machines and Computability, Part I 84 Turing Machines Universal Turing Machines ￿ Using clever coding tricks, Turing was able to construct a Universal Machine, which takes as input (the code of) a Turing Machine M and an input x appropriate to M , and gives as output the result of running machine M on input x . ￿ The universal machine thus simulates any machine on any input. ￿ Ask me after class or during office hours if you want to discuss the details. Sym Sys 100: Turing Machines and Computability, Part I 84 Turing Machines ￿ After working more and more with Turing Machines, one gets the sense that they can compute any purely mechanical, rote procedure. Is that true? Sym Sys 100: Turing Machines and Computability, Part I 85 Computability and Incomputability The Church-Turing Thesis Any function on the natural numbers that can be computed in a finite amount of time by a reliable and completely mechanical procedure, can be computed by some Turing Machine. Sym Sys 100: Turing Machines and Computability, Part I 86 Computability and Incomputability The Church-Turing Thesis Any function on the natural numbers that can be computed in a finite amount of time by a reliable and completely mechanical procedure, can be computed by some Turing Machine. ￿ Together with the assumption that any Turing Machine computable function is computable in the intuitive sense, Turing Machines offer a definition for what it is to be effectively computable. Sym Sys 100: Turing Machines and Computability, Part I 86 Computability and Incomputability The Church-Turing Thesis Any function on the natural numbers that can be computed in a finite amount of time by a reliable and completely mechanical procedure, can be computed by some Turing Machine. ￿ ￿ Together with the assumption that any Turing Machine computable function is computable in the intuitive sense, Turing Machines offer a definition for what it is to be effectively computable. The thesis itself is not exactly a theorem that can be proven, but there is much evidence in its favor: Sym Sys 100: Turing Machines and Computability, Part I 86 Computability and Incomputability The Church-Turing Thesis Any function on the natural numbers that can be computed in a finite amount of time by a reliable and completely mechanical procedure, can be computed by some Turing Machine. ￿ ￿ Together with the assumption that any Turing Machine computable function is computable in the intuitive sense, Turing Machines offer a definition for what it is to be effectively computable. The thesis itself is not exactly a theorem that can be proven, but there is much evidence in its favor: • There are no known (agreed upon) counterexamples; Sym Sys 100: Turing Machines and Computability, Part I 86 Computability and Incomputability The Church-Turing Thesis Any function on the natural numbers that can be computed in a finite amount of time by a reliable and completely mechanical procedure, can be computed by some Turing Machine. ￿ ￿ Together with the assumption that any Turing Machine computable function is computable in the intuitive sense, Turing Machines offer a definition for what it is to be effectively computable. The thesis itself is not exactly a theorem that can be proven, but there is much evidence in its favor: • There are no known (agreed upon) counterexamples; • Turing Machine computability coincides with many other formal codifications of the notion, such as Church’s λ-calculus, recursive functions, cellular automata, and so on. Sym Sys 100: Turing Machines and Computability, Part I 86 Computability and Incomputability The Church-Turing Thesis Any function on the natural numbers that can be computed in a finite amount of time by a reliable and completely mechanical procedure, can be computed by some Turing Machine. ￿ ￿ Together with the assumption that any Turing Machine computable function is computable in the intuitive sense, Turing Machines offer a definition for what it is to be effectively computable. The thesis itself is not exactly a theorem that can be proven, but there is much evidence in its favor: • There are no known (agreed upon) counterexamples; • Turing Machine computability coincides with many other formal codifications of the notion, such as Church’s -calculus, recursive functions, cellular automata, and so on. ￿ The thesis says nothing about what physical objects – brains, supercomputers, etc., ... – could actually compute. There is much controversy surrounding these additional questions. Sym Sys 100: Turing Machines and Computability, Part I 86 Computability and Incomputability ￿ Now that we have a working definition for what is computable, can we imagine well defined problems which are in principle incomputable? Are all problems like the GCD problem? Sym Sys 100: Turing Machines and Computability, Part I 87 Computability and Incomputability ￿ Now that we have a working definition for what is computable, can we imagine well defined problems which are in principle incomputable? Are all problems like the GCD problem? ￿ How would we prove a function or problem was incomputable? Sym Sys 100: Turing Machines and Computability, Part I 87 Computability and Incomputability Quotation from the German mathematician David Hilbert in 1900: Is the axiom of the solvability of every problem a peculiar characteristic of mathematical thought alone, or is it possibly a general law inherent in the nature of the mind, that all questions which it asks must be answerable?... This conviction of the solvability of every mathematical problem is a powerful incentive to the worker. We hear within us the perpetual call: There is the problem. Seek its solution. You can find it by pure reason, for in mathematics there is no ignorabimus. C.f. Hilbert’s famous Entscheidungsproblem. Sym Sys 100: Turing Machines and Computability, Part I 88 Computability and Incomputability ￿ In fact, Turing’s central motivation in defining his machines was to show that Hilbert’s Entscheidungsproblem had a negative answer. Sym Sys 100: Turing Machines and Computability, Part I 89 Computability and Incomputability ￿ In fact, Turing’s central motivation in defining his machines was to show that Hilbert’s Entscheidungsproblem had a negative answer. ￿ After Turing’s original work, incomputable problems began to appear everywhere. See, for example, the Busy Beaver problem in the reading. Sym Sys 100: Turing Machines and Computability, Part I 89 Computability and Incomputability ￿ In fact, Turing’s central motivation in defining his machines was to show that Hilbert’s Entscheidungsproblem had a negative answer. ￿ After Turing’s original work, incomputable problems began to appear everywhere. See, for example, the Busy Beaver problem in the reading. ￿ Turing’s first example, called the Halting Problem, was inspired by deep ideas about self-reference and a technique called “diagonalization”. Sym Sys 100: Turing Machines and Computability, Part I 89 Computability and Incomputability ￿ Determine once and for all an infinite list of all the machines: M1 , M2 , M3 , ... Sym Sys 100: Turing Machines and Computability, Part I 90 Computability and Incomputability ￿ Determine once and for all an infinite list of all the machines: M1 , M2 , M3 , ... ￿ The codes give an infinite, but well defined, list of numbers: ￿M1 ￿, ￿M2 ￿, ￿M3 ￿, ... Sym Sys 100: Turing Machines and Computability, Part I 90 Computability and Incomputability ￿ Determine once and for all an infinite list of all the machines: M1 , M2 , M3 , ... ￿ The codes give an infinite, but well defined, list of numbers: ￿M1 ￿, ￿M2 ￿, ￿M3 ￿, ... ￿ Notice that for some machines Mn and some inputs x , Mn will loop indefinitely and never halt on input x . Sym Sys 100: Turing Machines and Computability, Part I 90 Computability and Incomputability ￿ Determine once and for all an infinite list of all the machines: M1 , M2 , M3 , ... ￿ The codes give an infinite, but well defined, list of numbers: ￿M1 ￿, ￿M2 ￿, ￿M3 ￿, ... ￿ Notice that for some machines Mn and some inputs x , Mn will loop indefinitely and never halt on input x . For example, this machine never halts on any input: 0 1 1 0R1 1R1 Sym Sys 100: Turing Machines and Computability, Part I 90 Computability and Incomputability ￿ Consider the following question about natural numbers, analogous to the GCD problem. This is called the Halting Problem: Given some machine Mi , does Mi halt on its own code ￿Mi ￿ when given as input? Sym Sys 100: Turing Machines and Computability, Part I 91 Computability and Incomputability ￿ Consider the following question about natural numbers, analogous to the GCD problem. This is called the Halting Problem: Given some machine Mi , does Mi halt on its own code ￿Mi ￿ when given as input? ￿ There is a function f that, when given ￿Mi ￿ as input, gives output 1 if Mi halts on ￿Mi ￿ and 0 if it does not halt. Sym Sys 100: Turing Machines and Computability, Part I 91 Computability and Incomputability ￿ Consider the following question about natural numbers, analogous to the GCD problem. This is called the Halting Problem: Given some machine Mi , does Mi halt on its own code ￿Mi ￿ when given as input? ￿ There is a function f that, when given ￿Mi ￿ as input, gives output 1 if Mi halts on ￿Mi ￿ and 0 if it does not halt. ￿ Is f computable? Sym Sys 100: Turing Machines and Computability, Part I 91 Computability and Incomputability ￿ Consider the following question about natural numbers, analogous to the GCD problem. This is called the Halting Problem: Given some machine Mi , does Mi halt on its own code ￿Mi ￿ when given as input? ￿ There is a function f that, when given ￿Mi ￿ as input, gives output 1 if Mi halts on ￿Mi ￿ and 0 if it does not halt. ￿ Is f computable? ￿ Suppose it is. Then we can use the Church-Turing Thesis to guarantee there is some Mp on our list of machines that computes f . Sym Sys 100: Turing Machines and Computability, Part I 91 Computability and Incomputability ￿ Consider the following question about natural numbers, analogous to the GCD problem. This is called the Halting Problem: Given some machine Mi , does Mi halt on its own code ￿Mi ￿ when given as input? ￿ There is a function f that, when given ￿Mi ￿ as input, gives output 1 if Mi halts on ￿Mi ￿ and 0 if it does not halt. ￿ Is f computable? ￿ Suppose it is. Then we can use the Church-Turing Thesis to guarantee there is some Mp on our list of machines that computes f . Mp takes some number ￿Mi ￿, and halts with 1 as output if Mi halts on ￿Mi ￿, and halts with 0 as output if Mi does not halt on ￿Mi ￿. Sym Sys 100: Turing Machines and Computability, Part I 91 Computability and Incomputability ￿ Consider the following question about natural numbers, analogous to the GCD problem. This is called the Halting Problem: Given some machine Mi , does Mi halt on its own code ￿Mi ￿ when given as input? ￿ There is a function f that, when given ￿Mi ￿ as input, gives output 1 if Mi halts on ￿Mi ￿ and 0 if it does not halt. ￿ Is f computable? ￿ Suppose it is. Then we can use the Church-Turing Thesis to guarantee there is some Mp on our list of machines that computes f . Mp takes some number ￿Mi ￿, and halts with 1 as output if Mi halts on ￿Mi ￿, and halts with 0 as output if Mi does not halt on ￿Mi ￿. ￿ Let us then compose Mp with a machine that loops indefinitely on input 1, and halts on any other input (say, with the input unchanged). Call this machine Mh . It clearly exists, if Mp does. Sym Sys 100: Turing Machines and Computability, Part I 91 Computability and Incomputability ￿ Hence, we have a machine Mh that takes input ￿Mi ￿ and loops if Mi halts on ￿Mi ￿, and halts otherwise. Sym Sys 100: Turing Machines and Computability, Part I 92 Computability and Incomputability ￿ Hence, we have a machine Mh that takes input ￿Mi ￿ and loops if Mi halts on ￿Mi ￿, and halts otherwise. ￿ Question: What does Mh do on its own input ￿Mh ￿? Sym Sys 100: Turing Machines and Computability, Part I 92 Computability and Incomputability ￿ Hence, we have a machine Mh that takes input ￿Mi ￿ and loops if Mi halts on ￿Mi ￿, and halts otherwise. ￿ Question: What does Mh do on its own input ￿Mh ￿? Two cases: 1. If Mh halts on ￿Mh ￿, then by stipulation the machine coded by ￿Mh ￿ must not halt on its own input. But that just is the machine Mh , which we just assumed does halt on its own input. Thus Mh cannot halt on ￿Mh ￿. Sym Sys 100: Turing Machines and Computability, Part I 92 Computability and Incomputability ￿ Hence, we have a machine Mh that takes input ￿Mi ￿ and loops if Mi halts on ￿Mi ￿, and halts otherwise. ￿ Question: What does Mh do on its own input ￿Mh ￿? Two cases: 1. If Mh halts on ￿Mh ￿, then by stipulation the machine coded by ￿Mh ￿ must not halt on its own input. But that just is the machine Mh , which we just assumed does halt on its own input. Thus Mh cannot halt on ￿Mh ￿. 2. If Mh does not halt on ￿Mh ￿, then again, since the machine coded by ￿Mh ￿ does not halt on its own input, Mh should halt on this input, which we supposed was not the case. Sym Sys 100: Turing Machines and Computability, Part I 92 Computability and Incomputability ￿ Hence, we have a machine Mh that takes input ￿Mi ￿ and loops if Mi halts on ￿Mi ￿, and halts otherwise. ￿ Question: What does Mh do on its own input ￿Mh ￿? Two cases: 1. If Mh halts on ￿Mh ￿, then by stipulation the machine coded by ￿Mh ￿ must not halt on its own input. But that just is the machine Mh , which we just assumed does halt on its own input. Thus Mh cannot halt on ￿Mh ￿. 2. If Mh does not halt on ￿Mh ￿, then again, since the machine coded by ￿Mh ￿ does not halt on its own input, Mh should halt on this input, which we supposed was not the case. ￿ Apparently, the supposition that there is a Turing Machine that solves the Halting Problem leads to the absurd conclusion that Mh halts on its own input, if and only if it does not halt on its own input. Sym Sys 100: Turing Machines and Computability, Part I 92 Computability and Incomputability ￿ Hence, we have a machine Mh that takes input ￿Mi ￿ and loops if Mi halts on ￿Mi ￿, and halts otherwise. ￿ Question: What does Mh do on its own input ￿Mh ￿? Two cases: 1. If Mh halts on ￿Mh ￿, then by stipulation the machine coded by ￿Mh ￿ must not halt on its own input. But that just is the machine Mh , which we just assumed does halt on its own input. Thus Mh cannot halt on ￿Mh ￿. 2. If Mh does not halt on ￿Mh ￿, then again, since the machine coded by ￿Mh ￿ does not halt on its own input, Mh should halt on this input, which we supposed was not the case. ￿ Apparently, the supposition that there is a Turing Machine that solves the Halting Problem leads to the absurd conclusion that Mh halts on its own input, if and only if it does not halt on its own input. ￿ Thus, assuming Turing Machine computability just is the same thing as computability, we have identified an incomputable problem. Sym Sys 100: Turing Machines and Computability, Part I 92 Summary ￿ Today’s lecture was largely theoretical, focusing on the very idea of computability. Sym Sys 100: Turing Machines and Computability, Part I 93 Summary ￿ Today’s lecture was largely theoretical, focusing on the very idea of computability. ￿ You will not be accountable for the details of incomputability, etc. But you should have a good facility with simple Turing Machines. (You will get more practice in sections.) Sym Sys 100: Turing Machines and Computability, Part I 93 Summary ￿ Today’s lecture was largely theoretical, focusing on the very idea of computability. ￿ You will not be accountable for the details of incomputability, etc. But you should have a good facility with simple Turing Machines. (You will get more practice in sections.) For a helpful applet, see the following website: http://www-cs-faculty.stanford.edu/∼eroberts//applets/TuringMachine/ Sym Sys 100: Turing Machines and Computability, Part I 93 Summary ￿ Today’s lecture was largely theoretical, focusing on the very idea of computability. ￿ You will not be accountable for the details of incomputability, etc. But you should have a good facility with simple Turing Machines. (You will get more practice in sections.) For a helpful applet, see the following website: http://www-cs-faculty.stanford.edu/∼eroberts//applets/TuringMachine/ ￿ Turing Machine computability is a central notion in Information Sciences, and underlies many important areas, including computational complexity theory, programming language theory, Kolmogorov complexity theory, and many others. Sym Sys 100: Turing Machines and Computability, Part I 93 Summary ￿ Today’s lecture was largely theoretical, focusing on the very idea of computability. ￿ You will not be accountable for the details of incomputability, etc. But you should have a good facility with simple Turing Machines. (You will get more practice in sections.) For a helpful applet, see the following website: http://www-cs-faculty.stanford.edu/∼eroberts//applets/TuringMachine/ ￿ Turing Machine computability is a central notion in Information Sciences, and underlies many important areas, including computational complexity theory, programming language theory, Kolmogorov complexity theory, and many others. ￿ Next time we will continue this topic, and also ask what, if anything, this very general notion of computability might have to do with cognition and the mind. Sym Sys 100: Turing Machines and Computability, Part I 93 ...
View Full Document

This document was uploaded on 05/28/2011.

Ask a homework question - tutors are online