query image, we want to find an image that is closest in terms of an approximate cosine distance. The BoW procedure processes the features one by one, increasing the score of each candidate image by some number. We can view the candidate images as different distributions and the new scores as the new samples. At each round, we have a new estimate for the similarity of each candidate image to the query image. The problem is to stop sampling and return the true match as quick as possible.

The problem that we study in this paper can be formulated as a stopping problem [@Shiryaev]. The stopping problem is a decision making problem where at each round, the decision maker observes an input and a (possibly noisy) reward and decides whether he wants to see the next input or not. The objective is to maximize the expected reward when he decides to [*stop*]{}. The stopping problem is studied in various settings in statistics, decision theory, and economics.

More specifically, we can formulate our problem as finding the best option from a pool of options based on some measurements. Assume a number of distributions are given, from which we want to find 