Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to wrap my head around relativization in non-Turing machine settings (for example, what is the "natural" relativized version of Graph Isomorphism to an oracle A?).

So I went to Wikipedia to look up relativization, and it gave me the standard oracle machine definition -- a Turing machine, with a work tape and an oracle tape containing the characteristic function of your oracle set A. Each timestep it will read a symbol off of each tape, write a symbol on the work tape, then move left/right on each tape separately (and change states). Then it starts talking about relativized versions of complexity classes, specifically mentioning P^{SAT}.

Here is my problem with their definition: You now pass your oracle Turing machine an instance of SAT of "size" n and ask it if it has a solution. The machine computes some canonical encoding of this instance as an integer M, and looks up M in the oracle tape. If the oracle tape has a 1 in space M, the instance is satisfiable. If not, it is not. However! The number of SAT instances of size n grows exponentially as a function of n, so M is of exponential size and getting to location M on the oracle tape takes exponential time.

So if one uses the naive algorithm for the SAT oracle machine, one finds that solving SAT takes exponential time, and SAT is not in P^{SAT}!!!

What am I missing?

share|cite|improve this question
The source of the confusion is that complexity theorists have to be more careful with I/O conventions that computability theorists. In classical computability theory, efficiency isn't a consideration, which leads to robustness against many variations in the definitions. In complexity theory, small changes in the input/output conventions can turn a P-time function into a non-P-time function or vice-versa. So one has to be careful about using computability sources when studying complexity. The Wikipedia article shows what can happen from mixing the fields by using definitions out of context. – Carl Mummert Sep 1 '11 at 21:02
up vote 4 down vote accepted

Let's go to a more reliable source than Wikipedia: the first edition of Sipser's Introduction to the Theory of Computation. I quote directly from definition 9.16 on page 318:

An oracle is a language A. An oracle Turing machine $M^{A}$ is an ordinary Turing machine with an extra tape called the oracle tape. Whenever M writes a string on the oracle tape it is informed whether that string is a member of A, in a single computation step.

Note that the stipulation of the single computation step is a critical part of the definition. We can use this definition to answer your question. Let's say we have a Turing machine M with an oracle for SAT. We can use it to show that SAT is in $P^{SAT}$ as follows:

  1. We start with the input for the SAT instance already on M.
  2. Copy the input onto the oracle tape. This takes $O(n)$ time, where $n$ is the length of the input.
  3. M is informed of the result. This takes 1 step, by the definition above.
  4. M returns this result as its answer. This takes $O(1)$ time.

So the total time is linear, which is still polynomial time. So SAT is indeed in $P^{SAT}$.

share|cite|improve this answer
Thank you. So the definition in Wikipedia is flat-out wrong? I have a followup question (related to the non-TM setting version of oracles), but I'll make that separate. – Craig Sep 1 '11 at 18:19
@Craig, I have merged your duplicate account into your current account. If you have trouble logging in, or if you accidentally create duplicate accounts, simply flag one of your own questions for moderator attention, and we will help out. – Zev Chonoles Sep 1 '11 at 19:07
@Craig, yes, I'm forced to conclude that the Wikipedia definition is indeed wrong. In particular, it refers to the oracle head reading the oracle tape one character at a time in the phrase "...the oracle head moves one cell in direction...". In my reading, this is inconsistent with the Sipser definition where the oracle tape is read, evaluated, and marked with the answer all in one step. As for your follow-up question, I'd be happy to look at it; let me know somehow, like the at-sign mechanism (I'm no expert on using these StackExchange sites). – ShyPerson Sep 1 '11 at 19:29
@ShyPerson: The definition on Wikipedia is the definition from Soare's textbook on computability theory, which is not the same as the definition in Sipser's book. The Wikipedia article should probably note the alternate definition, but the definition it has isn't wrong, it's just not the definition that would be used in complexity theory. – Carl Mummert Sep 1 '11 at 20:47
@Carl: Many thanks for the clarification! – ShyPerson Sep 2 '11 at 4:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.