turing machine
turing machines (TM) are named after Alan Turing, who invented them in 1936. turing machines can compute any function normally considered computable; in fact, it is quite reasonable to define computable to mean computable by a TM.
we describe here a deterministic, one-tape Turing machine. this is the standard off-the-shelf model. there are many variations, apparently more powerful or less powerful but in reality not.
a TM has a finite set of states
, a semi-infinite tape that is delimited on the left end by an endmarker
and is infinite to the right, and a head that can move left and right over the tape, reading and writing symbols.
the input string is of finite length and is initially written on the tape in contiguous tape cells snug up against the left endmarker. the infinitely many cells to the right of the input all contain a special blank symbol
.
the machine starts in its start state
with its head scanning the left endmarker. in each step it reads the symbol on the tape under its head. depending on that symbol and the current state, it writes a new symbol on that tape cell, moves its head either left or right one cell, and enters a new state. the action it takes in each situation is determined by a transition function
. it accepts its input by entering a special accept state
and rejects by entering a special reject state
. on some inputs it may run infinitely without ever accepting or rejecting, in which case it is said to loop on that input.
means, "when in state
scanning symbol
, write
on that tape cell, move the head in direction
, and enter state
." the symbols
and
stand for left and right, respectively.
we restrict TMs so that the left endmarker is never overwritten with another symbol and the machine never moves off the tape to the left of the endmarker; that is, we require that for all
there exists
such that
we also require that once the machine enters its accept state, it never leaves it, and similarly for its reject state; that is, for all
there exist
and
such that
we sometimes refer to the state set and transition function collectively as the finite control.
[cite:;taken from @kozen_automata_1997 lecture 28 turing machines and effective computability]
we describe here a deterministic, one-tape Turing machine. this is the standard off-the-shelf model. there are many variations, apparently more powerful or less powerful but in reality not.
a TM has a finite set of states
the input string is of finite length and is initially written on the tape in contiguous tape cells snug up against the left endmarker. the infinitely many cells to the right of the input all contain a special blank symbol
the machine starts in its start state
a deterministic one-tape turing machine is a 9-tuple
where
intuitively, is a finite set (the states);
is a finite set (the input alphabet);
is a finite set (the tape alphabet) containing
as a subset;
, the blank symbol;
, the left endmarker;
, the transition function;
, the start state;
, the accept state; and
, the reject state;
.
we restrict TMs so that the left endmarker is never overwritten with another symbol and the machine never moves off the tape to the left of the endmarker; that is, we require that for all
[cite:;taken from @kozen_automata_1997 lecture 28 turing machines and effective computability]
a turing machine is a kind of idealized typewriter with an infinite tape and a reading head moving back and forth one cell at a time according to a finite state program. in 1936 Turing demonstrated convincingly that this mathematical model captured the informal notion of effectively calculable. turing's model and analysis have been accepted ever since as the most convincing model.
[cite:;taken from @computability_soare_2016 introduction]
[cite:;taken from @computability_soare_2016 introduction]
a Turing machine
includes a two-way infinite tape divided into cells, a reading head which scans one cell of the tape at a time, and a finite set of internal states
. each cell is either blank (B) or has written on it the symbol 1. in a single step the machine may simultaneously: (1) change from one state to another; (2) change the scanned symbol
to another symbol
; and (3) move the reading head one cell to the right (
) or left (
). the operation of
is controlled by a partial map
(which may be undefined for some arguments).
[cite:;taken from @computability_soare_2016 definition 1.4.1]
[cite:;taken from @computability_soare_2016 definition 1.4.1]
we begin with
we may assume that
if the machine
a Turing computation according to Turing program
with input
is a sequence of configurations,
such that
represents the machine in the starting state
reading the leftmost symbol of the input
,
represents the machine in the halting state
, and the transition
, for all
, is given by the Turing program
.
[cite:;taken from @computability_soare_2016 definition 1.4.2]
thus, from now on a computation will always refer to a halting, i.e., convergent, calculation. a partial function of [cite:;taken from @computability_soare_2016 definition 1.4.2]
given
inputs
, we represent these as an input to a Turing machine by writing each as a block of
1's and separating each block by a
.
[cite:;taken from @computability_soare_2016 definition 1.4.3]
[cite:;taken from @computability_soare_2016 chapter 1 defining computability][cite:;taken from @computability_soare_2016 definition 1.4.3]
the first tape of the machine is designated as the input tape. the machine's head can only read symbols from that tape, not write them--a so-called read-only head. the
[cite:;taken from @computability_arora_2009 chapter 1.2 the turing machine]
the only difference between a nondeterministic turing machine (NDTM) and a standard TM is that an NDTM has two transition functions
and
, and a special state denoted by
. when an NDTM
computes a function, we envision that at each computational step
makes an arbitrary choice as to which of its two transition functions to apply. for every input
, we say that
if there exists some sequence of these choices (which we call the nondeterministic choices of
) that would make
reach
on input
. otherwise--if every sequence of choices makes
halt without reaching
--then we say that
. we say that
runs in
time if for every input
and every sequence of nondeterministic choices,
reaches either the halting state or
within
steps.
[cite:;taken from @computability_arora_2009 chapter 2.1.2 nondeterministic turing machines]
[cite:;taken from @computability_arora_2009 chapter 2.1.2 nondeterministic turing machines]
let
be a TM. a configuration of a TM
consists of the contents of all nonblank entries of
's tapes, along with its state and head position, at a particular point in its execution. for every space
TM
and input
, the configuration graph of
on input
, denoted
, is a directed graph whose nodes correspond to all possible configurations of
where the input contains the value
and the work tapes have at most
nonblank cells. the graph has a directed edge from a configuration
to a configuration
if
can be reached from
in one step according to
's transition function. if
is deterministic, then the graph has out-degree one, and if
is nondeterministic, then the graph has out-degree at most two. by modifying
to erase all its work tapes before halting, we can assume that there is only a single configuration
on which
halts and outputs 1. this means that
accepts the input
iff there exists a directed path in
from
to
.
[cite:;taken from @computability_arora_2009 chapter 4.1 definition of space-bounded computation]
[cite:;taken from @computability_arora_2009 chapter 4.1 definition of space-bounded computation]
let
be the configuration graph of a space-
machine
on some input
of length
. then,
- every vertex in
can be described using
bits for some constant
(depending on
's alphabet size and number of tapes) and in particular,
has at most
nodes.
- there is an
-size cnf formula
such that for every two strings
,
if and only if
and
encode two neighboring configurations in