1.2. Basic Definitions 11
Definition 1.7. An oracle Turing machine M for an oracle ] : ~* -+ ~* is
a (deterministic or nondeterministic) Turing machine that has two more states
qo and qa, and a separate tape called oracle tape. The machine M can write
questions v E ~* to the oracle on the oracle tape and then switch to state %.
Then in one step the word v is erased from the tape, an answer f(v) is written
(~ if no answer exists) and the head of the oracle tape is positioned over the first
letter of f(v). Finally, M switches to the state qa.
We now use this definition to construct an infinite number of complexity classes.
We start by defining how oracle Turing machines can be used to define new
complexity classes based on the definitions of :P and Alp.
Definition 1.8. For a class C of languages we denote by 7a(C) (AfT)(C)) the
class of all languages L, such that there is a language H E C so that there is a
polynomiaUy time bounded (nondeterministic) oracle Turin9 machine M H with
oracle H for L.
Definition 1.9. We define Ao := S0 := II0 := 7 ). For any k E N we define
Ak := 7~(~k--1), ~k := AfT~(Zk_l), II~ := co-~k. The classes Ak, ~k, and IIk
form the polynomial hierarchy PT-/:= Uk>~o ~k. The classes Ai, ~i, and Hi are
said to form the i-th level of 7)7-l.
We note that A1 = P, E1 = AfT•, and H1 = co-AfT ) hold. It is believed though
not proven that no two classes of this hierarchy are equal. On the other hand, if
there is an i such that ~i = H~ holds, then for all j > i one gets ~j = IIj = Aj =
Zi- This event is usually referred to as the collapse of the polynomial hierarchy;
it collapses to the i-th level in this case.
We finally define another variant of Turing machines that allows us to introduce
the concept of randomness.
Definition 1.10. A randomized Turing machine M is defined as a nondeter-
ministic Turing machine such that Vq E Q, a E Z there are at most two different
triples (qt, a', m) with (q, a) • (ql, a ~, m) E 6. I] there are two different triples M
chooses each of them with probability 89 There are three disjoint sets of halting
states A, R, D such that computations of M stop if a state from A U R U D is
reached. If the halting state belongs to A (R), M accepts (rejects) the input. If
the halting state belongs to D then M does not make a decision about the input.
For the randomized Turing machine the computation time is declared in anal-
ogy to the deterministic Turing machine and not in the way it is defined for the
nondeterministic Turing machine. Since the computation time depends on the
random choices it is a random variable. While for deterministic and nondeter-
ministic Turing machines where the classes P and A/'P were the only complexity
classes we defined we will define a number of different complexity classes for
randomized Turing machines which can all be found in the following section.