The Exercise
A search space holds items, of them solutions, and an oracle answers whether a given item is a solution. A classical algorithm estimates by sampling: it draws items uniformly and independently, asks the oracle about each, and returns the fraction of draws that turned up a solution, multiplied by . The exercise asks for the standard deviation of this estimate, and then for the number of draws it takes to get right to within with probability at least three quarters, whatever the value of ; the answer is a number of draws linear in .
Sampling the Search Space
The success probability of a draw from items of which are solutions is the number (1)✦
A draw has two outcomes, when the oracle finds a solution and when it does not. The distribution of a single draw is the Bernoulli distribution with parameter on these two outcomes: (2)✦
A run of draws is a sequence of outcomes. The distribution of a run is the product of copies of , one for each draw, so that the draws are independent: (3)✦
The indicator of the th draw is the function on runs that equals one when that draw finds a solution and zero otherwise: (4)✦ The sampling estimator is the function on runs that counts the successful draws and scales the count by : (5)✦ It does not depend on ; only the distribution of the runs does.
The standard deviation of the estimator is the square root of its variance, where denotes the expectation over runs distributed according to : (6)✦
The Claim
Theorem 1. For a search space of items with solutions and a run of draws, the standard deviation of the sampling estimator is (7)✦
The number of successes is binomial with variance ; scaling by and putting gives (7).
Theorem 2. Let a run have draws from a search space of items, and suppose that for every number of solutions with the sampling estimator satisfies (8)✦ Then .✦
What Is Checked
Both claims are stated over the distribution of a run of independent draws, the product (3) of Bernoulli distributions with parameter , and over the estimator built from the indicators of the draws; the first claim is also stated over the standard deviation . The library proves of these constructions that the success probability (1) is at most one, , for every and .✦