Approximate Minimum Selection with Unreliable Comparisons

We consider the approximate minimum selection problem in presence of independent random comparison faults. This problem asks to select one of the smallest k elements in a linearly-ordered collection of n elements by only performing unreliable pairwise comparisons: whenever two elements are compared, there is a small probability that the wrong comparison outcome is observed. We design a randomized algorithm that solves this problem with a success probability of at least \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$1-q$$\end{document}1-q for \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$q \in (0, \frac{n-k}{n})$$\end{document}q∈(0,n-kn) and any \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k \in [1, n-1]$$\end{document}k∈[1,n-1] using \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$O\big ( \frac{n}{k} \big \lceil \log \frac{1}{q} \big \rceil \big )$$\end{document}O(nk⌈log1q⌉) comparisons in expectation (if \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k \ge n$$\end{document}k≥n or \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$q \ge \frac{n-k}{n}$$\end{document}q≥n-kn the problem becomes trivial). Then, we prove that the expected number of comparisons needed by any algorithm that succeeds with probability at least \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$1-q$$\end{document}1-q must be \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\varOmega }(\frac{n}{k}\log \frac{1}{q})$$\end{document}Ω(nklog1q) whenever q is bounded away from \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{n-k}{n}$$\end{document}n-kn, thus implying that the expected number of comparisons performed by our algorithm is asymptotically optimal in this range. Moreover, we show that the approximate minimum selection problem can be solved using \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$O( (\frac{n}{k} + \log \log \frac{1}{q}) \log \frac{1}{q})$$\end{document}O((nk+loglog1q)log1q) comparisons in the worst case, which is optimal when q is bounded away from \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{n-k}{n}$$\end{document}n-kn and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k = O\big ( \frac{n}{\log \log \frac{1}{q}}\big )$$\end{document}k=O(nloglog1q).

q ≥ n−k n the problem becomes trivial). Then, we prove that the expected number of comparisons needed by any algorithm that succeeds with probability at least 1−q must be Ω( n k log 1 q ) whenever q is bounded away from n−k n , thus implying that the expected number of comparisons performed by our algorithm is asymptotically optimal in this range. Moreover, we show that the approximate minimum selection problem can be solved using O(( n k +log log 1 q ) log 1 q ) comparisons in the worst case, which is optimal when q is bounded away from n−k n and k = O

Introduction
In an ideal world, computational tasks are always carried out reliably, i.e., every operation performed by an algorithm behaves exactly as intended. Practical architectures, however, are error-prone and even basic operations can sometimes return the wrong results, especially when large-scale systems are involved. When dealing with these spurious results the first instinct is to try to detect and correct the errors as they manifest, so that the problems of interest can then be solved using classical (non fault-tolerant) algorithms. An alternative approach deliberately allows errors to interfere with the execution of an algorithm, in the hope that the computed solution will still be good, at least in an approximate sense. This begs the question: is it possible to devise algorithms that cope with faults by design and return solutions that are demonstrably good? We investigate this question by considering a generalization of the fundamental problem of finding the minimum element in a totally-ordered set: in the fault-tolerant approximate minimum selection problem (FT-Min(k) for short) we wish to return one of the smallest k elements in a collection of size n > k using only unreliable pairwise comparisons, i.e., comparisons in which the result can sometimes be incorrect due to errors. This allows, for example, to find a representative in the top percentile of the input set, or to obtain a good estimate of the minimum from a set of noisy observations.
In this paper we provide both upper and lower bounds on the number of comparisons needed by any (possibly randomized) algorithm that solves FT-Min(k) with a success probability of at least 1 − q. Since for q ≥ n−k n we can solve FT-Min(k) by simply returning a random input element, we will focus on q ∈ (0, q crit ), where q crit = n−k n . We prove that FT-Min(k) can be solved using O n k log 1 q comparisons in expectation, 1 and that this number of comparisons is asymptotically optimal when q is bounded away from q crit . Moreover, we show that whenever k = O( n log log 1 q ) we can use the same asymptotic number of comparisons also in the worst case.
Our results have applications in any setting that is subject to random comparison errors (e.g., due to communication interferences, alpha particles, charge collection, cosmic rays [4,8], or energy-efficient architectures where the energy consumed by the computation can be substantially reduced if a small fraction of faulty results is allowed [2,9,10,29]), or in which performing accurate comparisons is too resourceconsuming (think, e.g., of the elements as references to remotely stored records) while approximate comparisons can be carried out much quicker. One concrete application might be selecting one of the top-tier products from a collection of items built using an imprecise manufacturing process (i.e., a high-quality cask from a distillery or a fast semiconductor from a fabrication facility). In these settings, products can be compared to one another (either by human experts or by automated tests), yet the result of the comparisons are not necessarily accurate. 2 1 In order to ease notation, we omit ceilings in our asymptotic upper bounds. E.g., we will write O n k log 1 q in place of O n k log 1 q . This is only relevant for values of q approaching 1.
Before presenting our results in more detail, we briefly discuss the considered error model.

The Error Model
We consider independent random comparison faults, a simple and natural error model, in which there exists a true strict ordering relation among the set S of n input elements, yet algorithms are only allowed to gather information on this relation via unreliable comparisons between pairs of elements. The outcome of a comparison involving two distinct elements x and y can be either "<" or ">" to signify that x is reported as "smaller than" or "larger than" y, respectively. Most of the times the outcome of a comparison will correspond to the true relative order of the compared elements, but there is a probability upper bounded by a constant p < 1 2 that the wrong result will be observed instead. An algorithm can compare the same pair of elements more than once and, when this happens, the outcome of each comparison is chosen independently of the previous results. In a similar way, comparisons involving different pairs of elements are also assumed to be independent. The above error model was first considered in the 80s and 90s when the related problems of finding the minimum, selecting the k-th smallest element, and of sorting a sequence have been studied [14,30,31]. The best solutions to these problems are due to Feige et al. [14], who provided Monte Carlo algorithms having a success probability of 1 − q and requiring O n log 1 q , O n log min{k,n−k} q , and O n log n q comparisons in the worst case, respectively. Moreover, the authors also provide matching lower bounds, thus showing that the above algorithms use the asymptotically optimal number of comparisons in the worst case. In the sequel we will invoke the minimum finding algorithm of [14]-which we name FindMin-as a subroutine. We therefore find convenient to restate the following theorem from [14] using our notation: Theorem 1 ([14, Theorem 3.5]) Given a set S of n elements and a parameter ∈ (0, 1 2 ), algorithm FindMin performs O n log 1 comparisons in the worst case and returns the minimum of S with a success probability of at least 1 − .

