3

If $B$ is a complexity class, then the class $P^B$ (for example) is defined as the set of problems that can be run in polynomial time, given an oracle to every problem in $B$. That's what they told me in my Theory of Computation class, anyways.

Per this definition, it seems to me that $P^P$ captures every decidable language. Here's why I think that:

Let $M$ be a TM that always halts. On input $x$, construct a new machine $M'$ that: (1) checks to see if the input is equal to $x$, (2) if its input is $x$ then it simulates $M$ on $x$, (3) if its input is not $x$ then it instantly rejects.

This new machine $M'$ runs in $O(n)$ time, so in the class $P^P$, we have an oracle to it. We can now consult this oracle to find out if $M'$ accepts $x$, and we learn in only $O(n)$ time whether or not $M$ accepts $x$. So we have an algorithm that decides $M$ and runs in $TIME(O(n))$, given an oracle to some countable set of problems in $TIME(O(n))$ (e.g. every $M'$, constructed with respect to every possible finite bitstring $x$).

What am I misunderstanding?


Here is an attempt to clarify my confusion.

This is the model that I think we are using:

There are three tapes usable by the Oracle Turing Machine: a standard worktape, an "oracle input tape," and an "oracle machine tape." The OTM can enter a special state where it takes the machine description written on the oracle machine tape, performs a magical 1-step simulation of that machine on input equal to the contents of the oracle input tape, and then writes down a $1$ or a $0$ on the worktape according to the results of the simulation.

Define: A language $L$ is in $P^P$ if there is an OTM that decides L and always halts in $p(n)$ steps on length $n$ input (for some polynomial $p$), and also for every Turing machine description $M$ used by the OTM, there exists a polynomial $q$ such that $M$ halts in $q(n)$ steps on input $M$.

Then my argument is valid, I think: every machine that we write down runs in linear time overall (even though the constant associated with that machine will grow very quickly for increasingly-long inputs).

This wouldn't be a problem if we flipped the quantifiers (i.e. "there exists a polynomial $q(n)$ such that every machine description $M$ used by the OTM halts in $q(n)$ steps). But I'm not sure that still describes $P^P$...

GMB
  • 579
  • 2
  • 11

2 Answers2

4

Either you're misunderstanding what they said, or you're not misunderstanding anything.

If $B$ is a complexity class, then the class $P^B$ is defined as $\bigcup_{L \in B} P^{L}$. (That applies even when $B$ does not have a complete problem.)

If $B$ is a complexity class and $K$ is complete for $B$ under polynomial-time Turing reductions, then $P^B = P^K$.

Proof: If those hypotheses hold then for all languages $L$ in $B$, by using the reduction to simulate oracle queries to $L$, one has $P^L \subseteq P^K$.

Thus, if those hypotheses hold then $P^K \subseteq \bigcup_{L \in B} P^{L} = P^B = \bigcup_{L \in B} P^{L} \subseteq \bigcup_{L \in B} P^{K} = P^K$.

Therefore, if those hypotheses hold then $P^B = P^K$.

Juho
  • 22,554
  • 7
  • 62
  • 115
  • 1
    Alright, I think I see what's going on here. By defining $P^P = \cup_{L \in P} P^L$, we are saying that a problem in $P^P$ needs an oracle TM that only ever gets to call one single $P$ oracle across all its input lengths. This gets around my objection, because it disallows querying a new machine for every input. Is that accurate? – GMB Jun 04 '14 at 22:09
  • Yes. ${}{}{};$ –  Jun 04 '14 at 22:21
3

Let $\mathcal{C}$ be a complexity class. $\mathrm{P}^{\mathcal{C}}$ is usually defined to be the class of problems decidable in polynomial time by a deterministic machine that has an oracle for some $\mathcal{C}$-complete problem $X$. Thus, in particular, $\mathrm{P}^{\mathrm{P}} = \mathrm{P}$: you can only make polynomially many oracle calls and each one of those can be simulated in a polynomial number of steps.

Having an oracle for a single $\mathcal{C}$-complete problem is equivalent to allowing oracles for all problems in $\mathcal{C}$. By definition of completeness, any problem in $\mathcal{C}$ can be reduced in polynomial time to $X$. So, instead of calling the oracle for some problem $Y$, you perform the reduction from $Y$ to $X$ and use the oracle for that.

The reason you seem to have obtained something more powerful is that you've hidden a lot of complexity in your oracle calls. Suppose, for example, that $M$ decides an $\mathrm{EXPTIME}$-complete problem. By the time hierarchy theorem, there is no polynomial-time algorithm that, given $M$ and an input $x$, determines whether $M$ accepts $x$. This means that, when you want to call your oracle for $M(x)$, you don't know whether to call the one that accepts $x$ or the one that rejects it.

If you think in terms of having an oracle for a single complete problem, it's maybe easier to see. You now need to do the reduction yourself: that is, you need to reduce the problem defined by $M$ to your $\mathrm{P}$-complete problem $X$. But this cannot be done by the time hierarchy theorem.

David Richerby
  • 81,689
  • 26
  • 141
  • 235
  • "Having an oracle for a single C-complete problem is equivalent to allowing oracles for all problems in C." -- I don't see that this is true; maybe I explained myself poorly in the OP. For example, it should be possible to "hide" an exponentially increasing amount of work in the oracle call, while still only ever calling machines that run in polynomial time. – GMB Jun 02 '14 at 19:54
  • Perhaps membership in $P^C$ means there is an algorithm that only ever calls an oracle to a single problem in $C$ (as opposed to calling a different oracle for different inputs)? – GMB Jun 02 '14 at 20:00
  • @GMB Let's be a little more concrete and say that $\mathcal{C}$ is EXPTIME and that you have an oracle for every problem in EXPTIME. The oracles allow you to solve any EXPTIME decision problem in a single time step. But, given that saving, your whole computation has to be in polytime. So, in particular, you can't use exponential time to decide which oracle to use. Or, in the model where you have a single EXPTIME-complete oracle, you can't use exponential time to set up its input. – David Richerby Jun 02 '14 at 20:59
  • GMB doesn't "use exponential time to decide which oracle to use." $\hspace{2.25 in}$ See the "Let $M$ ..." paragraph in the OP. $:$ –  Jun 03 '14 at 02:41
  • @RickyDemer The claim in the following paragraph is that $M'$ runs in linear time. There are two possibilities for $M'$: either it rejects everything (call that $M_r$), or it accepts only $x$ (call that one $M_{a,x}$). To simulate $M$ for all inputs, the machine calling the oracle must be able to decide, for all $x$, whether to call the oracle for $M_{a,x}(x)$ or the one for $M_r(x)$. If $M$ decides an EXPTIME-hard problem, you need exponential time to decide which of those two oracles to call. That can't be done by a polynomial time machine. – David Richerby Jun 03 '14 at 07:38
  • (To avoid potential confusion: The definition that I give and think is right agrees with yours on classes for which yours applies, I'm just arguing about the result of using the definition given in the OP.) $:$ How do you get that "the machine calling the oracle must be able to ... or the one for $M_r(x)$."? $:$ As far as I can see, $M'$ is the only thing that needs to simulate $M$. $;;;;$ –  Jun 03 '14 at 08:04
  • @RickyDemer $M'$ is badly named, since its definition depends on $x$. So you need to figure out what $M'$ is. Now, if you only ever need to know $M(x)$ for $x$ in some finite set, you don't need the oracle at all: you can hard-code the answers for the finite set. However, if you need to know $M(x)$ for infinitely many different $x$, you're stuck. Although each individual $M'$ runs in linear time, the constants are different in each case and the growth rate of the constants is the complexity of $M$, which may be strictly super-polynomial. I'll add something about this to my answer later. – David Richerby Jun 03 '14 at 09:37
  • The OP's (and my) point(s) is/are "the growth rate of the constants is" irrelevant, $\hspace{1.44 in}$ since each individual $M'$ decides a problem in $P$. $;$ –  Jun 03 '14 at 10:09
  • @RickyDemer I'll edit my answer later today to explain why the growth rate of the constants is relevant. They'd better be or we have a proof that P is equal to all total functions, including all the uncomputable ones. – David Richerby Jun 03 '14 at 10:57
  • No, we'd at most have a proof that under a non-standard definition of complexity class exponentiation (with respect to which $P$ is not [low](http://en.wikipedia.org/wiki/Low_(complexity) for itself), $P^P$ is equal to all total functions. $;$ –  Jun 03 '14 at 11:01
  • @RickyDemer DavidRicherby Thanks for continuing the debate, I'm sorry I temporarily left the thread. I edited my original post to try and clarify my confusion for this definition of $P^P$. Thanks for all your help on this! – GMB Jun 04 '14 at 22:06