We give efficient deterministic algorithms for converting randomized query algorithms into deterministic ones. We first give an algorithm that takes as input a randomized q-query algorithm R with description length N and a parameter ε, runs in time poly(N ) • 2 O(q/ε) , and returns a deterministic O(q/ε)-query algorithm D that ε-approximates the acceptance probabilities of R. These parameters are near-optimal: runtime N + 2 Ω(q/ε) and query complexity Ω(q/ε) are necessary.Next, we give algorithms for instance-optimal and online versions of the problem:• Instance optimal: Construct a deterministic q ⋆ R -query algorithm D, where q ⋆ R is minimum query complexity of any deterministic algorithm that ε-approximates R.• Online: Deterministically approximate the acceptance probability of R for a specific input x in time poly(N, q, 1/ε), without constructing D in its entirety.Applying the techniques we develop for these extensions, we constructivize classic results that relate the deterministic, randomized, and quantum query complexities of boolean functions (Nisan, STOC 1989; Beals et al., FOCS 1998). This has direct implications for the Turing machine model of computation: sublinear-time algorithms for total decision problems can be efficiently derandomized and dequantized with a subexponential-time preprocessing step.
Background: Non-constructive derandomization of query algorithmsWe begin by discussing two well-known results giving non-constructive derandomizations of query algorithms, where the first of the two efficiency criteria discussed above, the runtime of the derandomization procedure, is disregarded. These results establish the existence of a corresponding deterministic query algorithm, but their proofs do not yield efficient algorithms for constructing such a deterministic algorithm. Looking ahead, the main contribution of our work, described in detail in Section 2, is in obtaining constructive versions of these results.• In Section 1.2.1 we recall Yao's lemma [Yao77], specializing it to the context of query algorithms.For any randomized q-query algorithm R, (the "easy direction" of) Yao's lemma along with a standard empirical estimation analysis implies the existence of a deterministic O(q/ε)-query algorithm that ε-approximates R.