Lably
Skip to content

Alternating Turing machine

  • 6 min read
  • 4 chapters

Related on Lably

Through Tuple

Definitions

Informal description

The definition of NP uses the existential mode of computation: if any choice leads to an accepting state, then the whole computation accepts. The definition of co-NP uses the universal mode of computation: only if all choices lead to an accepting state does the whole computation accept. An alternating Turing machine (or to be more precise, the definition of acceptance for such a machine) alternates between these modes.

An alternating Turing machine is a non-deterministic Turing machine whose states are divided into two sets: existential states and universal states. An existential state is accepting if some transition leads to an accepting state; a universal state is accepting if every transition leads to an accepting state. (Thus a universal state with no transitions accepts unconditionally; an existential state with no transitions rejects unconditionally). The machine as a whole accepts if the initial state is accepting.

Formal definition

Formally, a (one-tape) alternating Turing machine is a 5-tuple M=(Q,Γ,δ,q0,g) where

  • Q is the finite set of states
  • Γ is the finite tape alphabet
  • δ:Q×Γ→P(Q×Γ×{L,R}) is called the transition function (L shifts the head left and R shifts the head right)
  • q0∈Q is the initial state
  • g:Q→{∧,∨,accept,reject} specifies the type of each state

If M is in a state q∈Q with g(q)=accept then that configuration is said to be accepting, and if g(q)=reject the configuration is said to be rejecting. A configuration with g(q)=∧ is said to be accepting if all configurations reachable in one step are accepting, and rejecting if some configuration reachable in one step is rejecting. A configuration with g(q)=∨ is said to be accepting when there exists some configuration reachable in one step that is accepting and rejecting when all configurations reachable in one step are rejecting (this is the type of all states in a classical NTM except the final state). M is said to accept an input string w if the initial configuration of M (the state of M is q0, the head is at the left end of the tape, and the tape contains w) is accepting, and to reject if the initial configuration is rejecting.

Note that it is impossible for a configuration to be both accepting and rejecting, however, some configurations may be neither accepting or rejecting, due to the possibility of nonterminating computations.

Resource bounds

When deciding if a configuration of an ATM is accepting or rejecting using the above definition, it is not always necessary to examine all configurations reachable from the current configuration. In particular, an existential configuration can be labelled as accepting if any successor configuration is found to be accepting, and a universal configuration can be labelled as rejecting if any successor configuration is found to be rejecting.

An ATM decides a formal language in time t(n) if, on any input of length n, examining configurations only up to t(n) steps is sufficient to label the initial configuration as accepting or rejecting. An ATM decides a language in space s(n) if examining configurations that do not modify tape cells beyond the s(n) cell from the left is sufficient.

A language that is decided by some ATM in time c⋅t(n) for some constant c>0 is said to be in the class ATIME(t(n)), and a language decided in space c⋅s(n) is said to be in the class ASPACE(s(n)).

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Topics in mathematics