<p>The result can be found in</p>

<ul>
<li>Beigel, R., Gasarch, W. I., Gill, J., and Owings, J.  <a href="http://dx.doi.org/10.1006/inco.1993.1014">Terse, superterse, and verbose sets</a>.  Inform. and Comput. 103 (1993), no. 1, 68–85. </li>
</ul>

<p>Their proof in fact shows that your problem cannot be solved with fewer than $\log_2 n$ queries to <em>any</em> set $X$, let alone to the halting problem itself. For some notation, your problem is sometimes denoted $C_n^K$ or $C_n^{HALT}$ (depending on your favorite notation for the halting problem).</p>

<p>For this and many related results, see also:</p>

<ul>
<li><p><a href="http://www.cs.umd.edu/~gasarch/papers/bdq-survey-tech.pdf">This survey</a> by Gasarch</p></li>
<li><p>The book <a href="http://www.ams.org/mathscinet-getitem?mr=1725425">Bounded Queries in Recursion Theory</a> by Gasarch and Martin.</p></li>
</ul>

CC BY-SA 3.0
2013-03-19T20:25:53.353Z
2013-03-19T20:25:53.353Z
Joshua Grochow
<p>EDIT:  The argument that I had answered with was not wrong, but it was a bit misleading, in that it only showed that the upper bound had to be tight for <em>some</em> $n$ (which is actually trivial, since it has to be tight when $n=2$ and the bound is 1).</p>

<p>Here is a more precise argument.  It shows that if the upper bound of $\log_2 n$
is loose for any particular $n$, then for <em>all</em> $n$ the number of oracle calls
required is $O(1)$.</p>

<p>(Surely it is <em>not</em> $O(1)$, so the upper bound is never loose!  But I don't actually prove that here, and given the other answer to the problem, it doesn't seem worth pursuing.)</p>

<p>Consider the problem of <em>computing the maximum output</em>:</p>

<blockquote>
  <p>Given an $n$-tuple $(M_1,\ldots,M_n)$ of Turing machines, 
  compute the maximum output (of the Turing machines that halt, if run on $\epsilon$).
  If none of them halt, return 0.</p>
</blockquote>

