# COMS W3261 Computer Science Theory Lecture 13: October 24, 2012 Variants of Turing Machines

## Outline

• Midterm solutions
• Recursive and recursively enumerable languages
• Programming techniques for Turing machines
• Variants of Turing machines

## 1. Recursive and Recusively Enumerable Languages

• A language L is recursively enumerable if L = L(M) for some TM M.
• We sometimes say a language is Turing-recognizable if some TM recognizes it.
• A language is recursive if L = L(M) for some TM M such that
1. If w is in L, then M accepts w.
2. If w is not in L, then M eventually halts never entering an accepting state.
• If L is a recursive language, we say L is decidable.
• If L is not a recursive language, we say L is undecidable.

## 2. Programming Techniques for Turing Machines

• 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.

## 3. Models of Computation Equivalent to Turing Machines

• Many variants of Turing machines have been defined such as:
• Turing machines with a semi-infinite input tape.
• Multitape Turing machines.
• Turing machines with tapes having multiple tracks.
• Nondeterministic Turing machines.
• All these machines are equivalent to our definition of a Turing machine.
• Other universal models of computation:
• Chomsky type 0 grammars. A type 0 grammar is like a context-free grammar (V, T, P, S) except that productions can be of the form α → β where α is a string of nonterminals and terminals with at least one nonterminal and β is any string of nonterminals and nonterminals.
• Lambda calculus.
• Pushdown automata with two or more stacks.
• Two-counter machines.
• Random access machines.
• Most programming languages.
• Real computers with an arbitrary amount of memory.
• Again, all these models are computationally equivalent to our definition of a Turing machine.