<p>Here is a sketch of an attempt at partial separation. I was trying to improve this over the past two weeks into a full answer, but haven't made much progress. Hopefully someone else knows how to extend it.</p>

<p>Let </p>

<p>\[f_{n,m}: \{0,1\}^n \times \{0,1\}^{{m \choose 2}} \rightarrow \{0,1\}\]</p>

<p>So we have a total function on tuples. </p>

<p>$f_{n,m}(x,y)$ returns $1$ if $x = 1^n$ and if $y$ interpreted as the edges of a graph has a clique or independent graph of size $n$. Otherwise, it returns $0$. </p>

<p>Thus if $R_n$ is the $n$-th diagonal Ramsey number then for $m \geq R_n$ and all $y \in \{0,1\}^{{m \choose 2}}$ we have $f(1^n,y) = 1$. Thus, if we can compute $R_n$ on an input of $1^n$ then we don't have to read the bits of $y$ if $m$ is large enough, and the query complexity of the query-optimal algorithm drops to $n$.</p>

<p>However, $R_n$ is harder to compute on an input of $1^n$ than it is to check if a graph given by edges $y$ has a clique of independent set of size $n$ on input $(1^n,y)$. Thus, a time-optimal algorithm can't afford to compute $R_n$. It could, instead use some approximation $\tilde{R}_n &gt; R_n$. For $m &lt; \tilde{R}_n$ a time-optimal algorithm will read at least some bits of $y$.</p>

<p>Thus, for $R_n \leq m &lt; \tilde{R}_n$ the query-optimal algorithm will use more time to make fewer queries than the time-optimal algorithm.</p>

<p>This approach can be made slightly less hand-wavy (or generalized to other Ramsey-like problems) but I think even the more rigorous attempt doesn't fully answer the question.</p>

CC BY-SA 3.0
2011-11-01T16:31:10.910Z
2011-11-01T16:40:05.067Z
2011-11-01T16:40:05.067Z
Artem Kaznatcheev
<p>This is a continuation of an earlier question on the <a href="https://cstheory.stackexchange.com/q/7413/1037">trade off between time and query complexity</a>. By a trade off we consider the following two types of algorithms:</p>

<ol>
<li>The best query algorithm: this algorithm uses the minimal number of queries and then optimizes to reduce total time, while preserving queries (this has query complexity $Q_1$ and time complexity $T_1$).</li>
<li>The best time algorithm: this algorithm uses the minimal amount of time and then optimized to reduce total queries, while preserving time (this has query complexity $Q_2$ and time complexity $T_2$).</li>
</ol>

<p>We saw that for partial functions, we can have arbitrarily large seperations between $T_1$ and $T_2$ and $Q_1$ and $Q_2$. However, this approach only works for partial functions.</p>

<p>For total functions, we can use the approach in <a href="https://cstheory.stackexchange.com/q/7563/1037">this question</a> to show that $T_1 \in O(n!2^n T_2)$ and for queries we can show $Q_2 \in O(2^{Q_1})$. Thus for total functions there seems to be a bound on the total separation. Can we improve it? Or come up with total functions with provable separations?</p>

<p>(We have a potential candidate for a separation in <a href="https://cstheory.stackexchange.com/questions/7413/trade-off-between-time-and-query-complexity/7489#7489">this answer</a> but no provable results)</p>

CC BY-SA 3.0
2011-11-03T20:20:47.663Z
How do you use the fact stated in question 7563 to relate T1 to T2 and Q2 to Q1?  Although I vaguely get the idea, I fail to see the details and in particular I fail to understand why the same approach would not work for partial functions.
Tsuyoshi Ito
CC BY-SA 3.0
2011-11-08T16:04:01.753Z
@TsuyoshiIto It won't work for partial functions, because you won't know which leafs to prune from the decision tree. If you have another algorithm with some running time T3 that decides if a given input is in the domain or not of the partial function, then the approach would work, but you would need $T_2 + T_3$ instead of just $T_3$ as a factor. In other words, in the first approach Robin, Joe, and I used all the magic is hidden in the partial-ness of the function. (Sorry for the slow response)
Artem Kaznatcheev
CC BY-SA 3.0
2011-11-08T16:50:01.803Z
my bad, there is a typo in my above response, it should say "instead of just $T_2$". It would look like $O(n!2^n(T_2 + T_3))$
Artem Kaznatcheev
<cc.complexity-theory><time-complexity><query-complexity>
Trade off between time and query complexity for total functions
Artem Kaznatcheev
# Trade off between time and query complexity for total functions