Our Contributions
We design a randomized algorithm that solves FT-Min(k) with a success probability of at least 1 − q using O( n k log 1 q ) comparisons in expectation, where q ∈ (0, q crit ). Moreover, we show that the expected number of comparisons performed by our algorithm is asymptotically optimal when q is bounded away from q crit by proving that any algorithm that succeeds with probability at least 1 − q requires Ω( n k log 1 q ) comparisons in expectation.
We also show how to additionally guarantee that the worst-case number of comparisons required by our algorithm will be O(( n k + log log 1 q ) · log 1 q ). This implies that, as soon as k = O n log log 1 q , we can solve FT-Min(k) with a success probability of at least 1 − q using O( n k log 1 q ) comparisons, which is asymptotically optimal when q is bounded away from q crit .
A possible way to evaluate different algorithms for FT-Min(k) is that of comparing the range of values of k that they are able to handle if we impose an (asymptotic) upper limit of T on the (possibly expected) number of comparisons that they are allowed to perform. For example, if we require the algorithms to succeed with high probability (w.h.p., i.e., for q = 1 n ) and pick T = Θ(n), the natural algorithm that executes FindMin with = O( 1 n ) on a randomly chosen subset of O( n k log n) elements only works for k = Ω(log 2 n). For the same choice of T and q our algorithm works for any k = Ω(log n), thus exhibiting a quadratic difference w.r.t. the smallest achievable values of k. When T = ω(log n) ∩ o(log 2 n), the natural algorithm cannot provide any (non-trivial) guarantee on the rank of the returned element w.h.p., while our algorithm works for any k = Ω( n T log n). To summarize, our algorithm is able to handle the asymptotically optimal range of k if (i) T refers to an expected number of comparisons, or (ii) T refers to a worst-case number of comparisons and T = ω(log n · log log n).

Our Techniques
To obtain our positive results we start by designing a reduction that transforms an instance of FT-Min(k) into an instance of FT-Min 3 4 n with n = Θ(log 1 q ) elements. This reduction shows that if it is possible to solve FT-Min 3 4 n with a success probability of at least 1 − q 2 using T (n) comparisons, then FT-Min(k) can be solved with a success probability of at least 1 − q using O n k log 1 q + T Θ(log 1 q ) comparisons. This allows us to focus on solving FT-Min 3 4 n with a success probability of at least 1 − q using O( 1 q ) comparisons. We do so using a noisy oracle that is able to detect, using a constant number of comparisons, whether an element is among the smallest elements in S with an error probability upper bounded by a (small) constant. We employ this noisy oracle in an iterative algorithm that considers one random input element at a time: whenever x ∈ S is considered, x is tested by querying the oracle multiple times, and it is returned only if most of the query answers report x as one smallest elements in S. The amount of queries performed during each test increases with the iteration number and is chosen to simultaneously ensure that (i) the overall expected number of comparisons is O( 1 q ), and (ii) the probability of (wrongly) returning an element that is too large is at most q. Using our reduction, the above algorithm can be immediately transformed into an algorithm that solves FT-Min(k) using O( n k log 1 q ) comparisons in expectation and O( n k log 1 q + log 2 1 q ) comparisons in the worst case. To reduce the number of comparisons needed in the worst case, we design an algorithm for FT-Min 3 4 n that is reminiscent of knockout-style tournaments and always performs O(n log n + n log 1 q + n −1 log 2 1 q ) comparisons. Thanks to our reduction, this latter algorithm improves the worst-case number of comparisons required to solve FT-Min(k) to O n k log n + (log 1 q ) log log 1 q , which is optimal for k = O n log log 1 q and q bounded away from q crit .
Regarding our negative results, we obtain our lower bound of Ω( n k log 1 q ) using three different strategies depending on the values of k, n, and q (where q is bounded away from q crit ). For n ≥ 2k and q ≤ 1 4 , which we deem the most interesting case, we reduce FT-Min(k) to FT-Min(1) so that (an extension of) the lower bound of [14] applies. For k < n < 2k and q ≤ 1 4 , we construct a set I of roughly n n−k instances of n elements each such that the generic i-th input position contains one of the largest n − k elements in at least one bad instance in I. In order to return the i-th input element, an algorithm for FT-Min(k) needs to detect whether the input instance is bad w.r.t. i with a sufficiently high confidence, which requires Ω(log 1 q ) comparisons in expectation. Finally, for q > 1 4 , we show how to improve the success probability of any algorithm that solves FT-Min(k) from 1 − q < 3 4 to at least 3 4 with only a small blow-up in the number of comparisons, allowing us to employ one of the two lower bound strategies described above.