<p>As a function of $n$, the worst-case number of oracle calls required to compute this function is the same as the number required to decide which of $n$ given machines halt.  (If I know which machines halt, I can easily compute the maximum output.
Conversely, if I want to know which machines halt, 
following the construction in the problem statement,
I can construct machines $\{M'_i\}$ $(i=1,2,\ldots,n)$
where $M'_i$ runs all of the $n$ given machines in parallel, 
then halts and output $i$ if $i$ of them ever halt.
The maximum output will tell me the number that halt.
From that I can compute exactly which halt.)</p>

<p>Now, let $n_0$ be the smallest integer $n$ (if any) such that the following holds:</p>

<blockquote>
  <p>Using $C(n) = \max\{k \in \mathbb{Z} : 2^k &lt; n\}$ oracle calls, one can compute the maximum output of $n$ given machines.
  (That is, the upper bound is not tight for $n$.)</p>
</blockquote>

<p>Clearly $n_0&gt;1$, because $C(1) = -1$.  In fact, $n_0&gt;2$ also, because $C(2) = 0$, 
but it is undecidable to compute the maximum output of $2$ given machines
(with no oracle calls).  Now consider larger $n$:</p>

<p><strong>Claim:</strong> <em>If $n_0$ is finite, then, for any $n$, one can compute the maximum output of $n$ given machines in $C(n_0)$ oracle calls.</em> (Note that if $n_0$ is finite, then $C(n_0) = O(1)$.)</p>

<p><em>Proof.</em>.  We prove it by induction on $n$.  The base cases are $n\le n_0$, which hold by definition of $n_0$ and $C$.</p>

<p>Let $Q_0$ be the TM that, given any $n_0$ Turing machines, computes the maximum output 
using only $C(n_0)$ calls to the oracle.</p>

<p>Fix any $n&gt;n_0$. Given any $n$ machines $M_1,\ldots, M_n$, compute the maximum output as follows.</p>

<p>Focus on the first  $M_1,\ldots,M_{n_0}$ machines.
Consider running $Q_0$ on these $n_0$ machines.
Note that $Q_0$ makes $C(n_0)$ calls to the oracle,
and there are only $n' = 2^{C(n_0)}$ possible responses
by the oracle to these calls.  Note that by definition $n' = 2^{C(n_0)} &lt; n_0$.
Let $o_i$ denote the $i$th possible response.
For each $i=1,\ldots,n'$, construct a machine $M'_i$ 
that simulates $Q_0$ on these machines as follows:</p>

<blockquote>
  <p>TM $M'_i$ (on input $\epsilon$):</p>
  
  <ol>
  <li>Simulate $Q_0$ on the $n_0$ machines $(M_1,\ldots,M_{n_0})$, but instead of calling the oracle, assume the oracle responds according to $o_i$.</li>
  <li>This simulation might not halt (e.g. if $o_i$ is not what the oracle would actually return).</li>
  <li>If the simulation halts, let $h_i$ be the maximum output that $Q_0$ says would be given.</li>
  <li>Dovetail all $n_0$ machines $(M_1,\ldots,M_{n_0})$.  If one of them ever outputs $h_i$, stop and output $h_i$.</li>
  </ol>
</blockquote>

<p>Now, in the given sequence of $n$ machines, replace the first $n_0$ machines $M_1,\ldots,M_{n_0}$ by these $n'&lt; n_0$ machines $M'_1,\ldots,M'_{n'}$.
Return the value computed by recursing on this sequence of $n-(n_0-n') &lt; n$ machines.
(Note that the oracle is not called before recursing, so that the oracle is only called once the base case is reached.)</p>

<p>Here is why this computation is correct.
For the $i$ such that $o_i$ is the ``correct'' response by the oracle $Q_0$ to the queries, $M'_i$ would halt and give the correct maximum output of the original $n_0$ machines.  Thus, the maximum output of the $n'$ machines $(M'_1,\ldots,M'_{n'})$ 
is at least the maximum output of the $n_0$ machines $(M_1,\ldots,M_{n_0})$.
On the other hand, by step 4, no $M'_i$
can give an output that is larger than the maximum output of $(M_1,\ldots,M_{n_0})$.
Thus, the maximum output of the $n'$ machines $(M'_1,\ldots,M'_{n'})$
equals the maximum output of the $n_0$ machines that they replace. QED</p>

CC BY-SA 3.0
2013-03-19T19:17:15.770Z
2013-03-19T22:21:59.493Z
2013-03-19T22:21:59.493Z
Neal Young
<p>I encountered the following question, which is an easy exercise (spoiler below).</p>

<p>We are given $n$ instances of the halting problem (i.e. TMs $M_1,...,M_n$), and we need to decide exactly which of them halt on $\epsilon$. That is, we need to output $\{i: M_i\text{ halts on }\epsilon\}$. We are given an oracle for the halting problem, but we have to use it a minimal number of times.</p>

<p>It is not hard to show that it can be done with $\log (n+1)$ calls.</p>

<blockquote>
  <p>My question is: can we prove a lower bound? Is there reason to suspect that such a bound will be very hard to find?</p>
</blockquote>

<p>The answer to the question itself (spoiler, hover mouse):</p>

<blockquote class="spoiler">
  <p> Consider the case of $3$ TMs. We can construct a TM $H_2$ that runs $M_1,M_2,M_3$ in 
 parallel, and halts if at least two of them halt (otherwise it gets stuck).
 Similarly, we can construct a TM $H_1$ that halts if at least one of them halts. 
 We can then call the oracle on $H_2$. If it halts, then we can run the machines in 
 parallel, and wait for one to halt. We can then call the oracle on the last one. If the 
 oracle says "no", then we run the oracle on $H_1$. If it halts, then we run the machines 
 until one halts, and it's the only one that halts. If $H_1$ does not halt, then none of 
 them halt. Extending this to $n$ machines is easy.</p>
</blockquote>

<p>The first observation about this question is that it seems impossible to solve using information-theoretic tools, since we crucially rely on our ability to obtain information by running the machines without the oracle. </p>

CC BY-SA 3.0
2013-03-19T18:18:39.643Z
@Kaveh - as Neal Young wrote, we need to compute the exact set of halting machines.
Shaull
<computability><lower-bounds>
Lower bound on number of oracle calls for solving $n$ instances of the halting problem
Shaull
# Lower bound on number of oracle calls for solving $n$ instances of the halting problem

(Asked by: username_0 on 2013-03-19)

I encountered the following question, which is an easy exercise (spoiler below).

We are given $n$ instances of the halting problem (i.e. TMs $M\_1,...,M\_n$), and we need to decide exactly which of them halt on $\epsilon$. That is, we need to output $\{i: M\_i\text{ halts on }\epsilon\}$. We are given an oracle for the halting problem, but we have to use it a minimal number of times.

It is not hard to show that it can be done with $\log (n+1)$ calls.

> My question is: can we prove a lower bound? Is there reason to suspect that such a bound will be very hard to find?

The answer to the question itself (spoiler, hover mouse):

> Consider the case of $3$ TMs. We can construct a TM $H\_2$ that runs $M\_1,M\_2,M\_3$ in
> parallel, and halts if at least two of them halt (otherwise it gets stuck).
> Similarly, we can construct a TM $H\_1$ that halts if at least one of them halts.
> We can then call the oracle on $H\_2$. If it halts, then we can run the machines in
> parallel, and wait for one to halt. We can then call the oracle on the last one. If the
> oracle says "no", then we run the oracle on $H\_1$. If it halts, then we run the machines
> until one halts, and it's the only one that halts. If $H\_1$ does not halt, then none of
> them halt. Extending this to $n$ machines is easy.

The first observation about this question is that it seems impossible to solve using information-theoretic tools, since we crucially rely on our ability to obtain information by running the machines without the oracle.

**Tags:** computability, lower-bounds

> **Comments:**
> **username_0**: @Kaveh - as username_2 wrote, we need to compute the exact set of halting machines.  

---

## 2 answers

### Answer by username_1 on 2013-03-19. Score: 11 | Accepted answer

The result can be found in

* Beigel, R., Gasarch, W. I., Gill, J., and Owings, J. [Terse, superterse, and verbose sets](http://dx.doi.org/10.1006/inco.1993.1014). Inform. and Comput. 103 (1993), no. 1, 68–85.

Their proof in fact shows that your problem cannot be solved with fewer than $\log\_2 n$ queries to *any* set $X$, let alone to the halting problem itself. For some notation, your problem is sometimes denoted $C\_n^K$ or $C\_n^{HALT}$ (depending on your favorite notation for the halting problem).

For this and many related results, see also:

* [This survey](http://www.cs.umd.edu/~gasarch/papers/bdq-survey-tech.pdf) by Gasarch
* The book [Bounded Queries in Recursion Theory](http://www.ams.org/mathscinet-getitem?mr=1725425) by Gasarch and Martin.


---

### Answer by username_2 on 2013-03-19. Score: 10

EDIT: The argument that I had answered with was not wrong, but it was a bit misleading, in that it only showed that the upper bound had to be tight for *some* $n$ (which is actually trivial, since it has to be tight when $n=2$ and the bound is 1).

Here is a more precise argument. It shows that if the upper bound of $\log\_2 n$
is loose for any particular $n$, then for *all* $n$ the number of oracle calls
required is $O(1)$.

(Surely it is *not* $O(1)$, so the upper bound is never loose! But I don't actually prove that here, and given the other answer to the problem, it doesn't seem worth pursuing.)

Consider the problem of *computing the maximum output*:

> Given an $n$-tuple $(M\_1,\ldots,M\_n)$ of Turing machines,
> compute the maximum output (of the Turing machines that halt, if run on $\epsilon$).
> If none of them halt, return 0.

As a function of $n$, the worst-case number of oracle calls required to compute this function is the same as the number required to decide which of $n$ given machines halt. (If I know which machines halt, I can easily compute the maximum output.
Conversely, if I want to know which machines halt,
following the construction in the problem statement,
I can construct machines $\{M'\_i\}$ $(i=1,2,\ldots,n)$
where $M'\_i$ runs all of the $n$ given machines in parallel,
then halts and output $i$ if $i$ of them ever halt.
The maximum output will tell me the number that halt.
From that I can compute exactly which halt.)

Now, let $n\_0$ be the smallest integer $n$ (if any) such that the following holds:

> Using $C(n) = \max\{k \in \mathbb{Z} : 2^k < n\}$ oracle calls, one can compute the maximum output of $n$ given machines.
> (That is, the upper bound is not tight for $n$.)

Clearly $n\_0>1$, because $C(1) = -1$. In fact, $n\_0>2$ also, because $C(2) = 0$,
but it is undecidable to compute the maximum output of $2$ given machines
(with no oracle calls). Now consider larger $n$:

**Claim:** *If $n\_0$ is finite, then, for any $n$, one can compute the maximum output of $n$ given machines in $C(n\_0)$ oracle calls.* (Note that if $n\_0$ is finite, then $C(n\_0) = O(1)$.)

*Proof.*. We prove it by induction on $n$. The base cases are $n\le n\_0$, which hold by definition of $n\_0$ and $C$.

Let $Q\_0$ be the TM that, given any $n\_0$ Turing machines, computes the maximum output
using only $C(n\_0)$ calls to the oracle.

Fix any $n>n\_0$. Given any $n$ machines $M\_1,\ldots, M\_n$, compute the maximum output as follows.

Focus on the first $M\_1,\ldots,M\_{n\_0}$ machines.
Consider running $Q\_0$ on these $n\_0$ machines.
Note that $Q\_0$ makes $C(n\_0)$ calls to the oracle,
and there are only $n' = 2^{C(n\_0)}$ possible responses
by the oracle to these calls. Note that by definition $n' = 2^{C(n\_0)} < n\_0$.
Let $o\_i$ denote the $i$th possible response.
For each $i=1,\ldots,n'$, construct a machine $M'\_i$
that simulates $Q\_0$ on these machines as follows:

> TM $M'\_i$ (on input $\epsilon$):
>
> 1. Simulate $Q\_0$ on the $n\_0$ machines $(M\_1,\ldots,M\_{n\_0})$, but instead of calling the oracle, assume the oracle responds according to $o\_i$.
> 2. This simulation might not halt (e.g. if $o\_i$ is not what the oracle would actually return).
> 3. If the simulation halts, let $h\_i$ be the maximum output that $Q\_0$ says would be given.
> 4. Dovetail all $n\_0$ machines $(M\_1,\ldots,M\_{n\_0})$. If one of them ever outputs $h\_i$, stop and output $h\_i$.

Now, in the given sequence of $n$ machines, replace the first $n\_0$ machines $M\_1,\ldots,M\_{n\_0}$ by these $n'< n\_0$ machines $M'\_1,\ldots,M'\_{n'}$.
Return the value computed by recursing on this sequence of $n-(n\_0-n') < n$ machines.
(Note that the oracle is not called before recursing, so that the oracle is only called once the base case is reached.)

Here is why this computation is correct.
For the $i$ such that $o\_i$ is the ``correct'' response by the oracle $Q\_0$ to the queries, $M'\_i$ would halt and give the correct maximum output of the original $n\_0$ machines. Thus, the maximum output of the $n'$ machines $(M'\_1,\ldots,M'\_{n'})$
is at least the maximum output of the $n\_0$ machines $(M\_1,\ldots,M\_{n\_0})$.
On the other hand, by step 4, no $M'\_i$
can give an output that is larger than the maximum output of $(M\_1,\ldots,M\_{n\_0})$.
Thus, the maximum output of the $n'$ machines $(M'\_1,\ldots,M'\_{n'})$
equals the maximum output of the $n\_0$ machines that they replace. QED


---

