Computer Science Theory

Lecture 14: November 7, 2012

Algorithms and the Church-Turing Thesis

- Definition of algorithm
- Programming techniques for Turing machines
- Variants of Turing machines
- The Church-Turing thesis
- The Diagonalization Language
*L*is not RE_{d}

- Surprisingly, there is no universally agreed-upon definition for the term "algorithm". Informally, we can think of an algorithm as a collection of well-defined instructions for carrying out some task.
- In
*The Art of Computer Programming*, Donald Knuth states that an algorithm should have five properties: - Finiteness: An algorithm must always terminate after a finite number of steps.
- Definiteness: Each step of an algorithm must be precisely defined.
- Input: An algorithm has zero or more inputs.
- Output: An algorithm has one or more outputs, quantities which have a specified relation to the inputs.
- Effectiveness: All of the operations to be performed in an algorithm can be done exactly and in a finite length of time.
- In this course we will use a Turing machine that halts on all inputs as the definition of an algorithm. The term decider is sometimes used for such a Turing machine.
- A language
*L*that can be recognized by an algorithm is said to be recursive. - If a language
*L*is recursive, we say*L*is decidable. - If a language
*L*is not recursive, we say*L*is undecidable. - In general, a Turing machine need not halt all inputs. An input on which a Turing machine never halts is not in the language defined by the Turing machine.
- A language
*L*that can be recognized by a Turing machine is said to be recursively enumerable. - The term Turing-recognizable language is sometimes used for a recursively enumerable language.
- Note that a language may be undecidable because it is not recursive but is recursively enumerable or because it is not recursively enumerable.

- Turing machines are exactly as powerful as conventional computers.
- To make the behavior of a Turing machine clearer, we can use the finite-state control of a Turing machine to hold a finite amount of data. One way to do this is to use states with multiple fields, where one field represents a position in the Turing machine program, and the other fields hold data elements. The number of fields in a state is always finite.
- Another way to make the behavior of a Turing machine clearer, is to think of the tape as having several tracks.
- We can also group states into "subroutines". A subroutine has its own start state, and another state which can serve as a "return" state.

- There is no standard definition of a Turing machine. In this course we will use the definition in HMU, which assumes that a TM always halts when it enters an accepting state.
- Some books, such as Sipser, define a TM as having a semi-infinite input tape with one accept state and one reject state. The TM halts if it enters either the accept or reject state. A Sipser-style TM is equivalent to an HMU-style TM in computational capability.
- We can generalize a Turing machine to have multiple tapes. This extension does not add any new computational power to a Turing machine.
- We can allow a Turing machine to be nondeterministic by allowing it to make a choice of moves in a given state on a given tape symbol. This extension does not add any new computational power to a Turing machine.
- A Turing machine with a semi-infinite tape (one that is infinite only to the right) is just as powerful as a regular Turing machine.
- A pushdown automaton with two stacks is just as powerful as a regular Turing machine.
- A two-counter machine is just as powerful as a regular Turing machine.

- A Turing machine can compute a function from an input to an output by reading the input, making a sequence of moves, and then halting, leaving only the output of the function on the tape.
- A recursive function is one that can be computed by a Turing machine that halts on all inputs.
- A partial-recursive function is on that can be computed by a Turing machine that need not halt on all inputs. The output of the function on an input for which the Turing machine does not halt is said to be undefined.
- The Church-Turing thesis says that any general way to compute will allow us to compute only the partial-recursive functions. The Church-Turing thesis is unprovable because there is no precise definition for "any general way to compute."
- An informal way of expressing the Church-Turing thesis is that any function that can be effectively computed can be computed by a Turing machine.

- We can enumerate all binary strings.
- We can enumerate all Turing machines.
- We define L
_{d}, the diagonalization language, as follows: - Let
*w*... be an enumeration of all binary strings._{1}, w_{2}, w_{3}, - Let
*M*... be an enumeration of all Turing machines._{1}, M_{2}, M_{3}, - Let
*L*= {_{d}*w*|_{i}*w*is not in L(_{i}*M*) }._{i} - Theorem:
*L*is not a recursively enumerable language._{d} - Proof:
- Suppose
*L*= L(_{d}*M*) for some TM_{i}*M*._{i} - This gives rise to a contradiction. Consider what
*M*will do on the input_{i}*w*._{i} - If
*M*accepts_{i}*w*, then by definition_{i}*w*cannot be in_{i}*L*._{d} - If
*M*does not accepts_{i}*w*, then by definition_{i}*w*is in_{i}*L*._{d} - Since
*w*can neither be in_{i}*L*nor not be in_{d}*L*, we must conclude there is no Turing machine that can define_{d}*L*._{d}

- HMU: Ch. 8, Sect. 9.1

- Informally describe how a single-tape Turing machine can simulate a two-tape Turing machine.
- Informally describe how a deterministic Turing machine can simulate a nondeterministic Turing machine.
- Informally describe how a pushdown automaton with two stacks can simulate a Turing machine.
- Given a suitable encoding of input strings and Turing machines,
show that
*L*= {*w*|_{i}*w*is not accepted by_{i}*M*_{2i}} is not recursively enumerable.

aho@cs.columbia.edu