Other Related Works
The problem of finding the exact minimum of a collection of elements using unreliable comparisons had already received attention back in 1987 when Ravikumar et al. [32] considered the variant in which only up to f comparisons can fail and proved that Θ( f n) comparisons are needed in the worst case. Notice that, in our setting with q bounded away from q crit , f = Ω( n k log 1 q ) in expectation since Ω( n k log 1 q ) comparisons are necessary (as we show in Sect. 6) and each comparison fails with constant probability. In [1], Aigner considered a prefix-bounded probability of error p < 1 2 : at any point during the execution of an algorithm, at most a p-fraction of the past comparisons could have failed. Here, the situation significantly worsens as up to Θ( 1 1− p ) n comparisons might be necessary to find the minimum (and this is tight). Moreover, if the fraction of erroneous comparisons is globally bounded by ρ, and ρ = Ω( 1 n ), then Aigner also proved that no algorithm can succeed with certainty [1]. The landscape improves when we assume that errors occur independently at random: in addition to the already-cited algorithm by Feige et al. [14] (see Sect. 1.1), a recent paper by Braverman et al. [6] also considered the round complexity and the number of comparisons needed by partition and selection algorithms. The results in [6] imply that, for constant error probabilities, Θ(n log n) comparisons are needed by any algorithm that selects the minimum w.h.p.
Recently, Chen et al. [11] focused on computing the smallest k elements given r independent noisy comparisons between each pair of elements. For this problem, in a more general error model, they provide a tight algorithm that requires at most O( √ n polylog n) times as many samples as the best possible algorithm that achieves the same success probability.
If we turn our attention to the related problem of sorting with faults, then Ω(n log n+ f n) comparisons are needed to correctly sort n elements when up to f comparisons can return the wrong answer, and this is tight [3,23,26]. In the prefix-bounded model, the result in [1] on minimum selection also implies that ( 1 1− p ) O(n log n) comparisons are sufficient for sorting, while a lower bound of Ω ( 1 1− p ) n holds even for the easier problem of checking whether the input elements are already sorted [5]. The problem of sorting when faults are permanent (or, equivalently, when a pair of elements can only be compared once) has also been extensively studied and it exhibits connections to both the rank aggregation problem and to the minimum feedback arc set [6,7,[16][17][18][20][21][22]24,27]. Another related family of problems falls in the framework of Rényi-Ulam games: in these two-player games a responder secretly selects an object x from a known universe U and a questioner needs to identify x by asking up to n questions to the responder. The responder can lie up to f times and wins if the questioner fails to uniquely identify x. As an example, if U = {1, . . . , m} and the questions are comparisons the of form "Is x ≤ c?", where c ∈ U is chosen by the questioner, then the questioner can always win by asking at most log m + f log log n + O( f log f ) questions, which is tight [33]. 3 More broadly, Rényi-Ulam games and other search games have been extensively studied for a wide variety of search spaces and question types, as discussed in [31].
Other error-prone models have also been considered in the context of optimization algorithms [19] and in the design resilient data strictures [15,25]. For more related problems on the aforementioned and other fault models, we refer the interested reader to [31] for a survey and to [12] for a monograph.
Finally, we point out that, in the fault-free case, a simple sampling strategy allows to find one of the smallest k elements with probability at least 1 − q using O(min{n, n k log 1 q }) comparisons.

Paper Organization
In Sect. 2 we give some preliminary remarks and we outline a simple strategy to reduce the error probability. Section 3 describes our reduction from FT-Min(k) to FT-Min( 3 4 n). In Sects. 4 and 5 we design two algorithms that solve FT-Min(k) using O( n k log 1 q ) comparisons in expectation and O( n k log 1 q + (log 1 q ) log log 1 q ) comparisons in the worst case, respectively. Finally, Sect. 6 is devoted to proving our lower bounds.

Preliminaries
We will often draw elements from the input set into one or more (multi)sets using sampling with replacement, i.e., we allow multiple copies of an element to appear in the same multiset. We will then perform comparisons among the elements of these multisets as if they were all distinct: when two copies of the same element are compared, we break the tie using any arbitrary (but consistent) ordering among the copies.
According to our error model, each comparison fault happens independently at random with probability at most p ∈ (0, 1 2 ). This error probability can be reduced by repeating a comparison multiple times using a simple majority strategy. The same strategy also works in the related setting in which pairwise comparisons are no longer allowed but we have access to a noisy oracle O that can be queried with an element x ∈ S and returns either true or false. In this setting each x ∈ S is associated with a correct binary answer and, when O is queried with x, it returns the correct answer with probability at least 1 − p > 1 2 (and the wrong answer with the complementary probability). The errors in O's answers are independent. Next lemma provides a lower bound on the probability of correctness of the majority strategy: Lemma 1 Let x and y be two distinct elements. For any error probability upper bounded by a constant p ∈ [0, 1 2 ) there exists a constant c p ∈ N + such that the strategy that compares x and y (resp. queries O with x) 2c p · t + 1 times and returns the majority result is correct with probability at least 1 − e −t .
Proof Suppose, w.l.o.g., that x < y. Let X i ∈ {0, 1} be an indicator random variable that is 1 iff the i-th comparison (resp. query result) is correct. Since the X i s are independent Bernoulli random variables with parameter at least 1 − p, [28,Definition 17.1] a binomial random variable X with parameters 2η = 2c p t + 1 and 1 − p, 4

Our Reduction
In this section we reduce the problem of solving FT-Min(k) to the problem of solving FT-Min( 3 4 n). 5 We will say that an element x is small if it is one of the smallest k elements of S, otherwise we say that x is large. The reduction constructs a set S * of size m that contains at least 3 4 m small elements, where the value of m will be determined later. The set S * is selected as follows: -Create m sets by independently sampling, with replacement, 3 n k elements per set from S.
-Run FindMin (Theorem 1) with failure probability = 1 10 on each of the sets. Let S * = {x 1 , . . . , x m } be the collection containing the returned elements, where x i is the element returned by the execution of FindMin on the i-th set.
Using Theorem 1, Lemma 1 and the Chernoff bound, we are able to prove the following lemma:

Lemma 2
The probability that fewer than 3 4 m elements in S * are small is at most e − m 240 .
Proof Since the i-th set contains at least 3 n k elements and each of them is independently small with a probability of k n , the probability that no element in the i-th set is small is upper bounded by: where we used the inequality 1 + r ≤ e r for r ∈ R. In other words, for every i, the event "the i-th set contains a small element" has probability at least 1 − 1 20 . Moreover, since we chose = 1 10 , the probability that FindMin returns the correct minimum of the i-th set is at least 1 − 1 10 (see Theorem 1). Clearly, if both of the previous events happen, x i must be a small element, and by the union bound, the complementary probability is at most 1 20 + 1 10 < 1 6 . Let X i be an indicator random variable that is 1 iff x i is a small element so that X = m i=1 X i is the number of small elements in S * . Since the x i s are independently small with a probability of at least 5 6 , the variable X stochastically dominates a Binomial random variable with parameters m and 5 6 . As a consequence E[X ] ≥ 5 6 m and, by using the Chernoff bound [28, Theorem 4.5 (2)], we obtain: We are now ready to show the consequence of the above reduction: Lemma 3 Let A be an algorithm that solves FT-Min( 3 4 n) with a success probability of at least 1 − q A ∈ ( 1 2 , 1) using at most T (n, q A ) comparisons in the worst case (resp. in expectation), for any choice of q A ∈ (0, 1 2 ). For any k and any q ∈ (0, 1), there exists an algorithm that solves FT-Min(k) with a success probability of at least 1 − q using O n k log 1 q + T Θ(log 1 q ), q 2 comparisons in the worst case (resp. in expectation).
Proof We first choose m = 240 ln 2 q and we compute the set S * according to our reduction. Then we run A on S * with a failure probability of q A = q 2 , and we answer with the element it returns. Notice that first step of the reduction requires no comparisons. Moreover, since each of the m = O(log 1 q ) executions of FindMin requires O( n k log 1 ) = O( n k ) comparisons (see Theorem 1 and recall that = 1/10), the worstcase number of comparisons performed during the second step is O( n k log 1 q ). Overall, the total number of comparisons is O n k log 1 q + T Θ(log 1 q ), q 2 as claimed. This upper bound holds in the worst-case if T (n, q A ) refers to a worst-case number of comparisons and in expectation if T (n, q A ) refers to an expected number of comparisons.
We now consider the probability of success. By Lemma 2, the probability that fewer Since the probability that A fails to return one of the smallest 3 4 m elements in S * is at most q A = q 2 , the claim follows by using the union bound.
It is not hard to see that, if we choose algorithm A in Lemma 3 to be FindMin,

Solving FT-MIN(k) Using the Asymptotically Optimal Expected Number of Comparisons
In this section, we will solve FT-Min(k) with a success probability of at least 1 − q using O( n k log 1 q ) comparisons in expectation. By Lemma 3, it is sufficient to devise an algorithm that solves FT-Min( 3 4 n) with a success probability of at least 1 − q using O(log 1 q ) comparisons in expectation. We assume that n ≥ 4 since otherwise we can simply return an element selected uniformly at random from S.
In designing such an algorithm we will use a noisy oracle O that can be queried with an element x ∈ S and provides a guess on whether x is small, i.e., among the smallest 3 4 n elements of S, or large (i.e., among the largest 1 4 n elements of S). More precisely, for δ ∈ [0, 1], let S − δ denote the set containing the smallest δn elements of S, and let S + δ denote S \ S − δ . Then, O satisfies the following conditions: -O reports an element x to be small with probability at least 1 − 2 5 if x ∈ S − 1/3 and with probability at most 2 5 if x ∈ S + 3/4 . In other words, O identifies whether an element in S − 1/3 ∪ S + 3/4 is small or large with a failure probability of at most 2 5 ; -Queries to O can be repeated and errors in the answers are independent; -Each query to O is implemented using a constant number of comparisons between elements in S.
Notice that O provides no guarantees on the accuracy of its answers when x ∈ S − 3/4 \ S − 1/3 . We will show how to build such an oracle in Sect. 4.1.
Let c O be the constant of Lemma 1 for p = 2 5 . Our algorithm works in phases: in the generic i-th phase we select one element x i uniformly at random from S, and we perform a test on x i . This test consists of 2c O ln 2 i q + 1 queries to O, and it succeeds if x is reported as small by the majority of the queries (otherwise it fails). If the test on x i succeeds we return x i . Otherwise we move to the next phase. We name the above algorithm GeometricTest since the probability that a test succeeds when a large element is considered decreases geometrically w.r.t. the phase number, as we will show in Sect. 4.2.

Implementing O
To describe our implementation of O we can assume, without loss of generality, that p ≤ 1 16 (if p > 1 16 , we can simulate each comparison by returning the majority result of 6c p + 1 comparisons, as shown by Lemma 1). The oracle O answers a query for an element x ∈ S by comparing x with a randomly sampled element y from S \ {x}. If x compares smaller than y, then x is reported as small, otherwise it is reported as large. Suppose that x ∈ S − 1/3 , if x is (incorrectly) reported as large at least one of the following two conditions must be true (i) y ∈ S − 1/3 or (ii) the comparison between x and y returned the wrong result. The first condition is true with probability at most n/3 −1 n−1 ≤ 1 3 while the second condition is true with probability at most p ≤ 1 16 . Therefore the probability that x is reported as large is at most 1 then, in order for x to be (incorrectly) reported as small, we must have that (i) y ∈ S + 3/4 or (ii) the comparison between x and y returned the wrong result. The first condition is true with probability at most n− 3n/4 −1 n−1 ≤ 1 4 while the second condition is true with probability at most p ≤ 1 16 . Overall, x is reported as small with probability at most 1 4 + 1 16 < 2 5 .

Analysis of the Expected Number of Comparison and of the Success Probability of GeometricTest
The following lemmas respectively provide an upper bound on the expected number of comparisons and a lower bound on the success probability of GeometricTest.

