Introduction
Distribution testing is a fundamental task in statistics and computer science, addressing questions such as whether two datasets originate from the same distribution or estimating the number of unique elements in a large population. Traditionally, these tasks are performed using independent samples. However, when the domain size $n$ is large—such as the number of unique words on the internet or species in an ecosystem—the number of samples required can be prohibitively high.
To address this, researchers have explored "query models" where an algorithm can ask for the exact probability of any element. While mathematically powerful, this model is often unrealistic because it assumes prior knowledge of all possible elements. In their paper "Probability-Revealing Samples" (AISTATS 2018), Krzysztof Onak and Xiaorui Sun introduce a middle ground: the Probability-Revealing Sample (PR-sample) model. In this framework, an algorithm receives the probability of an element only after it has been sampled, providing a more realistic yet highly efficient alternative to standard sampling.
The PR-Sample Framework
The core innovation is the definition of a PR-sample. When an algorithm draws a sample $x$ from a distribution $\mathcal{D}$, it receives a pair $(x, p_x)$, where $p_x$ is the probability of selecting $x$ under $\mathcal{D}$. This model is further refined to be robust for real-world applications through an $\alpha$-approximate version, where the provided probability $p'_x$ is within a multiplicative factor $\alpha$ of the true probability $p_x$.
Motivating Scenarios
The authors identify two structural scenarios where PR-samples naturally emerge, as illustrated in Figure 1.
- Grouped Identical Labels: Consider data stored in a sorted array. Once an element is sampled, its frequency (and thus its probability) can be determined quickly via binary search to find its boundaries.
- Geographic Distributions: In spatial data, elements might occupy connected regions on a grid. Upon sampling a single "square" of a territory, a Breadth-First Search (BFS) can be used to map the entire connected region, revealing the total area and probability of that territory.
Algorithmic Contributions
The paper provides simple yet optimal algorithms for five fundamental problems:
- Identity Testing: Determining if an unknown distribution $\mathcal{D}$ matches a known reference $\mathcal{D}_*$.
- Distance to Known: Estimating the total variation distance between $\mathcal{D}$ and $\mathcal{D}_*$.
- Equality Testing: Deciding if two unknown distributions $\mathcal{D}_1$ and $\mathcal{D}_2$ are identical.
- Distance between Unknowns: Estimating the distance between two unknown distributions.
- Distinct Elements: Estimating the support size (the number of elements with non-zero probability).
These algorithms often leverage basic estimators, such as the Horvitz-Thompson estimator for support size, and their correctness is established using standard concentration inequalities like Hoeffding’s and Chebyshev’s.
Comparative Performance and Key Results
The PR-sample model significantly reduces sample complexity compared to the standard model. The most dramatic improvement is seen in estimating Distinct Elements. In the standard model, this requires nearly $O(n)$ samples. In the PR-sample model, the complexity collapses to $\Theta(1/\epsilon^2)$, becoming entirely independent of the universe size $n$. This is because the moment an element is seen, its rarity is known, allowing for immediate and accurate weighting.
The following table summarizes the optimal sample complexities established in the paper.
As shown in Figure 6, for Identity Testing, the PR-sample model offers a square-root speedup over the standard model ($\Theta(1/\epsilon)$ vs $\Theta(\sqrt{n}/\epsilon^2)$). For Equality Testing, the complexity is reduced from $\Theta(n^{2/3}/\epsilon^{4/3})$ to $O(\max\{\sqrt{n}/\epsilon, 1/\epsilon^2\})$.
Discussion and Future Work
The PR-sample model effectively bridges the gap between the restrictive "samples-only" model and the overly optimistic "query" model. By proving that algorithms remain effective with $\alpha$-approximate probabilities, the authors demonstrate that this framework is robust enough for practical systems where probabilities are estimated via heuristics.
However, limitations remain. The model assumes that $p_x$ is relatively easy to compute once $x$ is discovered. In some distributions, calculating $p_x$ might be as difficult as the testing problem itself. Furthermore, while the geographic distribution scenario is a strong motivator, the authors leave open whether an algorithm more efficient than $O(n^{3/4})$ queries exists for such data. Future research could also extend these findings from discrete distributions to continuous or high-dimensional spaces.
This summary is based on the paper "Probability-Revealing Samples" by Krzysztof Onak and Xiaorui Sun, presented at AISTATS 2018.
Summary updated