Alternation is a generalization of nondeterminism that has proven to be useful in understanding relationships among complexity classes, simplifying various proofs in complexity theory

Definition: An alternating Turing machine is a nondeterministic Turing machine whose states are divided into universal states and existential states; when we run an alternating Turing machine on an input

  • A universal state is accepting if all of its children are accepting
  • An existential state is accepting if any of its children are accepting
  • The input is accepted if the start node is designated accepting

An alternating Turing machine with only existential states is a classic nondeterministic Turing machine

Definition: is the set of languages decided by an time alternating Time machine, and is the set of languages decided by an space alternating Turing machine

We also define , , and as polynomial time, polynomial space, and logarithmic space respectively

Example:
A tautalogy is a Boolean formula that always evaluates to 1

We can easily decide by universally selecting all assignments to the variables of , requiring all branches to evaluate to 1

Note that this is also in , and any problem in can be easily shown to be in by the same principle

Furthermore, appears to be more powerful than

For example, we can solve , which is thought to not be in or

“On input :

  1. Universally select all formulas that are shorter than
  2. Existentially select an assignment to the variables of
  3. Evaluate both and
  4. Accept if the formulas evaluate to different values, otherwise reject

This should give a clear sense of the expressive power of alternation

Alternation also allows us to establish some fascinating relationships between time and space

Theorem: For , , and for ,

As a result, , , and

We prove this as four individual relations

Lemma: For ,

We convert an alternating time machine to a deterministic machine by simulating a depth-first search on ‘s computation tree to determine which nodes in the tree are accepting

A naive stack (in terms of space) would store one configuration at each level

Instead, we can store only the nondeterministic choice at each level, and simply replay the computation to recover the state

Lemma: For ,

We use the algorithm from the proof of Savitch’s Theorem, running the recursive algorithm with universal branching

The maximum time used on any branch is to write a configuration at each level, and there are levels, so this algorithm runs in alternating time

Lemma: For , we have

The deterministic machine computes a graph of the computation of on , for nodes that use at most space for the appropriate constant

Then the machine repeatedly scans and marks off nodes in this graph
There are nodes in the graph, and scanning the graph that many times still takes time

Lemma: For , we have

We use the tableau setup described here

The tricky thing here is that our alternating machine has very little space to work with, only pointers into a tableau for the deterministic on

We get around this by existentially guessing the contents of the bottom left cell, which tells us if accepts

We verify our guess by existentially guessing the contents of the parents, checking whether their contents fits the transition function, and then universally verifying these guesses recursively

Hence, we never need to store more than a single pointer to a cell in the tableau, so this uses space

Definition: A -alternating Turing machine is an alternating Turing machine that on every input and on every computation branch contains at most runs of universal or existential steps, starting with existential steps

An -alternating Turing machine is similar but starts with universal steps

We define , , , and accordingly

This lets us define a more fine-grained hierarchy within

Definition: The polynomial time hierarchy is the collection of classes and

Definition:

Clearly and
According to the algorithm we wrote out earlier,