(Asked by: username_0 on 2011-09-30)

This is a continuation of an earlier question on the [trade off between time and query complexity](https://cstheory.stackexchange.com/q/7413/1037). By a trade off we consider the following two types of algorithms:

1. The best query algorithm: this algorithm uses the minimal number of queries and then optimizes to reduce total time, while preserving queries (this has query complexity $Q\_1$ and time complexity $T\_1$).
2. The best time algorithm: this algorithm uses the minimal amount of time and then optimized to reduce total queries, while preserving time (this has query complexity $Q\_2$ and time complexity $T\_2$).

We saw that for partial functions, we can have arbitrarily large seperations between $T\_1$ and $T\_2$ and $Q\_1$ and $Q\_2$. However, this approach only works for partial functions.

For total functions, we can use the approach in [this question](https://cstheory.stackexchange.com/q/7563/1037) to show that $T\_1 \in O(n!2^n T\_2)$ and for queries we can show $Q\_2 \in O(2^{Q\_1})$. Thus for total functions there seems to be a bound on the total separation. Can we improve it? Or come up with total functions with provable separations?

(We have a potential candidate for a separation in [this answer](https://cstheory.stackexchange.com/questions/7413/trade-off-between-time-and-query-complexity/7489#7489) but no provable results)

**Tags:** cc.complexity-theory, time-complexity, query-complexity
> **Comments:**
> **username_1**: How do you use the fact stated in question 7563 to relate T1 to T2 and Q2 to Q1?  Although I vaguely get the idea, I fail to see the details and in particular I fail to understand why the same approach would not work for partial functions.  
> **username_0**: @TsuyoshiIto It won't work for partial functions, because you won't know which leafs to prune from the decision tree. If you have another algorithm with some running time T3 that decides if a given input is in the domain or not of the partial function, then the approach would work, but you would need $T_2 + T_3$ instead of just $T_3$ as a factor. In other words, in the first approach Robin, Joe, and I used all the magic is hidden in the partial-ness of the function. (Sorry for the slow response)  
> **username_0**: my bad, there is a typo in my above response, it should say "instead of just $T_2$". It would look like $O(n!2^n(T_2 + T_3))$  

---

## 1 answers

### Answer by username_0 on 2011-11-01. Score: 1

Here is a sketch of an attempt at partial separation. I was trying to improve this over the past two weeks into a full answer, but haven't made much progress. Hopefully someone else knows how to extend it.

Let

\[f\_{n,m}: \{0,1\}^n \times \{0,1\}^{{m \choose 2}} \rightarrow \{0,1\}\]

So we have a total function on tuples.

$f\_{n,m}(x,y)$ returns $1$ if $x = 1^n$ and if $y$ interpreted as the edges of a graph has a clique or independent graph of size $n$. Otherwise, it returns $0$.

Thus if $R\_n$ is the $n$-th diagonal Ramsey number then for $m \geq R\_n$ and all $y \in \{0,1\}^{{m \choose 2}}$ we have $f(1^n,y) = 1$. Thus, if we can compute $R\_n$ on an input of $1^n$ then we don't have to read the bits of $y$ if $m$ is large enough, and the query complexity of the query-optimal algorithm drops to $n$.

However, $R\_n$ is harder to compute on an input of $1^n$ than it is to check if a graph given by edges $y$ has a clique of independent set of size $n$ on input $(1^n,y)$. Thus, a time-optimal algorithm can't afford to compute $R\_n$. It could, instead use some approximation $\tilde{R}\_n > R\_n$. For $m < \tilde{R}\_n$ a time-optimal algorithm will read at least some bits of $y$.

Thus, for $R\_n \leq m < \tilde{R}\_n$ the query-optimal algorithm will use more time to make fewer queries than the time-optimal algorithm.

This approach can be made slightly less hand-wavy (or generalized to other Ramsey-like problems) but I think even the more rigorous attempt doesn't fully answer the question.


---