Lemma 4 GeometricTest performs O(log 1 q ) comparisons in expectation.
Proof Consider a generic phase i. Assuming that the algorithm did not stop during phases 1, 2, . . . , i − 1, the probability that it stops during phase i is at least: where we used the fact that a test on an element from S − 1 3 performed during the i-th phase succeeds with probability at least 1 − e − ln 2 i q ≥ 1 − q 2 i ≥ 1 2 , as shown by Lemma 1. Then, the number of phases executed by the algorithm is stochastically dominated by a geometric random variable X with parameter 1 6 (see [28,Definition 2.8]). Since, for some constant κ > 0, at most κ ln 2 i q comparisons are performed during phase i, 6 we have that the overall number C i of comparisons performed during phases 1, . . . , i is upper bounded by i j=1 κ ln 2 j q ≤ κ log 2 q · i j=1 j ≤ i 2 κ log 2 q . Then, the expected number of comparisons performed by GeometricTest is at most: where we used the equality ∞ i=1 i 2 (5/6) i = 330 which follows from the more general identity ∞ i=1 i 2 r i = r 2 +r (1−r ) 3 for r ∈ (0, 1) [13].

Lemma 5 GeometricTest solves FT-Min( 3 4 n) with a success probability of at least
Proof If GeometricTest fails, then either it does not terminate or it returns an element in S + 3/4 . Since it is easy to see that the algorithm terminates almost surely, 7 we can focus on upper bounding the probability ρ i that the algorithm terminates at the end of a generic phase i by returning an element in S + 3/4 . In order for this to happen we must have that (i) x i is large and (ii) was reported as small by at least c O ln 2 i q + 1 of the 2c O ln 2 i q + 1 queries to O. The probability of (i) is at most 1 4 , and by Lemma 1, the probability of (ii) given (i) is at most e − ln 2 i q ≤ q 2 i , implying that ρ i ≤ 1 4 · q 2 i = q 2 i+2 . We can now use the union bound over the different phases to upper bound the overall failure probability with Combining Lemmas 4 and 5 we can conclude that GeometricTest solves FT-Min( 3 4 n) with a success probability of at least 1 − q using O(log 1 q ) comparisons in expectation. Lemma 3 immediately implies the following theorem: Theorem 2 FT-Min (k) can be be solved with a success probability of at least 1 − q using O( n k log 1 q ) comparisons in expectation.
We conclude this section by pointing out that, since each phase of Geomet-ricTest has a probability of at least 1 6 of returning a small element (as shown in 6 Recall from Sect. 4.1 that each query to O is implemented with one comparison when p ≤ 1 16 , and with 6c p +1 comparisons when p > 1 16 . Since the number of queries in phase i is 2c O ln 2 i q +1 ≤ 4c O ln 2 i q , we can pick κ = 4c O (6c p + 1). 7 The proof of Lemma 4 shows that the probability that more than i phases are needed is at most (5/6) i . Fig. 1 An example of the complete binary tree representing an execution of our algorithm when the input sequence S contains n = 8 elements. Each internal vertex x (i) j is the winner of a match (consisting of 2c p 2 i ln 1 ρ + 3 comparisons) between its two children x Combining TruncatedGeometricTest with Lemma 3, we obtain an algorithm that solves FT-Min (k) with a success probability of at least 1 − q using O( n k log 1 q ) comparisons in expectation and O( n k log 1 q +log 2 1 q ) comparisons in the worst case. This latter algorithm uses the same worst-case number of comparisons as the one that can obtained by combining FindMin with Lemma 3, but it uses fewer comparisons in expectation (see the discussion at the end Sect. 3 for details). In the next section we will show how to reduce the asymptotic number of comparisons needed in the worst case.

Solving FT-MIN(k) Using an Almost-Optimal Number of Comparisons in the Worst Case
In this section, we solve FT-Min(k) with a success probability of at least 1 − q using O ( n k + log log 1 q ) log 1 q comparisons in the worst case. For the sake of simplicity, we assume that n is a power of two. 8 We let ρ ∈ (0, 1 2 ] be a parameter that will be chosen later, and we design an algorithm that requires O(n · log 1 ρ · (log n + log 1 ρ )) comparisons to solve FT-Min 3 4 n with a success probability of at least 1 − ρ n . Our algorithm simulates a knockout tournament and works in log n rounds. In the beginning we construct a set S 0 = {x  j of the match is the element that is reported to be smaller by the majority of the comparisons.
After the (log n)-th round we are left with a set S log n containing a single element: this element is winner of the tournament, i.e., it is the element returned by our algorithm. The above algorithm can be visualized as a complete binary tree of height log n in which the leaves are the elements in S 0 , the root is the unique element in S log n , and each internal vertex at depth log n − i represents some element as its two children. See Fig. 1 for an example. As in the previous section, we will say that an element is small if it is among the 3 4 n smallest element of S, and large otherwise. The following lemma provides a lower bound on the success probability of our algorithm:

Lemma 6 Consider a tournament among n elements, where n is a power of 2. The probability that the winner of the tournament is a small element is at least
Proof We prove by induction on i = 0, . . . , log n that ∀x We start by considering the base case i = 0. Each element x (0) j ∈ S i is obtained by running FindMin on a (multi)set X j of 2 log 1 ρ elements sampled, with replacement, from S. In order for x (0) j to be large, at least one of the following conditions must be true: (i) the execution of FindMin on X j fails, which happens with probability at most = ρ 2 2 , or (ii) all elements in X j are large. Since each element in X j is independently large with probability at most 1 4 , the probability of (ii) is at most 1 4 2 log 1 ρ = ρ 4 . Using the union bound and ρ ≤ 1 2 , we have that x (0) j is large with probability at most ρ 4 + ρ 2 2 ≤ ρ 2 4 + ρ 2 2 < ρ 2 = ρ 2 i +1 . We now consider i ≥ 1 and we show that if the induction claim holds for i − 1 then it must also hold for i. Since i ≥ 1, we know that each element x is large, which is at most 2 · ρ 2 i−1 +1 ≥ 2ρ 2 by induction hypothesis. We hence focus on the probability that, in a match between a large and a small element, the large element wins. Since x 2 j are compared 2c p 2 i ln 1 ρ + 3 times during the match, Lemma 1 ensures that this probability is at most e −2 i ln 1 ρ −1 = ρ 2 i +1 . Putting it all together, we have: This completes the proof by induction and shows that the winner of the tournament (i.e., the sole element in S log n ) is large with probability at most ρ 2 log n +1 = ρ n+1 (and small with probability at least 1 − ρ n+1 ).
We now analyze the number of comparisons performed by our algorithm.
Proof The initial selection of the elements in S 0 requires O(n · log 1 ρ · log 1 ) = O(n · log 2 1 ρ ) comparisons (recall that we choose = ρ 2 2 ). The tournament itself consists of log n rounds. The number of matches that take place in round i is n 2 i and, for each match, O(2 i log 1 ρ ) comparisons are needed. It follows that the total number of comparisons performed in each round is O(n log 1 ρ ) and, since there are log n rounds, the overall number of comparisons in rounds 1 to log n is O(n · log n · log 1 ρ ).
If we now select ρ = min 1 2 , q 1 n , we obtain an algorithm for FT-Min 3 4 n that performs O n log n + log n · log 1 q + log 2 1 q n comparisons in the worst case and has a success probability of at least We can now use this algorithm in our reduction of Lemma 3 to immediately obtain an algorithm for FT-Min(k) which is optimal for k = O( n log log 1 q ) and q bounded away from q crit (see Theorem 5 in Sect. 6).

Theorem 3 FT-Min(k)
can be solved with a success probability of at least 1 − q using O n k log 1 q + (log 1 q ) log log 1 q comparisons in the worst case. We can combine this algorithm with GeometricTest (described in Sect. 4) to solve FT-Min(k) with a success probability of at least 1 − 1 q using both O( n k log 1 q ) comparisons in expectation and O n k log 1 q + (log 1 q ) log log 1 q comparisons in the worst case. In order to do so, we simply run the two algorithms in parallel until one of them terminates. Clearly, the expected number of comparisons is asymptotically unaffected, while the probability that this combined algorithm fails can be upper bounded by the sum of the respective failure probabilities, i.e., by at most q 4 + q 2 < q (recall that GeometricTest fails with probability at most q 4 , as shown by Lemma 5).

Lower Bound
The rest of the paper is devoted to proving our lower bound of Ω( n k log 1 q ) on the expected number of comparisons required to solve FT-Min(k) with a success probability of at least 1 − q. We prove our lower bound using three different strategies depending on the values of k and q. Figure 2 shows a qualitative representation of the considered regions.
We start by considering what we deem to be the most interesting case, namely the one in which n ≥ 2k and q can be upper bounded by a small enough constant. For simplicity we pick this constant to be 1 4 , although the same proof strategy actually works for any q ≤ 1 2 − ε, where ε > 0 is a constant of choice. 9 We will show that any algorithm that is able to solve FT-Min(k) with a success probability of at least 1 − q can also be used to solve FT-Min(1) with the same success probability. Then, our lower bound for FT-Min(k) follows from the fact that any algorothm that solves FT-Min(1) with a success probability of a least 1−q ∈ 3 4 , 1 must perform Ω(log 1 q ) comparison in expectation. This is formalized in the following theorem, whose proof is given in Appendix A and is similar to the one used in [14, Theorem 2.1] to establish a lower bound on the worst-case number of comparisons needed to solve FT-Min(1). 10 Theorem 4 Let A be an algorithm that solves FT-Min(1) with a probability of success of at least 1 − q ∈ ( 1 2 , 1]. For any n ≥ 2, there exists a sequence S of n elements such that the expected number of comparisons performed by A on S is at least γ n log 1 2q , where γ > 0 is a constant that depends only on p. We are now ready to prove our lower bound for FT-Min(k) when n ≥ 2k and q ≤ 1 4 . 9 The case k ≤ n 2 and q ∈ 1 4 , 1 2 − ε will be covered by the more general Lemma 11. 10 The lower bound of [14, Theorem 2.1] concerns the related problem of computing the logical OR of an input sequence of bits using noisy queries. A lower bound for this problem immediately translates into a lower bound for FT-Min(1). For details see Lemma 3.4 and Theorem 3.5 in [14] or the self-contained proof of Theorem 4 in Appendix A.

is a constant that depends only on p.
Proof Let γ be the constant from Theorem 4, choose ψ 1 = γ 4 , and suppose towards a contradiction that there is an algorithm A that is able to solve FT-Min(k) with a success probability of at least 1 − q using an expected number of comparisons of at most ψ 1 n k log 1 q on every instance of n ≥ 2k elements. We will show that the existence of A implies the existence of an algorithm A that is able to solve FT-Min(1) with a success probability of at least 1 − q on any instance of n = n k ≥ 2 elements using fewer than γ n log 1 2q comparisons in expectation, thus contradicting Theorem 4. Algorithm A works as follows: given an instance S of FT-Min(1) with n elements, A constructs an instance S of FT-Min(k) that consists of k copies of each element in S and of n − k n k < k copies of an arbitrary element from S . Then, A runs A on S (which contains exactly n elements) and outputs the element x returned by the execution of A. With probability at least 1 − q, x is among the k smallest elements of S, implying that it is (a copy of) the smallest element of S .
To conclude the proof, it suffices to notice that the expected number of comparisons performed by A on S is upper bounded by the expected number of comparisons performed by A on S, i.e., it is at most We now turn our attention to the ranges of k and q that are not covered by Lemma 8. Recall that for q ≥ q crit = n−k n , no lower bound exists since FT-Min(k) can be solved without performing any comparison by simply returning an element chosen uniformly at random from S. In the rest of this section we will consider values of q that are bounded away from q crit , namely we assume the existence of some constant α > 0 for which 0 < q ≤ n−k n − α. As a consequence, we can prove a preliminary lower bound of α on the expected number of comparisons needed to solve FT-Mink with a success probability of at least 1 − q. This lower bound will be useful to handle some corner cases in the sequel.

Lemma 9
Let n > k and q ≤ n−k n − α. For every algorithm A that solves FT-Min(k) with a success probability of at least 1 − q, there exists a sequence S of n elements such that the expected number of comparisons performed by A on S is at least α.
Proof Suppose towards a contradiction that there is an algorithm A that is able to solve FT-Min(k) with a success probability of at least 1 − q using an expected number of comparisons smaller than α on every instance of n > k elements. Then, an execution of A performs no comparisons with a probability larger than 1 − α. When the input of A is a random permutation of 1, 2, . . . , n , the failure probability must be larger than (1 − α) n−k n = n−k n − α(n−k) n > n−k n − α ≥ q. This implies the existence of at least one instance of n elements for which A fails with a probability larger than q, yielding the sought contradiction.
We now handle the case n < 2k and q ≤ 1 4 . We will consider a suitable set of instances ensuring that any algorithm having a success probability of at least 1 − q must perform at least ψ 2 log 1 q comparisons on at least one instance in the set, for some constant ψ 2 > 0. Notice that, in this case, ψ 2 log 1 q > ψ 2 2 n k log 1 q .
Lemma 10 Let k < n < 2k and q ≤ min{ 1 4 , n−k n − α}. For every algorithm A that solves FT-Min(k) with a success probability of at least 1 − q, there exists a sequence S of n elements such that the expected number of comparisons performed by A on S is at least ψ 2 log 1 q , where ψ 2 > 0 is a constant that depends only on α and p.
Proof Let A be an algorithm that solves FT-Min(k) with a success probability of at least 1 − q ≥ 3 4 using at most μ comparisons in expectation on every instance of n elements, where k < n < 2k.
Let β = 3α 8(α+1) , notice that β ∈ (0, 1) is a constant as it only depends on α, and define ψ 2 = min We only need to consider q < β 2 since, when q ≥ β 2 , Lemma 9 already ensures that μ ≥ α ≥ α 2 log 1 β log 1 q ≥ ψ 2 log 1 q . In the rest of the proof we will consider η + 1 sequences I 0 , I 1 , . . . I η having n elements each, where η = k n−k . Then, we will lower bound μ by considering the expected number of comparisons needed by A to solve each instance I i with a success probability of at least 1 − q.
We start by defining I 0 = 1, 2, . . . , n and, for i = 1, . . . , η, we let I i be the sequence obtained by performing (n − k) · i consecutive right rotations on I 0 . 11 See Fig. 3 for an example. We denote by x (i) j the element that appears in the j-th position of sequence I i . We will use A(I i ) to refer to an execution of A with input I i , and A(I i ) = x (i) j to denote the event "A(I i ) returns element x (i) j ". Moreover, we let F i be the event "A(I i ) performs at most 4μ comparisons". Since the expected number of comparisons of A(I i ) is at most μ, the Markov inequality implies that A(I i ) performs more than 4μ comparisons with a probability of at most 1 4 , i.e., Pr(F i ) ≥ 3 4 . Given any input sequence of n elements and j ∈ {1, . . . , n}, we can encode an execution of A that returns the j-th element of the input sequence with a pair (C, R) where C is the list of the observed comparison outcomes, and R is the list of all random choices taken by A. Let Pr (C, R) | I i be the probability that the execution (C, R) of A is realized when when the input sequence is I i . Moreover, let Pr(R | C) denote the probability that the random choices of an execution of A are exactly those in R, given that the observed comparison results match those in C. Consider the case in which each comparison error is exactly p. Then, the probability of observing the comparison outcomes in C when A's input is I 0 (resp. I i ) is at most (1 − p) |C| (resp. at least p |C| ), allowing us to relate Pr (C, R) | I 0 and Pr (C, R) | I i as follows: By summing the above inequality over all the choices of (C, R) for which A returns the j-th input element and such that |C| ≤ 4μ, we obtain Pr A( h is not among the k smallest elements of I i . Moreover, for j ∈ {1, . . . , k}, define j * = j n−k and notice that j ∈ L j * (see Fig. 3). Then: where the second inequality follows from the fact that the generic j-th summand in (1) appears in the double sum of (2) when i = j * and h = j ∈ L j * . Since we know that, for all i = 0, . . . , η, A(I i ) fails with probability at most q ≤ 1 4 , we have: The above inequality yields μ ≥ Finally, we consider the remaining case q > 1 4 . We show that the success probability of any algorithm that solves FT-Min(k) can be boosted from 1 − q to at least 1 4 by running it multiple times and selecting the smallest returned element using FindMin. Then, the lower bound of either Lemmas 8 or 10 applies.

Lemma 11
Let n > k and 1 4 < q ≤ n−k n − α. For every algorithm A that solves FT-Min(k) with a probability of success of at least 1 − q, there exists a sequence S of n elements such that the expected number of comparisons performed by A on S is at least ψ 3 n k log 1 q , where ψ 3 > 0 is a constant that depends only on α and p.
Proof Let c ≥ 2 be a constant such that FindMin with a failure probability of = 1 8 requires at most cm comparisons on any instance of m elements (Theorem 1 ensures that such a constant exists). Let A be an algorithm that solves FT-Min(k) with a probability of error of at most q using an expected number of comparisons of at most μ on every instance of n elements. Let ψ 1 and ψ 2 be the constants of Lemmas 8 and 10, respectively. Define ψ = min{ψ 1 , ψ 2 2 }, β = 10 ψ log −2 1 1−α , and ψ 3 = min α 2βc , ψ 10 log 1 1−α . We can restrict ourselves to the case n k > βc since otherwise we can use Lemma 9 and the inequality log 1 q ≤ 2 to write μ ≥ α ≥ α βc n k ≥ α 2βc n k log 1 q ≥ ψ 3 n k log 1 q .
We now describe an algorithm A that uses A to solve FT-Min(k) with a success probability of at least 3 4 . Given an instance S of n elements, A works as follows: first, it performs t = 3 log 1 q independent executions of A with input S and collects the returned elements into a set S ; then, it runs FindMin on S with a probability of error of = 1 8 , and answer with the returned element. The expected number of comparisons of A is at most ct + tμ, and the probability that no execution of A returns one of the k smallest elements is at most q t ≤ q 3 log 1 q = 1 2 3 = 1 8 . By the union bound, the overall failure probability of A is at most 1 8 + 1 8 = 1 4 . By invoking either Lemmas 8 or 10 (depending on the values of k and n), we know that the expected number of comparisons of A must be at least min{ψ 1 , ψ 2 2 } n k log 1 q = ψ n k log 1 q . In formulas: Since 3 Moreover, we know that q ≤ n−k n − α < 1 − α. We can then solve (3) for μ and combine the result with the above inequalities: Using q < 1 − α once more, together with n k > βc, we have: which can be combined with (4) to show that μ > ψ 10 log 1 1−α · n k log 1 q ≥ ψ 3 n k log 1 q .
Combining Lemmas 8, 10, and 11, we obtain the main result of this section: Theorem 5 Let n > k and q ≤ n−k n −α. For every algorithm A that solves FT-Min(k) with a success probability of at least 1−q, there exists a sequence S of n elements such that the expected number of comparisons performed by A on S is at least ψ n k log 1 q , where ψ > 0 is a constant that depends only on α and p.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

A Proof of Theorem 4
Consider the following Noisy-OR problem, first introduced in [14]: we are given a finite input sequence y 1 , y 2 , . . . where y i ∈ {0, 1} and we need to output "true" if at least one y i equals 1, and "false" otherwise. The actual value of an element y i cannot be read directly but we can perform queries to a noisy oracle O. Whenever O is queried with an element y i , it returns y i with probability 1 − p and 1 − y i with the complementary probability. We will denote such a query by O(y i ).
Given an algorithm A that solves FT-Min(1) on every instance of n elements with a success probability of at least 1 − q, we can design an algorithm A that solves the Noisy-OR problem on every instance of n − 1 elements with the same success probability. Intuitively, algorithm A on input y 1 , y 2 , . . . , y n−1 simulates an execution of A on input x 1 , x 2 , . . . , x n−1 , x n where x n = n and, for i = 1, . . . , n −1, x i = (1 − y i )n + i. As a consequence, with probability at least 1 − q, A returns x n if all y i s are 0, and x i = x n where i is the smallest index such that y i = 1 otherwise. Formally A executes A with the following modifications: -Whenever A compares two elements x i and x j with i < j (the case j > i is symmetric) A simulates the comparison as follows: -If j = n, then A queries O with y i . If O(y i ) returns "1", x i is treated as smaller than x n . Otherwise, x n is treated as smaller than x i . -If j = n, then A performs 2c p ln 2 p + 1 queries O(y i ) (resp. O(y j )), and computes their majority result r i (resp r j ). If exactly one r h ∈ {r i , r j } is 1, A treats the corresponding element x h as the smaller between x i and x j . Otherwise (if r i = r j ) x i is treated as smaller than x j . Notice that, by Lemma 1, r i = x i (resp. r j = x j ) with probability at least 1 − p 2 , showing that the element that is reported as smaller is actually the smaller between x i and x j with a probability of at least 1 − 2 p 2 = 1 − p. -Whenever A terminates and returns an element x i , A returns "true" if x i = x n and "false" otherwise.
Each comparison of A is implemented by A using at most 4c p ln 2 p + 2 queries to O, therefore if the average number of comparisons required A on any instance of n elements is at most μ, A performs at most (4c p ln 2 p + 2)μ queries in expectation on every instance of Noisy-OR consisting of n − 1 elements. In the rest of the proof we will show that no algorithm for Noisy-OR having a success probability of at least 1 − q can perform fewer than γ n log 1 2q queries on all instances of n − 1 elements, where γ > 0 is a suitable constant that depends on p. This will immediately prove that μ ≥ γ 4c p ln 2 p +2 n log 1 2q = γ n log 1 2q , where γ = γ 4c p ln 2 p +2 .
Consider any algorithm A that solves Noisy-OR with a success probability of at least 1 − q and a let ν be the maximum among the expected number of queries performed by A on any input sequence of n − 1 elements. We will derive a lower bound on ν. Assume that ν is finite and let ε ∈ (0, 1 2q − 1) be a parameter that will be chosen later. The existence of A implies the existence of an algorithm A * for Noisy-OR that has a success probability of at least 1 − (1 + ε)q, performs at most ν queries in expectation (on every instance of n − 1 elements), and at most ν qε queries in the worst case. Such A * can be obtained from A by stopping A immediately before the ν qε + 1 -th query to O (if A is stopped in this way, A * returns any arbitrary input element). By the Markov inequality A is stopped with probability at most ν ν/(qε) = qε, showing that the probability of failure q of A * is at most q + qε = (1 + ε)q < 1 2 . For i = 0, . . . , n − 1, let I i denote the sequence y 1 , . . . , y n−1 , where y j = 1 if j = i and y j = 0 otherwise (so that I 0 consists of n − 1 zeros). Similarly to the proof of Theorem 2.1 in [14], we consider the rooted noisy Boolean decision tree T associated with A * : each internal vertex v of T has a label λ v ∈ {1, . . . , n − 1} and represents a query O(y λ v ), while each leaf is labeled with either "true" or "false". A specific execution of A * on an input sequence of n − 1 elements traces a path P between the root r of T and a leaf of T , and the output of the execution matches the label of . Let L be the set of leaves of T .
Given ∈ L we will denote by Pr( | I i ) the probability that an execution of A * on input I i traces the (unique) path P from r to in T . For j = 1, . . . , n − 1, define η( , j) as the number of internal vertices labeled j on the unique path P between the root of T and . It follows that the execution of A * described by P performs For i = 1, . . . , n − 1, the only input element that differs between I i and I 0 is y i . Since an execution of A * that traces P performs η( , i) queries O(y i ), we have that Pr( | I i ) must be at least p