ArticleslgStudy

computer science

Alternating Turing machine

Alternating Turing machine is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Alternating Turing machine rather than just read about it. In short: In computational complexity theory, an alternating Turing machine (ATM) is a non-deterministic Turing machine (NTM) with a rule for accepting computations that generalizes the rules used in the definition of the complexity classes NP and co-NP. The concept of an ATM was set forth by Chandra and Stockmeyer and independently by Kozen in 1976, with a joint journal publication in 1981.

Key takeaways

  • Alternating Turing machine belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Alternating Turing machine to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Alternating Turing machine from memory before moving on to harder problems.

Reference excerpt

In computational complexity theory, an alternating Turing machine (ATM) is a non-deterministic Turing machine (NTM) with a rule for accepting computations that generalizes the rules used in the definition of the complexity classes NP and co-NP. The concept of an ATM was set forth by Chandra and Stockmeyer and independently by Kozen in 1976, with a joint journal publication in 1981.

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×Γ→𝒫(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 𝖠𝖳𝖨𝖬𝖤(t(n)), and a language decided in space c⋅s(n) is said to be in the class 𝖠𝖲𝖯𝖠𝖢𝖤(s(n)).

Example Perhaps the most natural problem for alternating machines to solve is the quantified Boolean formula problem, which is a generalization of the Boolean satisfiability problem in which each variable can be bound by either an existential or a universal quantifier. The alternating machine branches existentially to try all possible values of an existentially quantified variable and universally to try all possible values of a universally quantified variable, in the left-to-right order in which they are bound. After deciding a value for all quantified variables, the machine accepts if the resulting Boolean formula evaluates to true, and rejects if it evaluates to false. Thus, at an existentially quantified variable the machine is accepting if a value can be substituted for the variable that renders the remaining problem satisfiable, and at a universally quantified variable the machine is accepting if any value can be substituted and the remaining problem is satisfiable. Such a machine decides quantified Boolean formulas in time n2 and space n. The Boolean satisfiability problem can be viewed as the special case where all variables are existentially quantified, allowing ordinary nondeterminism, which uses only existential branching, to solve it efficiently.

Complexity classes and comparison to deterministic Turing machines The following complexity classes are useful to define for ATMs:

𝖠𝖯=⋃k>0𝖠𝖳𝖨𝖬𝖤(nk) are the languages decidable in polynomial time 𝖠𝖯𝖲𝖯𝖠𝖢𝖤=⋃k>0𝖠𝖲𝖯𝖠𝖢𝖤(nk) are the languages decidable in polynomial space 𝖠𝖤𝖷𝖯𝖳𝖨𝖬𝖤=⋃k>0𝖠𝖳𝖨𝖬𝖤(2nk) are the languages decidable in exponential time These are similar to the definitions of P, PSPACE, and EXPTIME, considering the resources used by an ATM rather than a deterministic Turing machine. Chandra, Kozen, and Stockmeyer proved that, for all f(n)≥log⁡(n) and g(n)≥log⁡(n):

𝖠𝖲𝖯𝖠𝖢𝖤(f(n))=⋃c>0𝖣𝖳𝖨𝖬𝖤(2cf(n))=𝖣𝖳𝖨𝖬𝖤(2O(f(n))) 𝖠𝖳𝖨𝖬𝖤(g(n))⊆𝖣𝖲𝖯𝖠𝖢𝖤(g(n)) 𝖭𝖲𝖯𝖠𝖢𝖤(g(n))⊆⋃c>0𝖠𝖳𝖨𝖬𝖤(c×g(n)2), In particular:

ALOGSPACE = P AP = PSPACE APSPACE = EXPTIME AEXPTIME = EXPSPACE A more general form of these relationships is expressed by the parallel computation thesis.

Bounded alternation

Definition

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Alternating Turing machine

Start with the simplest possible case. Write down what Alternating Turing machine claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Alternating Turing machine before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Alternating Turing machine ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Alternating Turing machine

In research
Alternating Turing machine appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Alternating Turing machine in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Alternating Turing machine is common in secondary-school and first-year university syllabi. It links to neighbouring topics Models of computation, so understanding it makes those chapters shorter.
In everyday life
Look for Alternating Turing machine outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Alternating Turing machine” →

How to study Alternating Turing machine in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Alternating Turing machine means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Alternating Turing machine out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Alternating Turing machine in simple terms?

In computational complexity theory, an alternating Turing machine (ATM) is a non-deterministic Turing machine (NTM) with a rule for accepting computations that generalizes the rules used in the definition of the complexity classes NP and co-NP. The concept of an ATM was set forth by Chandra and Sto…

Why does Alternating Turing machine matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Alternating Turing machine?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Alternating Turing machine.

Tags

  • Models of computation

Keep exploring