smallequation

$\BODY$

(1)

smallalign

$\BODY$

(2)

# C-MinHash: Rigorously Reducing $K$ Permutations to Two

Xiaoyun Li and Ping Li

Cognitive Computing Lab
Baidu Research
10900 NE 8th St. Bellevue, WA 98004, USA
{xiaoyunli<EMAIL_ADDRESS>
###### Abstract

111This work was mostly conducted in 2019 and early 2020, while Xiaoyun Li was
still a PhD research intern at Baidu Research.

Minwise hashing (MinHash) is an important and practical algorithm for
generating random hashes to approximate the Jaccard (resemblance) similarity
in massive binary (0/1) data. The basic theory of MinHash requires applying
hundreds or even thousands of independent random permutations to each data
vector in the dataset, in order to obtain reliable results for (e.g.,)
building large-scale learning models or approximate near neighbor search in
massive data. In this paper, we propose Circulant MinHash (C-MinHash) and
provide the surprising theoretical results that we just need two independent
random permutations. For C-MinHash, we first conduct an initial permutation on
the data vector, then we use a second permutation to generate hash values.
Basically, the second permutation is re-used $K$ times via circulant shifting
to produce $K$ hashes. Unlike classical MinHash, these $K$ hashes are
obviously correlated, but we are able to provide rigorous proofs that we still
obtain an unbiased estimate of the Jaccard similarity and the theoretical
variance is uniformly smaller than that of the classical MinHash with $K$
independent permutations. The theoretical proofs of C-MinHash require some
non-trivial efforts. Numerical experiments are conducted to justify the theory
and demonstrate the effectiveness of C-MinHash.

##  1 Introduction

Given two $D$-dimensional binary vectors $\bm{v},\bm{w}\in\\{0,1\\}^{D}$, the
Jaccard similarity (also known as the “resemblance”) is defined as

$J(\bm{v},\bm{w})=\frac{\sum_{i=1}^{D}\mathbbm{1}\\{\bm{v}_{i}=\bm{w}_{i}=1\\}}{\sum_{i=1}^{D}\mathbbm{1}\\{\bm{v}_{i}+\bm{w}_{i}\geq
1\\}},$ (3)

which is a commonly used similarity metric in machine learning and web search
applications. The vectors $\bm{v}$ and $\bm{w}$ can also be viewed as two sets
of items (which represent the locations of non-zero entries), the Jaccard
similarity can be equivalently viewed as the size of set intersection over the
size of set union. For binary dataset, the Jaccard appears to be a more
natural measure of similarity than the “cosine”, but it is not the focus of
this paper to argue which similarity measure should be used for binary data.

The well-known method of “minwise hashing” (or MinHash) (Broder, 1997; Broder
et al., 1997, 1998; Li and Church, 2005; Li and König, 2011) is a standard
technique for computing/estimating the Jaccard similarity in massive binary
datasets, with numerous applications such as near neighbor search, duplicate
detection, malware detection, web search, clustering, large-scale learning,
social networks, computer vision, etc. (Charikar, 2002; Fetterly et al., 2003;
Henzinger, 2006; Das et al., 2007; Buehrer and Chellapilla, 2008; Bendersky
and Croft, 2009; Chierichetti et al., 2009; Lee et al., 2010; Li et al., 2011;
Deng et al., 2012; Chum and Matas, 2012; Shrivastava and Li, 2012; He et al.,
2013; Tamersoy et al., 2014; Shrivastava and Li, 2014; Zamora et al., 2016).
The basic idea of MinHash is deceptively simple, as described in Algorithm 1.

###  1.1 A Review of Minwise Hashing (MinHash)

Input: Binary data vector $\bm{v}\in\\{0,1\\}^{D}$, $K$ independent
permutations $\pi_{1},...,\pi_{K}$: $[D]\rightarrow[D]$.

Output: $K$ hash values $h_{1}(\bm{v}),...,h_{K}(\bm{v})$.

For $k=1$ to $K$

$h_{k}(\bm{v})\leftarrow\min_{i:v_{i}\neq 0}\pi_{k}(i)$

End For

Algorithm 1 Minwise-hashing (MinHash)

For simplicity, Algorithm 1 considers just one vector
$\bm{v}\in\\{0,1\\}^{D}$. In order to generate $K$ hash values for $\bm{v}$,
we assume $K$ independent permutations: $\pi_{1},...,\pi_{K}:[D]\mapsto[D]$.
For each permutation, the hash value is the first non-zero location in the
permuted vector, i.e.,

$\displaystyle h_{k}(\bm{v})=\min_{i:v_{i}\neq 0}\pi_{k}(i),\hskip
14.45377pt\forall k=1,...,K.$

Similarly, for another binary vector $\bm{w}\in\\{0,1\\}^{D}$, using the same
$K$ permutations, we can also obtain $K$ hash values, $h_{k}(\bm{w})$. The
estimator of $J(\bm{v},\bm{w})$, i.e., the Jaccard similarity between $\bm{v}$
and $\bm{w}$, is simply

$\displaystyle\hat{J}_{MH}(\bm{v},\bm{w})=\frac{1}{K}\sum_{k=1}^{K}\mathbbm{1}\\{h_{k}(\bm{v})=h_{k}(\bm{w})\\},$
(4)

where $\mathbbm{1}\\{\cdot\\}$ is the indicator function. By fundamental
probability and the independence among the permutations, it is easy to show
that

$\displaystyle\mathbb{E}[\hat{J}_{MH}]=J,\hskip
28.90755ptVar[\hat{J}_{MH}]=\frac{J(1-J)}{K}.$ (5)

How large is $K$? The answer depends on the application domains. For example,
for training large-scale machine learning models, it appears that $K=512$ or
$K=1024$ might be sufficient (Li et al., 2011). However, for approximate near
neighbor search using many hash tables (Indyk and Motwani, 1998), it is likely
that $K$ might have to be much larger than $1024$ (Shrivastava and Li, 2012,
2014).

In the early work of MinHash (Broder, 1997; Broder et al., 1997), actually
only one permutation was used by storing the first $K$ non-zero locations
after the permutation. Later Li and Church (2005) proposed better estimators
to improve the estimation accuracy. The major drawback of the original scheme
was that the hashed values did not form a metric space (e.g., satisfying the
triangle inequality) and hence could not be used in numerous
algorithms/applications which require metric space. We believe this was the
main reason why the original authors moved to using $K$ permutations (Broder
et al., 1998).

###  1.2 From $K$ Permutations to 2 Permutations

In this paper, we present some (perhaps surprising) theoretical findings that
we just need 2 permutations for MinHash and the results (estimation variances)
are even more accurate. Basically, with the initial permutation (denoted by
$\sigma$), we randomly shuffle the data to break whatever structure which
might exist in the original data, and then the second permutation (denoted by
$\pi$) is applied and re-used $K$ times to generate $K$ hash values, via a
simple “circulant” trick. Therefore, we name the proposed method C-MinHash,
i.e., circulant MinHash.

The “circulant” trick was used in the literature of random projections. For
example, Yu et al. (2017) showed that using the circulant trick, the
estimation accuracy of random projections was hurt, but not by too much when
the data are sparse. In this paper, we show the surprising theoretical
results, in Theorem 3.1 and Theorem 3.4, that C-MinHash actually exhibits
strictly smaller variances than MinHash. While the proofs require some non-
trivial efforts, the correctness of the theorems can be easily verified by
simulations.

Roadmap: In this paper, we will present two variants of C-MinHash. In Section
2, the initial permutation $\sigma$ is actually not used and we directly use
permutation $\pi$ on the original data vector to generate $K$ hashes. We name
this method “C-MinHash-$(0,\pi)$”. Although it is not our recommended method,
our analysis for C-MinHash-$(0,\pi)$ provides the necessary preparation for
later methods and the intuition for understanding the need for the initial
permutation. In Section 3, we analyze the recommended method
“C-MinHash-$(\sigma,\pi)$”, i.e., we use both the initial permutation $\sigma$
and the second permutation $\pi$. The theoretical results demonstrate that the
variance of C-MinHash-$(\sigma,\pi)$ is uniformly smaller than that of the
original MinHash. Section 4 provides the experiments to sanity check our
theoretical findings.

##  2 C-MinHash-$(0,\pi)$: Circulant MinHash without the Initial
Permutation

Input: Binary data vector $\bm{v}\in\\{0,1\\}^{D}$, Permutation vector $\pi$:
$[D]\rightarrow[D]$

Output: Hash values $h_{1}(\bm{v}),...,h_{K}(\bm{v})$

For $k=1$ to $K$

Shift $\pi$ circulantly rightwards by $k$ units: $\pi_{k}=\pi_{\rightarrow k}$

$h_{k}(\bm{v})\leftarrow\min_{i:v_{i}\neq 0}\pi_{\rightarrow k}(i)$

End For

Algorithm 2 C-MinHash-$(0,\pi)$

As shown in Algorithm 2, the C-MinHash algorithm has similar operations as
MinHash. The difference lies in the permutations used in the hashing process.
To generate each hash $h_{k}(\bm{v})$, we permute the data vector using
$\pi_{\rightarrow k}$, which is the permutation shifted $k$ units circulantly
towards right based on $\pi$. For example,

$\displaystyle\pi=[3,1,2,4],\hskip 14.45377pt\pi_{\rightarrow
1}=[4,3,1,2],\hskip 14.45377pt\pi_{\rightarrow 2}=[2,4,3,1].$

Figure 1: An illustration of the idea of C-MinHash. The data vector has three
non-zeros, $v_{2}=v_{4}=v_{5}=1$. In this example, $h_{k}(\bm{v})=3$,
$h_{k+1}(\bm{v})=1$.

Conceptually, we may think of circulation as concatenating the first and last
elements of a vector to form a circle; see Figure 1. We set the hash value
$h_{k}(\bm{v})$ as the position of the first non-zero after being permuted by
$\pi_{\rightarrow k}$. Analogously, we define the C-MinHash-$(0,\pi)$
estimator of the Jaccard similarity $J(\bm{v},\bm{w})$ as

$\hat{J}_{0,\pi}=\frac{1}{K}\sum_{k=1}^{K}\mathbbm{1}\\{h_{k}(\bm{v})=h_{k}(\bm{w})\\},$
(6)

where $h$ is the hash value output by Algorithm 2. In this paper, for
simplicity, we assume $K\leq D$.

Next, we present the theoretical analysis for Algorithm 2, in terms of the
expectation (mean) and the variance of the estimator $\hat{J}_{0,\pi}$. Our
results reveal that the estimation accuracy depends on the initial data
distribution, which may lead to undesirable performance behaviors when real-
world datasets exhibit various structures. On the other hand, while it is not
our recommended method, the analysis of C-MinHash-$(0,\pi)$ serves a good
preparation (and insight) for the analysis of C-MinHash-$(\sigma,\pi)$ which
will soon be described.

Here we introduce some notations and definitions, before we proceed with the
theoretical analysis. Firstly, given $\bm{v},\bm{w}\in\\{0,1\\}^{D}$, we
define $a$ and $f$ as follows:

$\displaystyle a=\sum_{i=1}^{D}\mathbbm{1}\\{\bm{v}_{i}=1\text{ and
}\bm{w}_{i}=1\\},\hskip
14.45377ptf=\sum_{i=1}^{D}\mathbbm{1}\\{\bm{v}_{i}=1\text{ or
}\bm{w}_{i}=1\\}.$ (7)

We say that $(\bm{v},\bm{w})$ is a $(D,f,a)$-data pair, whose Jaccard
similarity can also be written as $J=a/f$.

######  Definition 2.1.

Consider two binary vectors $\bm{v},\bm{w}\in\\{0,1\\}^{D}$. Define the
location vector as $\bm{x}\in\\{O,\times,-\\}^{D}$, with $\bm{x}_{i}$ being
“$O$”, “$\times$”, “$-$”, when $\bm{v}_{i}=\bm{w}_{i}=1$,
$\bm{v}_{i}+\bm{w}_{i}=1$ and $\bm{v}_{i}=\bm{w}_{i}=0$, respectively.

The location vector $\bm{x}$ can fully characterize a hash collision. When a
permutation $\pi_{\rightarrow k}$ is applied, the hash values $h_{k}(\bm{v})$
and $h_{k}(\bm{w})$ would collide if after permutation, the first “$O$” is
placed before the first “$\times$” (counting from small to large). This
observation will be the key in our theoretical analysis.

######  Definition 2.2.

For $A,B\in\\{O,\times,-\\}$, let $\\{(A,B)|\triangle\\}$ denote the set
$\\{(i,j):(\bm{x}_{i},\bm{x}_{j})=(A,B),j-i=\triangle\\}$. For each
$1\leq\triangle\leq K-1$, define

$\displaystyle\mathcal{L}_{0}(\triangle)=\\{(O,O)|\triangle\\},\hskip
3.61371pt\mathcal{L}_{1}(\triangle)=\\{(O,\times)\\},\hskip
3.61371pt\mathcal{L}_{2}(\triangle)=\\{(O,-)\\},$
$\displaystyle\mathcal{G}_{0}(\triangle)=\\{(-,O)|\triangle\\},\hskip
3.61371pt\mathcal{G}_{1}(\triangle)=\\{(-,\times)\\}\hskip
3.61371pt,\mathcal{G}_{2}(\triangle)=\\{(-,-)\\},$
$\displaystyle\mathcal{H}_{0}(\triangle)=\\{(\times,O)|\triangle\\},\hskip
3.61371pt\mathcal{H}_{1}(\triangle)=\\{(\times,\times)\\},\hskip
3.61371pt\mathcal{H}_{2}(\triangle)=\\{(\times,-)\\}.$

######  Remark 2.1.

For the ease of notation, by circulation we write $\bm{x}_{j}=\bm{x}_{j-D}$
when $D<j<2D$.

Definition 2.2 measures the relative location of different types of points in
the location vector, for a specific pair of data vectors. One can easily
verify that given fixed $a,f,D$, it holds that, for $\forall
1\leq\triangle\leq K-1$,

$\displaystyle\begin{aligned}
&|\mathcal{L}_{0}|+|\mathcal{L}_{1}|+|\mathcal{L}_{2}|=|\mathcal{L}_{0}|+|\mathcal{G}_{0}|+|\mathcal{H}_{0}|=a,\\\
&|\mathcal{G}_{0}|+|\mathcal{G}_{1}|+|\mathcal{G}_{2}|=|\mathcal{L}_{2}|+|\mathcal{G}_{2}|+|\mathcal{H}_{2}|=D-f,\\\
&|\mathcal{H}_{0}|+|\mathcal{H}_{1}|+|\mathcal{H}_{2}|=|\mathcal{L}_{1}|+|\mathcal{G}_{1}|+|\mathcal{H}_{1}|=f-a,\end{aligned}$
(8)

which is the intrinsic constraints on the size of above sets.

We are now ready to analyze the expectation and variance of the estimator
$\hat{J}_{0,\pi}$. It is easy to see that $\hat{J}_{0,\pi}$ is still unbiased,
i.e., $\mathbb{E}[\hat{J}_{0,\pi}]=J$, by linearity of expectation. Lemma 2.1
provides an important quantity that leads to $Var[\hat{J}_{0,\pi}]$ as in
Theorem 2.2. The proofs of Lemma 2.1 and Theorem 2.2 are given in Appendix A.1
and Appendix A.2, respectively.

######  Lemma 2.1.

For any $1\leq s<t\leq K$ with $t-s=\triangle$, we have

$\mathbb{E}_{\pi}\big{[}\mathbbm{1}\\{h_{s}(\bm{v})=h_{s}(\bm{w})\\}\mathbbm{1}\\{h_{t}(\bm{v})=h_{t}(\bm{w})\\}\big{]}=\frac{|\mathcal{L}_{0}(\triangle)|+(|\mathcal{G}_{0}(\triangle)|+|\mathcal{L}_{2}(\triangle)|)J}{f+|\mathcal{G}_{0}(\triangle)|+|\mathcal{G}_{1}(\triangle)|},$

where the sets are defined in Definition 2.2 and $h_{s}$, $h_{t}$ are the hash
values as in Algorithm 2.

######  Theorem 2.2.

Under the same setting as in Lemma 2.1, the variance of $\hat{J}_{0,\pi}$ is

$\displaystyle
Var[\hat{J}_{0,\pi}]=\frac{J}{K}+\frac{2\sum_{s=2}^{K}(s-1)\Theta_{K-s+1}}{K^{2}}-J^{2},$

where $\Theta_{\triangle}\triangleq
E_{\pi}\big{[}\mathbbm{1}\\{h_{s}(\bm{v})=h_{s}(\bm{w})\\}\mathbbm{1}\\{h_{t}(\bm{v})=h_{t}(\bm{w})\\}\big{]}$
as in Lemma 2.1 with any $t-s=\triangle$.

From Theorem 2.2, we see that the variance of $\hat{J}_{0,\pi}$ depends on
$a$, $f$, and the size of sets $\mathcal{L}$’s and $\mathcal{G}$’s as in
Definition 2.1, which is determined by the location vector $\bm{x}$. Since we
use the original data vectors without randomly permuting the entries
beforehand, $Var[\hat{J}_{0,\pi}]$ is called “location-dependent” as it is
dependent on the location of non-zero entries of the original data.

##  3 C-MinHash-$(\sigma,\pi)$: Circulant MinHash with the Independent
Initial Permutation

Input: Binary data vector $\bm{v}\in\\{0,1\\}^{D}$, Permutation vectors $\pi$
and $\sigma$: $[D]\rightarrow[D]$

Output: Hash values $h_{1}(\bm{v}),...,h_{K}(\bm{v})$

Initial permutation: $\bm{v}^{\prime}$ = $\sigma(\bm{v})$

For $k=1$ to $K$

Shift $\pi$ circulantly rightwards by $k$ units: $\pi_{k}=\pi_{\rightarrow k}$

$h_{k}(\bm{v})\leftarrow\min_{i:v_{i}^{\prime}\neq 0}\pi_{\rightarrow k}(i)$

End For

Algorithm 3 C-MinHash-$(\sigma,\pi)$

The method C-MinHash-$(\sigma,\pi)$ is summarized in Algorithm 3, which is
very similar to Algorithm 2 for C-MinHash-$(0,\pi)$. This time we apply an
initial permutation $\sigma$ on the data to break whatever structures which
might exist. Similarly, we define the C-MinHash-$(\sigma,\pi)$ estimator of
$J$ as

$\hat{J}_{\sigma,\pi}=\frac{1}{K}\sum_{k=1}^{K}\mathbbm{1}\\{h_{k}(\bm{v})=h_{k}(\bm{w})\\},$
(9)

where $h_{k}$’s are the hash values output by Algorithm 3. Again, for
simplicity we assume $K\leq D$. In the remaining part of this section, we will
present our main theoretical result in Theorem 3.4, that our
C-MinHash-$(\sigma,\pi)$ achieves a uniformly smaller estimation variance than
that of the classical MinHash.

First, by linearity of expectation and the fact that $\sigma$ and $\pi$ are
independent, it is easy to verify that $\hat{J}_{\sigma,\pi}$ is still an
unbiased estimator of $J$. The following Theorem provides the variance of
$\hat{J}_{\sigma,\pi}$, whose proof can be found in Appendix A.3.

######  Theorem 3.1.

Let $a,f$ be defined as in (7). When $0<a<f\leq D$ ($J\notin\\{0,1\\}$), we
have

$\displaystyle
Var[\hat{J}_{\sigma,\pi}]=\frac{J}{K}+\frac{(K-1)\tilde{\mathcal{E}}}{K}-J^{2},$
(10)

where with $l=\max(0,D-2f+a)$, and

$\displaystyle\tilde{\mathcal{E}}=\sum_{\\{l_{0},l_{2},g_{0},g_{1}\\}}\Bigg{\\{}$
$\displaystyle\left(\frac{l_{0}}{f+g_{0}+g_{1}}+\frac{a(g_{0}+l_{2})}{(f+g_{0}+g_{1})f}\right)$
$\displaystyle\times\sum_{s=l}^{D-f-1}\frac{\binom{D-f}{s}}{\binom{D-a-1}{D-f-1}}\frac{\binom{f-a-1}{D-f-s-1}\binom{s}{n_{1}}\binom{D-f-s}{n_{2}}\binom{D-f-s}{n_{3}}\binom{f-a-(D-f-s)}{n_{4}}\binom{a-1}{a-l_{1}-l_{2}}}{\binom{D-1}{a}}\Bigg{\\}}.$
(11)

The feasible set $\\{l_{0},l_{2},g_{0},g_{1}\\}$ satisfies the intrinsic
constraints (8), and

$\displaystyle n_{1}=g_{0}-(D-f-s-g_{1}),\hskip 23.84923ptn_{2}=D-f-s-g_{1},$
$\displaystyle n_{3}=l_{2}-g_{0}+(D-f-s-g_{1}),\hskip
5.78172ptn_{4}=l_{1}-(D-f-s-g_{1}).$

Also, when $a=0$ or $f=a$ ($J=0$ or $J=1$), we have
$Var[\hat{J}_{\sigma,\pi}]=0$.

As expected, since the original locational structure of the data is broken by
the initial permutation $\sigma$, $Var[\hat{J}_{\sigma,\pi}]$ only depends on
($D,f,a$). In the sequel, we investigate the statistical properties of
$Var[\hat{J}_{\sigma,\pi}]$ in detail and present our main result.

Firstly, same as MinHash, Proposition 3.2 states that given $D$ and $f$, the
variance of $\hat{J}_{\sigma,\pi}$ is symmetric about $J=0.5$, as illustrated
in Figure 2, which also confirms that the variance of $\hat{J}_{\sigma,\pi}$
is smaller than the variance of the original MinHash. The proof is provided in
Appendix A.4.

Figure 2: $Var[\hat{J}_{\sigma,\pi}]$ versus $J$, with $D=1000$ and varying
$f$, for $K=500$ (left) and $K=800$ (right). We see that
$Var[\hat{J}_{\sigma,\pi}]$ is symmetric about 0.5 (Proposition 3.2) and
always smaller than $Var[\hat{J}_{MH}]$ (Theorem 3.4).

######  Proposition 3.2 (Symmetry).

$Var[\hat{J}_{\sigma,\pi}]$ is the same for the $(D,f,a)$-data pair and the
$(D,f,f-a)$-data pair, $\forall 0\leq a\leq f\leq D$.

A rigorous comparison of $Var[\hat{J}_{\sigma,\pi}]$ and $Var[\hat{J}_{MH}]$
appears to be a challenging task given the complicated combinatorial form of
$Var[\hat{J}_{\sigma,\pi}]$. The following lemma characterizes an important
property of $\tilde{\mathcal{E}}$ in (11) in Theorem 3.1, stating that it is
monotone in $D$ when both $a$ and $f$ are fixed, as illustrated in Figure 3.

######  Lemma 3.3 (Increasing Increment).

Assume $f>a>0$ are arbitrary and fixed. Denote $\tilde{\mathcal{E}}_{D}$ as in
(11) in Theorem 3.1, with $D$ treated as a parameter. Then we have
$\tilde{\mathcal{E}}_{D+1}>\tilde{\mathcal{E}}_{D}$ for $\forall D\geq f$.

Figure 3: Theoretical $\tilde{\mathcal{E}}$, for $f=10$ (left) and $f=30$
(right). Each dash line represents the corresponding $J^{2}$. We see that
$\tilde{\mathcal{E}}$ is increasing with $D$ and converges to $J^{2}$, which
validates our theory.

Equipped with Lemma 3.3, we arrive at the following main theoretical result of
this work, on the uniform variance reduction of C-MinHash-$(\sigma,\pi)$.

######  Theorem 3.4 (Uniform Superiority).

For any two binary vectors $\bm{v},\bm{w}\in\\{0,1\\}^{D}$ with $J\neq 0$ or
$1$, it holds that
$Var[\hat{J}_{\sigma,\pi}(\bm{v},\bm{w})]<Var[\hat{J}_{MH}(\bm{v},\bm{w})]$.

Figure 4: Variance ratio
$\frac{Var[\hat{J}_{MH}]}{Var[\hat{J}_{\sigma,\pi}]}$, for $D=1000$ and
$K=800$, confirming Proposition 3.5.

Given the uniform superiority, an interesting question is whether
C-MinHash-$(\sigma,\pi)$ is more beneficial in the high similarity region.
Interestingly, in Figure 4 and Theorem 3.5, we show that the improvement of
C-MinHash-$(\sigma,\pi)$ compared with MinHash is actually same for any $J$,
for given $D,f$ and $K$.

######  Proposition 3.5 (Consistent Improvement).

Suppose $f$ is fixed. In terms of $a$, the variance ratio
$\frac{Var[\hat{J}_{MH}(\bm{v},\bm{w})]}{Var[\hat{J}_{\sigma,\pi}(\bm{v},\bm{w})]}$
is constant for any $0<a<f$.

How is the improvement affected by the sparsity (i.e., $f$) and the number of
hashes $K$? In Figure 5, we plot the variance ratio
$\frac{Var[\hat{J}_{MH}]}{Var[\hat{J}_{\sigma,\pi}]}$ with different
combinations $f$ and $K$, given fixed $D$. Note that, by Proposition 3.5, we
do not need to consider $a$ here since the variance ratio is independent of
$a$. The results in Figure 5 once again verify Theorem 3.4, i.e., the variance
ratio is always greater than 1. Specifically, we see that the improvement in
variance increases with $K$ (more hashes) and $f$ (more non-zero entries).

Figure 5: Variance ratio
$\frac{Var[\hat{J}_{MH}]}{Var[\hat{J}_{\sigma,\pi}]}$, for $D=500$ (left) and
$D=1000$ (right).

##  4 Numerical Experiments

In this section, we provide numerical experiments on synthetic as well as
real-world data to validate our theoretical findings and demonstrate that
C-MinHash can indeed lead to smaller Jaccard estimation errors.

###  4.1 Sanity Check: a Simulation Study

A simulation study is conducted on synthetic data to verify the theoretical
variances given by Theorem 2.2 and Theorem 3.1. We simulate $D=128$
dimensional binary vector pairs $(\bm{v},\bm{w})$ with different combinations
of $f$ and $a$. The vectors we generate has a special locational structure,
where the location vector $\bm{x}$ is such that $a$ “$O$”’s are followed by
$(f-a)$ “$\times$”’s and then followed by $(D-f)$ “$-$”’s sequentially. We
plot the empirical and theoretical mean square errors (MSE = variance + bias2)
in Figure 6:

  * •

The theoretical variance agrees with the empirical observation, as the curves
overlap, confirming Theorem 2.2 and Theorem 3.1. The variance reduction
increases with larger $K$.

  * •

$Var[\hat{J}_{\sigma,\pi}]$ (C-MinHash-$(\sigma,\pi)$) is always smaller than
$Var[\hat{J}_{MH}]$, as stated by Theorem 3.4. In contrast,
$Var[\hat{J}_{0,\pi}]$ (C-MinHash-$(0,\pi)$) varies significantly depending on
different data structures.

Figure 6: Simulations for sanity check: Empirical vs. theoretical variance of
$\hat{J}_{0,\pi}$ (C-MinHash-$(0,\pi)$) and $\hat{J}_{\sigma,\pi}$
(C-MinHash-$(\sigma,\pi)$), on synthetic binary data vector pairs with
different data patterns.

###  4.2 Jaccard Estimation on Text and Image Datasets

We test C-MinHash on four commonly used datasets, including two text datasets:
the NIPS full paper dataset from UCI repository (Dua and Graff, 2017), and the
BBC News dataset (Greene and Cunningham, 2006), and two popular image
datasets: the MNIST dataset (LeCun et al., 1998) with hand-written digits, and
the CIFAR dataset (Krizhevsky, 2009) containing natural images. All the
datasets are processed to be binary. For each dataset with $n$ data vectors,
there are in total $n(n-1)/2$ data vector pairs. We estimate the Jaccard
similarities for all the pairs and report the mean absolute errors (MAE). The
results are averaged over 10 independent repetitions, for each dataset, as
shown in Figure 7:

  * •

The MAE of C-MinHash-$(\sigma,\pi)$ is consistently smaller than that of
MinHash, confirming our theoretical claim of improved estimation accuracy
(Theorem 3.4). We also observe that the improvements become more substantial
with larger $K$, which is consistent with the trend in Figure 5.

  * •

Without the initial permutation $\sigma$, the accuracy of C-MinHash-$(0,\pi)$
is affected by the distribution of the original data, and it is worse than
C-MinHash-$(\sigma,\pi)$ on all these four datasets. One can also observe that
the performance of C-MinHash-$(0,\pi)$ on image data seems much worse than
that on text data. We believe this is because the image datasets contain more
structural patterns. This again confirms that the initial permutation $\sigma$
might be needed in practice.

Figure 7: Mean Absolute Error of MinHash and C-MinHash on real-world datasets.

In summary, the simulation study has verified the correctness of our
theoretical findings in Theorem 2.2 and Theorem 3.1. The experiments with
Jaccard estimation on four datasets confirm that C-MinHash is more accurate
than the original MinHash. The initial permutation $\sigma$ is recommended.

##  5 Conclusion

The method of minwise hashing (MinHash), from the seminal works of Broder and
his colleagues, has become standard in industrial practice. One fundamental
reason for its wide applicability is that the binary (0/1) high-dimensional
representation is very convenient and suitable for a wide range of practical
scenarios. These days, (deep) learning for short representations has become
popular, but it cannot replace the practice of using simple binary high-
dimensional representations. It is natural to view the world as a high-
dimensional space and each object is mapped to this space as a sparse vector
with only a small number of non-zero entries. While usually it is challenging
to assign a real-valued weight to each non-zero entry, engineering experience
says that, with such a high-dimensional space, it is often the case that
mainly the locations of the non-zero entries matter. We believe that the
binary representations will still be widely used for a very long time.

To estimate the Jaccard similarity $J$, if one hopes to achieve a strictly
unbiased estimator $\hat{J}$ with the variance following exactly the binomial
distribution, i.e., $\mathbb{E}[\hat{J}]=J$ and
$Var[\hat{J}]=\frac{J(J-1)}{K}$, then one has to use $K$ independent
permutations, where $K$, the number of hashes, can be several hundreds or even
thousands in practice. In this paper, we present the surprising theoretical
results that, with merely 2 permutations, we still obtain an unbiased estimate
of the Jaccard similarity with the variance strictly smaller than that of the
original MinHash. The initial permutation is applied to break whatever
structure the original data may exhibit. The second permutation is re-used $K$
times in a circulant shifting fashion. Obviously the hash samples are no
longer independent, but our analysis has shown that the estimation variance is
actually smaller than that of the original MinHash, as confirmed by numerical
experiments on simulated and real datasets.

Practically speaking, our theoretical results presented in this paper may also
reveal a useful direction for designing hashing methods. For example, in many
applications, using permutation vectors of length (e.g.,) $2^{30}$ might be
sufficient. While it is perhaps unrealistic to store (e.g.,) $K=1024$ such
permutation vectors in the memory, one can easily afford to store two such
permutations (even in the GPU memory). Using perfectly random permutations in
lieu of approximate permutations would be able to simplify the design and
analysis of randomized algorithms and ensure that the practical performance
strictly matches the theory.

Appendix

##  Appendix A Proofs of Technical Results

#### Notations.

In our analysis, we will use $\mathbbm{1}_{s}$ to denote
$\mathbbm{1}\\{h_{s}(\bm{v})=h_{s}(\bm{w})\\}$ in for $\forall 1\leq s\leq K$,
where $h$ is the hash value. Given two data vectors
$\bm{v},\bm{w}\in\\{0,1\\}^{D}$. Recall in (7):
$a=\sum_{i=1}^{D}\mathbbm{1}\\{\bm{v}_{i}=1\text{ and }\bm{w}_{i}=1\\},\
f=\sum_{i=1}^{D}\mathbbm{1}\\{\bm{v}_{i}=1\text{ or }\bm{w}_{i}=1\\}$. Thus,
the Jaccard similarity $J=a/f$. We also define $\tilde{J}=(a-1)/(f-1)$.

######  Definition A.1.

Let $\bm{v},\bm{w}\in\\{0,1\\}^{D}$. Define the location vector as
$\bm{x}\in\\{O,\times,-\\}^{D}$, with $\bm{x}_{i}$ being “$O$”, “$\times$”,
“$-$” when $\bm{v}_{i}=\bm{w}_{i}=1$, $\bm{v}_{i}+\bm{w}_{i}=1$ and
$\bm{v}_{i}=\bm{w}_{i}=0$, respectively.

######  Definition A.2.

For $A,B\in\\{O,\times,-\\}$, let $\\{(i,j):(A,B)|\triangle\\}$ denote a pair
of indices $\\{(i,j):(\bm{x}_{i},\bm{x}_{j})=(A,B),j-i=\triangle\\}$. Define

$\displaystyle\mathcal{L}_{0}(\triangle)=\\{(i,j):(O,O)|\triangle\\},\hskip
7.22743pt\mathcal{L}_{1}(\triangle)=\\{(i,j):(O,\times)|\triangle\\},\hskip
7.22743pt\mathcal{L}_{2}(\triangle)=\\{(i,j):(O,-)|\triangle\\},$
$\displaystyle\mathcal{G}_{0}(\triangle)=\\{(i,j):(-,O)|\triangle\\},\hskip
7.22743pt\mathcal{G}_{1}(\triangle)=\\{(i,j):(-,\times)|\triangle\\}\hskip
7.22743pt,\mathcal{G}_{2}(\triangle)=\\{(i,j):(-,-)|\triangle\\},$
$\displaystyle\mathcal{H}_{0}(\triangle)=\\{(i,j):(\times,O)|\triangle\\},\hskip
7.22743pt\mathcal{H}_{1}(\triangle)=\\{(i,j):(\times,\times)|\triangle\\},\hskip
7.22743pt\mathcal{H}_{2}(\triangle)=\\{(i,j):(\times,-)|\triangle\\}.$

######  Remark A.1.

For the ease of notation, by circulation we write $\bm{x}_{j}=\bm{x}_{j-D}$
when $D<j<2D$.

One can easily verify that given fixed $a,f,D$, it holds that for $\forall
1\leq\triangle\leq K-1$,

$\displaystyle\begin{aligned}
&|\mathcal{L}_{0}(\triangle)|+|\mathcal{L}_{1}(\triangle)|+|\mathcal{L}_{2}(\triangle)|=|\mathcal{L}_{0}(\triangle)|+|\mathcal{G}_{0}(\triangle)|+|\mathcal{H}_{0}(\triangle)|=a,\\\
&|\mathcal{G}_{0}(\triangle)|+|\mathcal{G}_{1}(\triangle)|+|\mathcal{G}_{2}(\triangle)|=|\mathcal{L}_{2}(\triangle)|+|\mathcal{G}_{2}(\triangle)|+|\mathcal{H}_{2}(\triangle)|=D-f,\\\
&|\mathcal{H}_{0}(\triangle)|+|\mathcal{H}_{1}(\triangle)|+|\mathcal{H}_{2}(\triangle)|=|\mathcal{L}_{1}(\triangle)|+|\mathcal{G}_{1}(\triangle)|+|\mathcal{H}_{1}(\triangle)|=f-a.\end{aligned}$
(12)

We will refer this as the intrinsic constraints on the size of above sets.

###  A.1 Proof of Lemma 2.1

######  Lemma 2.1.

For any $1\leq s<t\leq K$ with $t-s=\triangle$, we have

$\mathbb{E}_{\pi}\big{[}\mathbbm{1}\\{h_{s}(\bm{v})=h_{s}(\bm{w})\\}\mathbbm{1}\\{h_{t}(\bm{v})=h_{t}(\bm{w})\\}\big{]}=\frac{|\mathcal{L}_{0}(\triangle)|+(|\mathcal{G}_{0}(\triangle)|+|\mathcal{L}_{2}(\triangle)|)J}{f+|\mathcal{G}_{0}(\triangle)|+|\mathcal{G}_{1}(\triangle)|},$

where the sets are defined in Definition 2.2 and $h_{s}$, $h_{t}$ are the hash
values as in Algorithm 2.

###### Proof.

To check whether a hash sample generated by MinHash collides (under some
permutation $\pi$), it suffices to look at the permuted location vector
$\bm{x}$. If a collision happens, after permuted by $\pi$, type “$O$” point
must appear before the first “$\times$” point. That said, the minimal
permutation index of “$O$” elements must be smaller than that of “$\times$”
elements. If the hash sample does not collide, then the first “$\times$” must
appear before the first “$O$”. Note that “$-$” points does not affect the
collision.

To compute the variance of the estimator, it suffices to compute
$\mathbb{E}[\mathbbm{1}_{s}\mathbbm{1}_{t}]$. Let $\mathcal{L}$, $\mathcal{G}$
and $\mathcal{H}$ be the union of $\mathcal{L}$’s, $\mathcal{G}$’s and
$\mathcal{H}$’s, respectively. In the following, we say that an index $i$
belongs to a set if $i$ is the first term of an element in that set. We have

$|\mathcal{L}|=a,\quad|\mathcal{H}|=f-a,\quad|\mathcal{G}|=D-f.$

One key observation is that, for a pair $(i,j)$ in above sets, the hash index
$\pi_{s}(i)$ will be the hash index of $\pi_{t}(j)$. We begin by decomposing
the expectation into

$\displaystyle\mathbb{E}[\mathbbm{1}_{s}\mathbbm{1}_{t}]$
$\displaystyle=P[\text{collision}\ s,\text{collision}\ t]$
$\displaystyle=\sum_{i_{s}^{*}\in\mathcal{L}}P[\text{collision}\ s\ \text{at}\
i_{s}^{*},\text{collision}\ t]$
$\displaystyle=\sum_{p=0}^{2}\sum_{i_{s}^{*}\in\mathcal{L}_{p}}P[\text{collision}\
s\ \text{at}\ i_{s}^{*},\text{collision}\ t].$ (13)

where $i_{s}^{*}$ is the location of the original “$O$” in vector $x$ that
collides for $s$-th hash sample. It is different from the exact location of
collision in $x(\pi_{s})$. Note that the permutation is totally random, so the
location of collision is independent of $\mathbbm{1}_{s}$, and uniformly
distributed among all type “$O$” pairs.

1) When $i_{s}^{*}\in\mathcal{L}_{0}$. In this case, the minimum index of the
type “$O$” pair in $x(\pi_{s})$, $\pi_{s}(i_{s}^{*})$, is shifted to another
type “$O$” pair in $x(\pi_{t})$. Therefore, the indices of pairs with the
first element being “$O$” or “$\times$” originally in $x(\pi_{s})$ will still
be greater than $\pi_{t}(i_{s}^{*})$. If sample $s$ collides at $i_{s}^{*}$,
hash sample $t$ will collide when

  1. 1.

All the points in $\mathcal{G}_{1}$, after permutation $\pi_{s}$, is greater
than $\pi_{s}(i_{s}^{*})$. In this case, regardless of the permuted
$\mathcal{G}_{0}$, hash $t$ will always collide.

  2. 2.

There exist points in $\mathcal{G}_{1}$ after permutation $\pi_{s}$ smaller
than $\pi_{s}(i_{s}^{*})$, and also points in $\mathcal{G}_{0}$ that is
smaller than the minimum of permuted $\mathcal{G}_{1}$.

Consequently, we have for $i_{s}^{*}\in\mathcal{L}_{0}$,

$\displaystyle P[\text{collision}\ s\ \text{at}\ i_{s}^{*},\text{collision}\
t]$ $\displaystyle=P[\pi_{s}(i_{s}^{*})<\pi_{s}(i),\forall
i\in\mathcal{H}\cup\mathcal{L}/i_{s}^{*},\ \text{and}\
\min_{j\in\mathcal{G}_{1}}\pi_{s}(j)>\pi_{s}(i_{s}^{*})]$ $\displaystyle\hskip
43.36243pt+P[\pi_{s}(i_{s}^{*})<\pi_{s}(i),\forall
i\in\mathcal{H}\cup\mathcal{L}/i_{s}^{*},\ \text{and}\
\min_{j\in\mathcal{G}_{0}}\pi_{s}(j)<\min_{j\in\mathcal{G}_{1}}\pi_{s}(j)<\pi_{s}(i_{s}^{*})]$
$\displaystyle=\frac{1}{a}\cdot\frac{a}{f+|\mathcal{G}_{1}|}+\frac{|\mathcal{G}_{0}|}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{G}_{1}|}{f+|\mathcal{G}_{1}|}\cdot\frac{a}{f}\cdot\frac{1}{a}$
$\displaystyle=\frac{1}{f+|\mathcal{G}_{1}|}+\frac{|\mathcal{G}_{0}|\cdot|\mathcal{G}_{1}|}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f+|\mathcal{G}_{1}|)f}.$
(14)

This probability holds for $\forall i_{s}^{*}\in\mathcal{L}_{0}$.

2) When $i_{s}^{*}\in\mathcal{L}_{1}$. Similarly, we consider the condition
where $i_{s}^{*}\in\mathcal{L}_{1}$, and both hash samples collide. In this
case, $\pi_{s}(i_{s}^{*})$ would be shifted to a “$\times$” pair in
$x(\pi_{t})$. That is, the indices of pairs with the first element being “$O$”
or “$\times$” originally in $x(\pi_{s})$ will all become greater than
$\pi_{s}(i_{s}^{*})$, which now is the location of a “$\times$” pair in
$x(\pi_{t})$. Thus, to make hash $t$ collide, we will need:

  * •

At least one point from $\mathcal{G}_{0}$ is smaller than any other points in
$\mathcal{H}\cup\mathcal{L}\cup\mathcal{G}_{1}$ after permutation $\pi_{s}$.

Therefore, for any $i_{s}^{*}\in\mathcal{L}_{1}$,

$\displaystyle P[\text{collision}\ s\ \text{at}\ i_{s}^{*},\text{collision}\
t]$ $\displaystyle=P[\pi_{s}(i_{s}^{*})<\pi_{s}(i),\forall
i\in\mathcal{H}\cup\mathcal{L}/i_{s}^{*},\ \text{and}\
\min_{j\in\mathcal{G}_{0}}\pi_{s}(j)<\min\\{\pi_{s}(i_{s}^{*}),\min_{j\in\mathcal{G}_{1}}\pi_{s}(j)\\}]$
$\displaystyle=\frac{|\mathcal{G}_{0}|}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}\cdot\frac{a}{f}\cdot\frac{1}{a}$
$\displaystyle=\frac{|\mathcal{G}_{0}|}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)f},$
(15)

which is true for $\forall i_{s}^{*}\in\mathcal{L}_{1}$.

3) When $i_{s}^{*}\in\mathcal{L}_{2}$.

In this scenario, $\pi_{s}(i_{s}^{*})$ would be shifted to a “$-$” pair in
$x(\pi_{t})$. Therefore, if hash $s$ collides, hash $t$ will also collide
when:

  * •

After applying $\pi_{s}$, the minimum of
$\mathcal{L}_{0}\cup\mathcal{H}_{0}\cup\mathcal{G}_{0}$ is smaller than the
minimum of $\mathcal{L}_{1}\cup\mathcal{H}_{1}\cup\mathcal{G}_{1}$.

Thus, we obtain that for any $i_{s}^{*}\in\mathcal{L}_{2}$,

$\displaystyle P[\text{collision}\ s\ \text{at}\ i_{s}^{*},\text{collision}\
t]$ $\displaystyle=P[\pi_{s}(i_{s}^{*})<\pi_{s}(i),\forall
i\in\mathcal{H}\cup\mathcal{L}/i_{s}^{*},\ \text{and}\
\min_{j\in\mathcal{L}_{0}\cup\mathcal{G}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)<\min_{j\in\mathcal{L}_{1}\cup\mathcal{G}_{1}\cup\mathcal{H}_{1}}\pi_{s}(j)]$
$\displaystyle\triangleq P[\Omega].$

Let $\mathbbm{1}_{s,i_{s}^{*}}$ denote the event
$\\{\pi_{s}(i_{s}^{*})<\pi_{s}(i),\forall
i\in\mathcal{H}\cup\mathcal{L}/i_{s}^{*}\\}$. Then $\Omega$ can be separated
into the following several cases:

  1. 1.

$\Omega_{1}$: $\mathbbm{1}_{s,i_{s}^{*}}$,
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)<\min_{j\in\mathcal{L}_{1}\cup\mathcal{H}_{1}}\pi_{s}(j)$,
and
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)<\min_{j\in\mathcal{G}_{1}}\pi_{s}(j)$.

  2. 2.

$\Omega_{2}$: $\mathbbm{1}_{s,i_{s}^{*}}$,
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)<\min_{j\in\mathcal{L}_{1}\cup\mathcal{H}_{1}}\pi_{s}(j)$,
and
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)>\min_{j\in\mathcal{G}_{1}}\pi_{s}(j)>\min_{j\in\mathcal{G}_{0}}\pi_{s}(j)>\pi_{s}(i_{s}^{*})$.

  3. 3.

$\Omega_{3}$: $\mathbbm{1}_{s,i_{s}^{*}}$,
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)<\min_{j\in\mathcal{L}_{1}\cup\mathcal{H}_{1}}\pi_{s}(j)$,
and
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)>\min_{j\in\mathcal{G}_{1}}\pi_{s}(j)>\pi_{s}(i_{s}^{*})>\min_{j\in\mathcal{G}_{0}}\pi_{s}(j)$.

  4. 4.

$\Omega_{4}$: $\mathbbm{1}_{s,i_{s}^{*}}$,
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)<\min_{j\in\mathcal{L}_{1}\cup\mathcal{H}_{1}}\pi_{s}(j)$,
and
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)>\pi_{s}(i_{s}^{*})>\min_{j\in\mathcal{G}_{1}}\pi_{s}(j)>\min_{j\in\mathcal{G}_{0}}\pi_{s}(j)$.

  5. 5.

$\Omega_{5}$: $\mathbbm{1}_{s,i_{s}^{*}}$,
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)>\min_{j\in\mathcal{L}_{1}\cup\mathcal{H}_{1}}\pi_{s}(j)$,
and
$\pi_{s}(i_{s}^{*})<\min_{j\in\mathcal{G}_{0}}\pi_{s}(j)<\min_{j\in\mathcal{L}_{1}\cup\mathcal{H}_{1}\cup\mathcal{G}_{1}}\pi_{s}(j)$.

  6. 6.

$\Omega_{6}$: $\mathbbm{1}_{s,i_{s}^{*}}$,
$\min_{j\in\mathcal{L}_{0}\cup\mathcal{H}_{0}}\pi_{s}(j)>\min_{j\in\mathcal{L}_{1}\cup\mathcal{H}_{1}}\pi_{s}(j)$,
and
$\min_{j\in\mathcal{G}_{0}}\pi_{s}(j)<\pi_{s}(i_{s}^{*})<\min_{j\in\mathcal{L}_{1}\cup\mathcal{H}_{1}\cup\mathcal{G}_{1}}\pi_{s}(j)$.

We can compute the probability of each event as

$\displaystyle P[\Omega_{1}]$
$\displaystyle=\frac{1}{a}\cdot\frac{a}{f+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|}{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|+|\mathcal{G}_{1}|},$
$\displaystyle=\frac{a-|\mathcal{G}_{0}|}{(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)},$
$\displaystyle P[\Omega_{2}]$
$\displaystyle=\frac{1}{a}\cdot\frac{a}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{G}_{0}|}{|\mathcal{G}_{0}|+|\mathcal{G}_{1}|+|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}$
$\displaystyle\hskip
57.81621pt\cdot\frac{|\mathcal{G}_{1}|}{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|}{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}$
$\displaystyle=\frac{1}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{G}_{0}|}{f}\cdot\frac{|\mathcal{G}_{1}|}{f-|\mathcal{G}_{0}|}\cdot\frac{a-|\mathcal{G}_{0}|}{f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|}$
$\displaystyle=\frac{|\mathcal{G}_{0}|\cdot|\mathcal{G}_{1}|\cdot(a-|\mathcal{G}_{0}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)f},$
$\displaystyle P[\Omega_{3}]$
$\displaystyle=\frac{|\mathcal{G}_{0}|}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}\cdot\frac{1}{f+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{G}_{1}|}{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|}{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}$
$\displaystyle=\frac{|\mathcal{G}_{0}|\cdot|\mathcal{G}_{1}|\cdot(a-|\mathcal{G}_{0}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)},$
$\displaystyle P[\Omega_{4}]$
$\displaystyle=\frac{|\mathcal{G}_{0}|}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{G}_{1}|}{f+|\mathcal{G}_{1}|}\cdot\frac{1}{f}\cdot\frac{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|}{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}$
$\displaystyle=\frac{|\mathcal{G}_{0}|\cdot|\mathcal{G}_{1}|\cdot(a-|\mathcal{G}_{0}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)f},$
$\displaystyle P[\Omega_{5}]$
$\displaystyle=\frac{1}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}\cdot\frac{|\mathcal{G}_{0}|}{|\mathcal{G}_{0}|+|\mathcal{G}_{1}|+|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}\cdot\frac{|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}$
$\displaystyle=\frac{|\mathcal{G}_{0}|\cdot(f-a-|\mathcal{G}_{1}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)f},$
$\displaystyle P[\Omega_{6}]$
$\displaystyle=\frac{|\mathcal{G}_{0}|}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}\cdot\frac{1}{f}\cdot\frac{|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}{|\mathcal{L}_{0}|+|\mathcal{H}_{0}|+|\mathcal{L}_{1}|+|\mathcal{H}_{1}|}$
$\displaystyle=\frac{|\mathcal{G}_{0}|\cdot(f-a-|\mathcal{G}_{1}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)f}.$

Note that

$\displaystyle P[\Omega_{2}]+P[\Omega_{3}]+P[\Omega_{4}]$
$\displaystyle=\frac{|\mathcal{G}_{0}|\cdot|\mathcal{G}_{1}|\cdot(a-|\mathcal{G}_{0}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)}\left[\frac{1}{(f-|\mathcal{G}_{0}|)f}+\frac{1}{(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)}+\frac{1}{f(f+|\mathcal{G}_{1}|)}\right]$
$\displaystyle=\frac{|\mathcal{G}_{0}|\cdot|\mathcal{G}_{1}|\cdot(a-|\mathcal{G}_{0}|)(3f-|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)f(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)}.$

Summing up all the terms together, we obtain $P[\Omega]$ as

$\displaystyle\sum_{n=1}^{6}P[\Omega_{n}]$
$\displaystyle=\frac{f(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)(a-|\mathcal{G}_{0}|)+|\mathcal{G}_{0}||\mathcal{G}_{1}|(a-|\mathcal{G}_{0}|)(3f-|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)f}$
$\displaystyle\hskip
43.36243pt+\frac{2|\mathcal{G}_{0}|(f-a-|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)f}$
$\displaystyle=\frac{(a-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)+2|\mathcal{G}_{0}|(f-a-|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)f}$
$\displaystyle=\frac{(a+|\mathcal{G}_{0}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|-|\mathcal{G}_{1}|)(f-|\mathcal{G}_{0}|)(f+|\mathcal{G}_{1}|)f}$
$\displaystyle=\frac{a+|\mathcal{G}_{0}|}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)f},$
(16)

which holds for $\forall i_{s}^{*}\in\mathcal{L}_{2}$. Now combining (14),
(15), (16) with (13), we obtain

$\displaystyle\mathbb{E}[\mathbbm{1}_{s}\mathbbm{1}_{t}]$
$\displaystyle=\frac{|\mathcal{L}_{0}|}{f+|\mathcal{G}_{1}|}+\frac{|\mathcal{G}_{0}||\mathcal{G}_{1}||\mathcal{L}_{0}|}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)(f+|\mathcal{G}_{1}|)f}+\frac{|\mathcal{G}_{0}||\mathcal{L}_{1}|}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)f}+\frac{(a+|\mathcal{G}_{0}|)|\mathcal{L}_{2}|}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)f}.$
(17)

Here, recall that the sets are associated with all $1\leq s<t\leq K$ such that
$\triangle=t-s$. Using the intrinsic constraints (12), after some calculation
we can simplify (17) as

$\mathbb{E}_{\pi}[\mathbbm{1}_{s}\mathbbm{1}_{t}]=\frac{|\mathcal{L}_{0}|}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}+\frac{a(|\mathcal{G}_{0}|+|\mathcal{L}_{2}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)f},$

which completes the proof. ∎

###  A.2 Proof of Theorem 2.2

######  Theorem 2.2.

Under the same setting as in Lemma 2.1, the variance of $\hat{J}_{0,\pi}$ is

$\displaystyle
Var[\hat{J}_{0,\pi}]=\frac{J}{K}+\frac{2\sum_{s=2}^{K}(s-1)\Theta_{K-s+1}}{K^{2}}-J^{2},$

where $\Theta_{\triangle}\triangleq
E_{\pi}\big{[}\mathbbm{1}\\{h_{s}(\bm{v})=h_{s}(\bm{w})\\}\mathbbm{1}\\{h_{t}(\bm{v})=h_{t}(\bm{w})\\}\big{]}$
as in Lemma 2.1 with any $t-s=\triangle$.

###### Proof.

By the expansion of variance formula, since
$\mathbb{E}[\mathbbm{1}_{s}^{2}]=\mathbb{E}[\mathbbm{1}_{s}]=J$, we have

$Var[\hat{J}_{0,\pi}]=\frac{J}{K}+\frac{\sum_{s=1}^{K}\sum_{t\neq
s}^{K}\mathbb{E}[\mathbbm{1}_{s}\mathbbm{1}_{t}]}{K^{2}}-J^{2}.$ (18)

Note here that for $\forall t>s$, the $t$-th hash sample uses $\pi_{t}$ as the
permutation, which is shifted rightwards by $\triangle=t-s$ from $\pi_{s}$.
Thus, we have
$\mathbb{E}[\mathbbm{1}_{s}\mathbbm{1}_{t}]=\mathbb{E}[\mathbbm{1}_{s-i}\mathbbm{1}_{t-i}]$
for $\forall 0<i<s\wedge t$, which implies
$\mathbb{E}[\mathbbm{1}_{s}\mathbbm{1}_{t}]=\mathbb{E}[\mathbbm{1}_{1}\mathbbm{1}_{t-s+1}]$,
$\forall s<t$. Since by assumption $K\leq D$, we have

$\displaystyle\sum_{s}^{K}\sum_{t\neq
s}^{K}\mathbb{E}[\mathbbm{1}_{s}\mathbbm{1}_{t}]$
$\displaystyle=2\mathbbm{E}\big{[}(\mathbbm{1}_{1}\mathbbm{1}_{2}+\mathbbm{1}_{1}\mathbbm{1}_{3}+...+\mathbbm{1}_{1}\mathbbm{1}_{K})+(\mathbbm{1}_{2}\mathbbm{1}_{3}+...+\mathbbm{1}_{2}\mathbbm{1}_{K})+...+\mathbbm{1}_{K-1}\mathbbm{1}_{K}\big{]}$
$\displaystyle=2\mathbb{E}\big{[}(\mathbbm{1}_{1}\mathbbm{1}_{2}+\mathbbm{1}_{1}\mathbbm{1}_{3}+...+\mathbbm{1}_{1}\mathbbm{1}_{K})+(\mathbbm{1}_{1}\mathbbm{1}_{2}+...+\mathbbm{1}_{1}\mathbbm{1}_{K-1})+...+\mathbbm{1}_{1}\mathbbm{1}_{2}\big{]}$
$\displaystyle=2\sum_{s=2}^{K}(s-1)\mathbb{E}[\mathbbm{1}_{1}\mathbbm{1}_{K-s+2}]$
$\displaystyle\triangleq 2\sum_{s=2}^{K}(s-1)\Theta_{K-s+1}.$ (19)

Finally, integrating (18), (19) and Lemma 2.1 completes the proof. ∎

###  A.3 Proof of Theorem 3.1

######  Theorem 3.1.

Let $a,f$ be defined as in (7). When $0<a<f\leq D$ ($J\notin\\{0,1\\}$), we
have

$\displaystyle
Var[\hat{J}_{\sigma,\pi}]=\frac{J}{K}+\frac{(K-1)\tilde{\mathcal{E}}}{K}-J^{2},$
(20)

where with $l=\max(0,D-2f+a)$, and

$\displaystyle\tilde{\mathcal{E}}=\sum_{\\{l_{0},l_{2},g_{0},g_{1}\\}}\Bigg{\\{}$
$\displaystyle\left(\frac{l_{0}}{f+g_{0}+g_{1}}+\frac{a(g_{0}+l_{2})}{(f+g_{0}+g_{1})f}\right)$
$\displaystyle\times\sum_{s=l}^{D-f-1}\frac{\binom{D-f}{s}}{\binom{D-a-1}{D-f-1}}\frac{\binom{f-a-1}{D-f-s-1}\binom{s}{n_{1}}\binom{D-f-s}{n_{2}}\binom{D-f-s}{n_{3}}\binom{f-a-(D-f-s)}{n_{4}}\binom{a-1}{a-l_{1}-l_{2}}}{\binom{D-1}{a}}\Bigg{\\}}.$
(21)

The feasible set $\\{l_{0},l_{2},g_{0},g_{1}\\}$ satisfies the intrinsic
constraints (8), and

$\displaystyle n_{1}=g_{0}-(D-f-s-g_{1}),\hskip 23.84923ptn_{2}=D-f-s-g_{1},$
$\displaystyle n_{3}=l_{2}-g_{0}+(D-f-s-g_{1}),\hskip
5.78172ptn_{4}=l_{1}-(D-f-s-g_{1}).$

Also, when $a=0$ or $f=a$ ($J=0$ or $J=1$), we have
$Var[\hat{J}_{\sigma,\pi}]=0$.

###### Proof.

Similar to the proof of Theorem 2.2, we denote
$\Theta_{\triangle}=\mathbb{E}_{\sigma,\pi}[\mathbbm{1}_{s}\mathbbm{1}_{t}]$
with $|t-s|=\triangle$. Note that now the expectation is taken w.r.t. both two
independent permutations $\sigma$ and $\pi$. Since $\sigma$ is random, we know
that $\Theta_{1}=\Theta_{2}=\dots=\Theta_{K-1}$. Then by the variance formula,
we have

$\displaystyle
Var[\hat{J}_{\sigma,\pi}]=\frac{J^{2}}{K}-\frac{(K-1)\Theta_{1}}{K}-J^{2}$
(22)

Hence, it suffices to consider $\Theta_{1}$. In this proof, we will set
$\triangle=1$ and drop the notation $\triangle$ for conciseness, and denote
$\tilde{\mathcal{E}}=\Theta_{1}$ from now on. First, we note that Lemma 2.1
gives the desired quantity conditional on $\sigma$. By the law of total
probability, we have

$\displaystyle\tilde{\mathcal{E}}=\mathbb{E}_{\sigma}\left[\frac{|\mathcal{L}_{0}|}{f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|}+\frac{a(|\mathcal{G}_{0}|+|\mathcal{L}_{2}|)}{(f+|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)f}\right],$
(23)

where the sizes of sets are random depending on the initial permutation
$\sigma$ (i.e. counted after permuting by $\sigma$). As a result, the problem
turns into deriving the distribution of
$|\mathcal{L}_{0}|,|\mathcal{L}_{1}|,|\mathcal{L}_{2}|,|\mathcal{G}_{0}|$ and
$|\mathcal{G}_{1}|$ under random permutation $\sigma$, and then taking
expectation of (23) with respect to this additional randomness.

When $a=0$, we know that
$|\mathcal{L}_{0}|=|\mathcal{L}_{2}|=|\mathcal{G}_{0}|=0$, hence the
expectation $\tilde{\mathcal{E}}$ is trivially 0. Thus, the
$Var[\hat{J}_{\sigma,\pi}]=0$. When $f=a$, $|\mathcal{G}_{1}|=0$, and the
constraint on the sets becomes

$\displaystyle|\mathcal{L}_{0}|+|\mathcal{G}_{0}|=|\mathcal{L}_{0}|+|\mathcal{L}_{2}|=f,$
$\displaystyle|\mathcal{L}_{2}|+|\mathcal{G}_{2}|=|\mathcal{G}_{0}|+|\mathcal{G}_{2}|=D-f.$

Then (23) becomes

$\displaystyle\tilde{\mathcal{E}}$
$\displaystyle=\mathbb{E}_{\sigma}\left[\frac{|\mathcal{L}_{0}|}{f+|\mathcal{G}_{0}|}+\frac{|\mathcal{G}_{0}|+|\mathcal{L}_{2}|}{f+|\mathcal{G}_{0}|}\right]$
$\displaystyle=\mathbb{E}_{\sigma}\left[\frac{|\mathcal{L}_{0}|+|\mathcal{G}_{0}|+|\mathcal{L}_{2}|}{f+|\mathcal{G}_{0}|}\right]\equiv
1.$

Therefore, when $f=a$, we also have $Var[\hat{J}_{\sigma,\pi}]=0$.

Next, we will consider the general case where $0<a<f\leq D$. This can be
considered as a combinatorial problem where we randomly arrange $a$ type
“$O$”, $(f-a)$ type “$\times$” and $(D-f)$ type “$-$” points in a circle. We
are interested in the distribution of the number of $\\{O,O\\}$,
$\\{O,\times\\}$, $\\{O,-\\}$, $\\{-,O\\}$ and $\\{-,\times\\}$ pairs of
consecutive points in clockwise direction. We consider this procedure in two
steps, where we first place “$\times$” and “$-$” points, and then place “$O$”
points.

Step 1. Randomly place “$\times$” and “$-$” points on the circle.

In this step, four types of pairs may appear: $\\{-,-\\}$, $\\{-,\times\\}$,
$\\{\times,\times\\}$ and $\\{\times,-\\}$. Denote $\mathcal{C}_{1}$,
$\mathcal{C}_{2}$, $\mathcal{C}_{3}$ and $\mathcal{C}_{4}$ as the collections
of above pairs. Since

$\displaystyle|\mathcal{C}_{1}|+|\mathcal{C}_{4}|=|\mathcal{C}_{1}|+|\mathcal{C}_{2}|=D-f,$
$\displaystyle|\mathcal{C}_{2}|+|\mathcal{C}_{3}|=|\mathcal{C}_{2}|+|\mathcal{C}_{4}|=f-a,$

knowing the size of one set gives information on the size of all the sets.
Thus, we can characterize the joint distribution by analyzing the distribution
of $|\mathcal{C}_{1}|$. First, placing $(D-f)$ “$-$” points on a circle leads
to $(D-f)$ number of $\\{-,-\\}$ pairs. This $(D-f)$ elements can be regarded
as the borders that split the circle into $(D-f)$ bins. Now, we randomly throw
$(f-a)$ number of “$\times$” points into these bins. If at least one
“$\times$” falls into one bin, then the number of $\\{-,-\\}$ pairs
($|\mathcal{C}_{1}|$) would reduce by $1$, while $|\mathcal{C}_{2}|$ and
$|\mathcal{C}_{4}|$ would increase by $1$. If $z$ “$\times$” points fall into
one bin, then the number of $\\{\times,\times\\}$ ($|\mathcal{C}_{3}|$) would
increase by $(z-1)$. Notice that since $s\leq D-f$ and $D-f-s\leq f-a$, we
have $\max(0,D-2f+a)\leq s\leq D-f$. Consequently, for $s$ in this range, we
have

$\displaystyle P\Big{\\{}|\mathcal{C}_{1}|=s\Big{\\}}$
$\displaystyle=P\Big{\\{}|\mathcal{C}_{1}|=s,|\mathcal{C}_{3}|=f-a-(D-f-s)\Big{\\}}$
$\displaystyle=\frac{\binom{D-f}{D-f-s}\binom{f-a-1}{D-f-s-1}}{\binom{D-a-1}{D-f-1}}$
$\displaystyle=\frac{\binom{D-f}{s}\binom{f-a-1}{D-f-s-1}}{\binom{D-a-1}{D-f-1}}.$
(24)

The second line is due to the stars and bars problem that the number of ways
to place $n$ unlabeled balls in $m$ distinct bins such that each bin has at
least one ball is $\binom{n-1}{m-1}$. For $|\mathcal{C}_{1}|=s$, we need
$n=f-a$ (number of “$\times$”) and $m=|\mathcal{C}_{2}|=D-f-s$. Moreover, the
number of ways to place $n$ balls in $m$ distinct bins is
$\binom{n+m-1}{m-1}$. When counting the total number of possibilities, we have
$n=f-a$ and $m=D-f$. This gives the denominator. We notice that (24) is
actually a hyper-geometric distribution.

Step 2. Randomly place “$O$” points on the circle.

We have the probability mass function

$\displaystyle P[\Psi]$ $\displaystyle\triangleq
P\Big{\\{}|\mathcal{L}_{1}|=l_{1},|\mathcal{L}_{2}|=l_{2},|\mathcal{G}_{0}|=g_{0},|\mathcal{G}_{1}|=g_{1}\Big{\\}}$
$\displaystyle=\sum_{s=D-2f+a}^{D-f-1}P\Big{\\{}|\mathcal{L}_{1}|=l_{1},|\mathcal{L}_{2}|=l_{2},|\mathcal{G}_{0}|=g_{0},|\mathcal{G}_{1}|=g_{1}\Big{|}|\mathcal{C}_{1}|=s\Big{\\}}P\Big{\\{}|\mathcal{C}_{1}|=s\Big{\\}}.$
(25)

Now it remains to compute the distribution conditional on $|\mathcal{C}_{1}|$.
Here we drop $|\mathcal{L}_{0}|$ because it is intrinsically determined by
$|\mathcal{L}_{1}|$ and $|\mathcal{L}_{2}|$. Again, given a placement of all
“$\times$” and “$-$” points, each consecutive pair can be regarded as a
distinct bin. Therefore, now the problem is to randomly throw $a$ type “$O$”
points into that $(D-a)$ bins, given that we have placed type “$\times$” and
“$-$” points on the circle with $|\mathcal{C}_{1}|=s$ (and thus
$|\mathcal{C}_{2}|=|\mathcal{C}_{3}|=D-f-s$ and
$|\mathcal{C}_{4}|=f-a-(D-f-s)$ are also determined correspondingly). In the
following, we count the number of “$O$” points that fall in $\mathcal{C}_{i}$,
$i=1,2,3,4$, to make the event $\Psi$ happen. Note that

  * •

When at least one “$O$” point falls into $\mathcal{C}_{1}$ (between
$\\{-,-\\}$), $|\mathcal{L}_{2}|$ and $|\mathcal{G}_{0}|$ increase by $1$.

  * •

When at least one “$O$” point falls into $\mathcal{C}_{2}$ (between
$\\{-,\times\\}$), $|\mathcal{L}_{1}|$ and $|\mathcal{G}_{0}|$ increase by
$1$, while $|\mathcal{G}_{1}|$ decreases by $1$.

  * •

When at least one “$O$” point falls into $\mathcal{C}_{3}$ (between
$\\{\times,-\\}$), $|\mathcal{L}_{2}|$ increases by $1$.

  * •

When at least one “$O$” point falls into $\mathcal{C}_{4}$ (between
$\\{\times,\times\\}$), $|\mathcal{L}_{1}|$ increases by $1$.

We denote the number of bins in $\mathcal{C}_{i}$, $i=1,2,3,4$ that contain at
least one “$O$” point as $n_{1},n_{2},n_{3},n_{4}$, respectively. As a result
of above reasoning, in the event $\Psi$, we have

$\begin{cases}n_{1}+n_{3}=l_{2},\\\ n_{2}+n_{4}=l_{1},\\\
n_{1}+n_{2}=g_{0},\\\ D-f-s-n_{2}=g_{1}.\end{cases}$

Solving the equations gives

$\begin{cases}n_{1}=g_{0}-(D-f-s-g_{1}),\\\ n_{2}=D-f-s-g_{1},\\\
n_{3}=l_{2}-g_{0}+(D-f-s-g_{1}),\\\ n_{4}=l_{1}-(D-f-s-g_{1}).\end{cases}$

Note that $\sum_{i=1}^{4}{n_{i}}=l_{1}+l_{2}$. Therefore, event $\Psi$ is
equivalent to randomly pick $n_{1},n_{2},n_{3}$ and $n_{4}$ bins in
$\mathcal{C}_{1}$,…,$\mathcal{C}_{4}$, and then distribute $a$ type “$O$”
points in these $(l_{1}+l_{2})$ bins such that each bin contains at least one
“$O$”. Hence, we obtain

$\displaystyle
P\Big{\\{}|\mathcal{L}_{1}|=l_{1},|\mathcal{L}_{2}|=l_{2},|\mathcal{G}_{0}|=g_{0},|\mathcal{G}_{1}|=g_{1}\Big{|}|\mathcal{C}_{1}|=s\Big{\\}}$
$\displaystyle=\frac{\binom{s}{n_{1}}\binom{D-f-s}{n_{2}}\binom{D-f-s}{n_{3}}\binom{f-a-(D-f-s)}{n_{4}}\binom{a-1}{l_{1}+l_{2}-1}}{\binom{D-1}{D-a-1}}$
$\displaystyle=\frac{\binom{s}{n_{1}}\binom{D-f-s}{n_{2}}\binom{D-f-s}{n_{3}}\binom{f-a-(D-f-s)}{n_{4}}\binom{a-1}{a-l_{1}-l_{2}}}{\binom{D-1}{a}},$
(26)

which is also multi-variate hyper-geometric distributed. Now combining (24),
(25) and (26), we obtain the joint distribution of
$|\mathcal{L}_{0}|,|\mathcal{L}_{1}|,|\mathcal{L}_{2}|,|\mathcal{G}_{0}|$ and
$|\mathcal{G}_{1}|$ as

$\displaystyle
P\Big{\\{}|\mathcal{L}_{1}|=l_{1},|\mathcal{L}_{2}|=l_{2},|\mathcal{G}_{0}|=g_{0},|\mathcal{G}_{1}|=g_{1}\Big{\\}}$
$\displaystyle=\sum_{s=\max(0,D-2f+a)}^{D-f-1}\frac{\binom{s}{n_{1}}\binom{D-f-s}{n_{2}}\binom{D-f-s}{n_{3}}\binom{f-a-(D-f-s)}{n_{4}}\binom{a-1}{a-l_{1}-l_{2}}}{\binom{D-1}{a}}\cdot\frac{\binom{D-f}{s}\binom{f-a-1}{D-f-s-1}}{\binom{D-a-1}{D-f-1}}.$
(27)

Now let $\Xi$ be the feasible set of $(l_{0},l_{1},g_{0},g_{1},g_{2})$ that
satisfies the intrinsic constraints (12). The desired expectation w.r.t. both
$\pi$ and $\sigma$ can thus be written as

$\displaystyle\tilde{\mathcal{E}}$
$\displaystyle=\sum_{\Xi}\left(\frac{l_{0}}{f+g_{0}+g_{1}}+\frac{a(g_{0}+l_{2})}{(f+g_{0}+g_{1})f}\right)\cdot$
$\displaystyle\hskip
14.45377pt\left(\sum_{s=\max(0,D-2f+a)}^{D-f-1}\frac{\binom{s}{n_{1}}\binom{D-f-s}{n_{2}}\binom{D-f-s}{n_{3}}\binom{f-a-(D-f-s)}{n_{4}}\binom{a-1}{a-l_{1}-l_{2}}}{\binom{D-1}{a}}\cdot\frac{\binom{D-f}{s}\binom{f-a-1}{D-f-s-1}}{\binom{D-a-1}{D-f-1}}\right).$

The desired result can then follows by (22). ∎

###  A.4 Proof of Proposition 3.2

######  Proposition 3.2 (Symmetry).

$Var[\hat{J}_{\sigma,\pi}]$ is the same for the $(D,f,a)$-data pair and the
$(D,f,f-a)$-data pair, $\forall 0\leq a\leq f\leq D$.

###### Proof.

For fixed $a,f,D$, let $\tilde{\mathcal{E}}_{1}$ be the expectation defined in
Theorem 3.1 for $(\bm{v}_{1},\bm{w}_{1})$, and $\tilde{\mathcal{E}}_{2}$ be
that for $(\bm{v}_{2},\bm{w}_{2})$. From Theorem 3.1 we know that

$\displaystyle\tilde{\mathcal{E}}_{1}=\mathbb{E}_{(l_{0},l_{2},g_{0},g_{1})}\Big{[}\frac{l_{0}}{f+g_{0}+g_{1}}+\frac{a(g_{0}+l_{2})}{(f+g_{0}+g_{1})f}\Big{]},$

where $(l_{0},l_{2},g_{0},g_{1})$ follows the distribution of
$(|\mathcal{L}_{0}|,|\mathcal{L}_{2}|,|\mathcal{G}_{0}|,|\mathcal{G}_{1}|)$
associated with the location vector $\bm{x}_{1}$ of $(\bm{v}_{1},\bm{v}_{2})$.
For data pair $(\bm{v}_{2},\bm{w}_{2})$, we can consider its location vector
$\bm{x}_{2}$ as swapping the “$O$” and “$\times$” entries of $\bm{x}_{1}$. Now
we denote the size of the corresponding sets (Definition 2.2) of $\bm{x}_{2}$
as $l_{i}^{\prime}s,g_{i}^{\prime}s,h_{i}^{\prime}s$, for $i=0,1,2$. Since
$\sigma$ is applied before hashing, by symmetry there is a one-to-one
correspondence between the two location vectors. More specifically,
$l_{0}^{\prime}$ corresponds to $h_{1}$, $g_{0}^{\prime}$ corresponds to
$g_{1}$, $g_{1}^{\prime}$ corresponds to $g_{0}$, and $l_{2}^{\prime}$
corresponds to $h_{2}$. Therefore, in probability we can write

$\displaystyle\tilde{\mathcal{E}}_{2}$
$\displaystyle=\mathbb{E}_{(l_{0}^{\prime},l_{2}^{\prime},g_{0}^{\prime},g_{1}^{\prime})}\Big{[}\frac{l_{0}^{\prime}}{f+g_{0}^{\prime}+g_{1}^{\prime}}+\frac{a(g_{0}^{\prime}+l_{2}^{\prime})}{(f+g_{0}^{\prime}+g_{1}^{\prime})f}\Big{]}$
$\displaystyle=\mathbb{E}_{(h_{1},h_{2},g_{0},g_{1})}\Big{[}\frac{h_{1}}{f+g_{0}+g_{1}}+\frac{(f-a)(g_{1}+h_{2})}{(f+g_{0}+g_{1})f}\Big{]}.$

Consequently, we have

$\displaystyle\tilde{\mathcal{E}}_{1}-\tilde{\mathcal{E}}_{2}=\mathbb{E}_{(l_{0},l_{2},h_{1},h_{2},g_{0},g_{1})}\Big{[}\frac{l_{0}-h_{1}}{f+g_{0}+g_{1}}+\frac{a(g_{0}+l_{2})-(f-a)(g_{1}+h_{2})}{(f+g_{0}+g_{1})f}\Big{]}.$

In the sequel, the subscript of expectation is suppressed for conciseness.
Exploiting the constraints (12), we deduce that $h_{1}=(f-a)-l_{1}-g_{1}$,
$h_{2}=l_{0}+g_{0}+l_{1}+g_{1}-a$ and $l_{0}+l_{1}=a-l_{2}$. Using these facts
we obtain

$\displaystyle\tilde{\mathcal{E}}_{1}-\tilde{\mathcal{E}}_{2}$
$\displaystyle=\mathbb{E}\Big{[}\frac{(l_{0}-(f-a)+l_{1}+g_{1})f+a(g_{0}+l_{2})-(f-a)(l_{0}+g_{0}+l_{1}+2g_{1}-a)}{(f+g_{0}+g_{1})f}\Big{]}$
$\displaystyle=\mathbb{E}\Big{[}\frac{(2a-f+g_{1}-l_{2})f+a(g_{0}+l_{2})-(f-a)(2g_{1}+g_{0}-l_{2})}{(f+g_{0}+g_{1})f}\Big{]}$
$\displaystyle=\mathbb{E}\Big{[}\frac{2(f+g_{0}+g_{1})a-(f+g_{0}+g_{1})f}{(f+g_{0}+g_{1})f}\Big{]}$
$\displaystyle=2J-1.$

Comparing the variances of $\hat{J}_{\sigma,\pi}(\bm{v}_{1},\bm{w}_{1})$ and
$\hat{J}_{\sigma,\pi}(\bm{v}_{2},\bm{w}_{2})$, we derive

$\displaystyle
Var[\hat{J}_{\sigma,\pi}(\bm{v}_{1},\bm{w}_{1})]-Var[\hat{J}_{\sigma,\pi}(\bm{v}_{2},\bm{w}_{2})]$
$\displaystyle=(\frac{J}{K}+\frac{(K-1)\tilde{\mathcal{E}_{1}}}{K}-J^{2})-(\frac{1-J}{K}+\frac{(K-1)\tilde{\mathcal{E}_{2}}}{K}-(1-J)^{2})$
$\displaystyle=-\frac{K-1}{K}(2J-1)+\frac{K-1}{K}(\tilde{\mathcal{E}_{1}}-\tilde{\mathcal{E}_{2}})=0.$

This completes the proof. ∎

###  A.5 Proof of Lemma 3.3

######  Lemma 3.3 (Increasing Increment).

Assume $a>0$ and $f>a$ are arbitrary and fixed. Denote
$\tilde{\mathcal{E}}_{D}$ as in (21) in Theorem 3.1, with $D$ treated as a
parameter. Then we have $\tilde{\mathcal{E}}_{D+1}>\tilde{\mathcal{E}}_{D}$
for $\forall D\geq f$.

###### Proof.

Let the probability mass function (27) with $a$, $f$ and dimension $D$ be
$P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$. Conditional on $l_{0},l_{2},g_{0},g_{1}$
with $D$ elements, the possible values
$l_{0}^{\prime},l_{2}^{\prime},g_{0}^{\prime},g_{1}^{\prime}$ when adding a
“$-$” are

  * •

$g_{0}^{\prime}=g_{0}+1,l_{0}^{\prime}=l_{0},l_{2}^{\prime}=l_{2},g_{1}^{\prime}=g_{1}$.
This is true when the new elements falls between a pair of $(\times,O)$, with
probability $\frac{l_{1}+l_{2}-g_{0}}{D}$.

  * •

$g_{1}^{\prime}=g_{1}+1,l_{0}^{\prime}=l_{0},l_{2}^{\prime}=l_{2},g_{0}^{\prime}=g_{0}$,
when the new elements falls between a pair of $(\times,\times)$, with
probability $\frac{f-a-l_{1}-g_{1}}{D}$.

  * •

$g_{1}^{\prime}=g_{1}+1,l_{2}^{\prime}=l_{2}+1,l_{0}^{\prime}=l_{0},g_{0}^{\prime}=g_{0}$,
when the new elements falls between a pair of $(O,\times)$, with probability
$\frac{l_{1}}{D}$.

  * •

$l_{0}^{\prime}=l_{0}-1,l_{2}^{\prime}=l_{2}+1,g_{0}^{\prime}=g_{0}+1,g_{1}^{\prime}=g_{1}$,
when the new elements falls between a pair of $(O,O)$, with probability
$\frac{l_{0}}{D}$.

  * •

All values unchanged, when the “$-$” falls between other types of pairs, with
probability $\frac{D-f+g_{0}+g_{1}}{D}$.

Denote $\Xi_{D}$ as the feasible set satisfying (12) with dimension $D\geq f$.
Above reasoning builds a correspondence between $\Xi_{D}$ and $\Xi_{D+1}$.
More precisely, we have

$\displaystyle\tilde{\mathcal{E}}_{D+1}$
$\displaystyle=\sum_{\Xi_{D+1}}\left(\frac{l_{0}^{\prime}}{f+g_{0}^{\prime}+g_{1}^{\prime}}+\frac{a(g_{0}^{\prime}+l_{2}^{\prime})}{(f+g_{0}^{\prime}+g_{1}^{\prime})f}\right)P_{a,f,D+1}(l_{0}^{\prime},l_{2}^{\prime},g_{0}^{\prime},g_{1}^{\prime})$
$\displaystyle=\sum_{\Xi_{D}}\bigg{\\{}\Big{(}\frac{l_{0}}{f+g_{0}+g_{1}+1}+\frac{a(g_{0}+l_{2}+1)}{(f+g_{0}+g_{1}+1)f}\Big{)}\frac{l_{1}+l_{2}-g_{0}}{D}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle\hskip
21.68121pt+\Big{(}\frac{l_{0}}{f+g_{0}+g_{1}+1}+\frac{a(g_{0}+l_{2})}{(f+g_{0}+g_{1}+1)f}\Big{)}\frac{f-a-
l_{1}-g_{1}}{D}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$ $\displaystyle\hskip
21.68121pt+\Big{(}\frac{l_{0}}{f+g_{0}+g_{1}+1}+\frac{a(g_{0}+l_{2}+1)}{(f+g_{0}+g_{1}+1)f}\Big{)}\frac{l_{1}}{D}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle\hskip
21.68121pt+\Big{(}\frac{l_{0}-1}{f+g_{0}+g_{1}+1}+\frac{a(g_{0}+l_{2}+2)}{(f+g_{0}+g_{1}+1)f}\Big{)}\frac{l_{0}}{D}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle\hskip
21.68121pt+\Big{(}\frac{l_{0}}{f+g_{0}+g_{1}}+\frac{a(g_{0}+l_{2})}{(f+g_{0}+g_{1})f}\Big{)}\frac{D-f+g_{0}+g_{1}}{D}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})\bigg{\\}}.$

The increment can be computed as

$\displaystyle\tilde{\delta}_{D}$
$\displaystyle\triangleq\tilde{\mathcal{E}}_{D+1}-\tilde{\mathcal{E}}_{D}$
$\displaystyle=\sum_{\Xi_{D}}\bigg{\\{}\frac{f-g_{0}-g_{1}}{D}\Big{[}\big{(}\frac{l_{0}}{f+g_{0}+g_{1}+1}-\frac{l_{0}}{f+g_{0}+g_{1}}\big{)}+\big{(}\frac{a(g_{0}+l_{2}+1)}{f+g_{0}+g_{1}+1}-\frac{a(g_{0}+l_{2})}{f+g_{0}+g_{1}}\big{)}\Big{]}$
$\displaystyle\hskip 36.135pt-\frac{l_{0}}{D(f+g_{0}+g_{1}+1)}-\frac{a(f-a-
l_{1}-g_{1})-al_{0}}{Df(f+g_{0}+g_{1}+1)}\bigg{\\}}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle=\sum_{\Xi_{D}}\bigg{\\{}\frac{(f-g_{0}-g_{1})[a(f+g_{1}-l_{2})-fl_{0}]}{Df(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}-\frac{(f-a)l_{0}+a(f-a-
l_{1}-g_{1})}{Df(f+g_{0}+g_{1}+1)}\bigg{\\}}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle=\sum_{\Xi_{D}}\frac{2af(l_{1}+g_{1})-2f(f-a)l_{0}-2a(f-a)(g_{0}+g_{1})}{Df(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle=\mathbb{E}\Big{[}\frac{2af(l_{1}+g_{1})-2f(f-a)l_{0}-2a(f-a)(g_{0}+g_{1})}{Df(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]}$
$\displaystyle=\mathbb{E}\Big{[}\frac{2af(f-a-
h_{1})-2f(f-a)l_{0}-2a(f-a)(g_{0}+g_{1}+f-f)}{Df(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]}$
$\displaystyle=\mathbb{E}\Big{[}\frac{4a(f-a)}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]}-\mathbb{E}\Big{[}\frac{2ah_{1}+2(f-a)l_{0}}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]}-\mathbb{E}\Big{[}\frac{2a(f-a)}{Df(f+g_{0}+g_{1}+1)}\Big{]}$
$\displaystyle\triangleq 4a(f-a)E_{0}-2aE_{1}-2(f-a)E_{2}-2a(f-a)E_{3},$ (28)

where

$\displaystyle E_{0}$
$\displaystyle=\mathbb{E}\Big{[}\frac{1}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]},\
\
E_{1}=\mathbb{E}\Big{[}\frac{h_{1}}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]},$
$\displaystyle E_{2}$
$\displaystyle=\mathbb{E}\Big{[}\frac{l_{0}}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]},\
\ E_{3}=\mathbb{E}\Big{[}\frac{g_{2}}{Df(f+g_{0}+g_{1}+1)}\Big{]}.$

Note that here the expectations are taken w.r.t. the set size distribution
with $a,f,D$. We can expand the terms of density function (27) to derive

$\displaystyle P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle=\sum_{s=\max(0,D-2f+a)}^{D-f-1}\frac{(D-f-s)(D-f)!(f-a-1)!}{[D-(f+g_{0}+g_{1})]![(f+g_{0}+g_{1})-D+s]!g_{1}!(D-f-
s-g_{1})!}$
$\displaystyle\frac{(a-1)!}{(g_{0}+g_{1}-l_{2})![D-s+l_{2}-(f+g_{0}+g_{1})]!(f-a-
l_{1}-g_{1})!(f+g_{1}+l_{1}-D+s)!l_{0}!(a-l_{0}-1)!}$
$\displaystyle\frac{a!(f-a)!(D-f-1)!}{(D-1)!}.$

Denote $a^{\prime}=a-1$, $f^{\prime}=f-1$, $D^{\prime}=D-1$ and
$l_{0}^{\prime}=l_{0}-1$. We have

$\displaystyle E_{2}$
$\displaystyle=\sum_{\Xi_{D}}\frac{l_{0}}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}P_{a,f,D}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle=\sum_{\Xi_{D}}\frac{a(a-1)}{D-1}\cdot\frac{1}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}$
$\displaystyle\hskip
21.68121pt\sum_{s=\max(0,D^{\prime}-2f^{\prime}+a^{\prime})}^{D^{\prime}-f^{\prime}-1}\frac{(D^{\prime}-f^{\prime}-s)(D^{\prime}-f^{\prime})!(f^{\prime}-a^{\prime}-1)!}{[D^{\prime}-(f^{\prime}+g_{0}+g_{1})]![(f^{\prime}+g_{0}+g_{1})-D^{\prime}+s]!g_{1}!(D^{\prime}-f^{\prime}-s-g_{1})!}$
$\displaystyle\frac{(a^{\prime}-1)!}{(g_{0}+g_{1}-l_{2})![D^{\prime}-s+l_{2}-(f^{\prime}+g_{0}+g_{1})]!(f^{\prime}-a^{\prime}-l_{1}-g_{1})!(f^{\prime}+g_{1}+l_{1}-D^{\prime}+s)!l_{0}^{\prime}!(a^{\prime}-l_{0}^{\prime}-1)!}$
$\displaystyle\frac{a^{\prime}!(f^{\prime}-a^{\prime})!(D^{\prime}-f^{\prime}-1)!}{(D^{\prime}-1)!}$
$\displaystyle=\sum_{\Xi_{D-1}}\frac{a(a-1)}{D-1}\frac{1}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}P_{a-1,f-1,D-1}(l_{0},l_{2},g_{0},g_{1})$
$\displaystyle=\frac{a(a-1)}{D-1}\mathbb{E}_{a-1,f-1,D-1}\Big{[}\frac{1}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]}$
$\displaystyle\triangleq\frac{a(a-1)}{D-1}\bar{E}.$

Here the subscript means that we are taking expectation w.r.t the set sizes
when the number of “$O$”, “$\times$” and “$-$” points is $(a-1,f-1,D-1)$. By
symmetry, it can be shown similarly that

$\displaystyle E_{1}$
$\displaystyle=\frac{(f-a)(f-a-1)}{D-1}\mathbb{E}_{a,f-1,D-1}\Big{[}\frac{1}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]}=\frac{(f-a)(f-a-1)}{D-1}\bar{E}.$

Substituting above results into (28), we obtain

$\displaystyle\tilde{\delta}_{D}$
$\displaystyle=2a(f-a)[2E_{0}-\frac{f-2}{D-1}\bar{E}-E_{3}].$

To compute $E_{0}$, note that with $a,f$ and $D$, variable $g_{2}$ is
distributed as hyper($D-1,D-f,D-f-1$). For $\bar{E}$, the distribution becomes
hyper($D-2,D-f,D-f-1$). Since $f+g_{0}+g_{1}=D-g_{2}$, we deduce

$\displaystyle E_{0}$
$\displaystyle=\sum_{s=\max(0,D-2f)}^{D-f-1}\frac{1}{D(D-s)(D-s+1)}\frac{\binom{D-f-1}{s}\binom{f}{D-f-s}}{\binom{D-1}{D-f}}$
$\displaystyle=\sum_{s=\max(0,D-2f)}^{D-f-1}\frac{1}{D(D-s)(D-s+1)}\frac{(D-f-1)!f!}{s!(D-f-s-1)!(D-f-s)!(-D+2f+s)!}\frac{(D-f)!(f-1)!}{(D-1)!},$

and

$\displaystyle\bar{E}$
$\displaystyle=\sum_{s=\max(0,D-2f+1)}^{D-f-1}\frac{1}{D(D-s)(D-s+1)}\frac{\binom{D-f-1}{s}\binom{f-1}{D-f-s}}{\binom{D-2}{D-f}}$
$\displaystyle=\sum_{s=\max(0,D-2f+1)}^{D-f-1}\frac{1}{D(D-s)(D-s+1)}\frac{(D-f)!(f-2)!}{(D-2)!}\cdot$
$\displaystyle\hskip
144.54pt\frac{(D-f-1)!(f-1)!}{s!(D-f-s-1)!(D-f-s)!(-D+2f+s-1)!}.$

For $\forall D\geq f$, we have

$\displaystyle\frac{f-2}{D-1}\bar{E}$
$\displaystyle\leq\sum_{s=\max(0,D-2f)}^{D-f-1}\frac{(f-2)(D-1)(-D+2f+s)}{D(D-1)f(f-1)(D-s)(D-s+1)}$
$\displaystyle\hskip
43.36243pt\frac{(D-f-1)!f!}{s!(D-f-s-1)!(D-f-s)!(-D+2f+s)!}\frac{(D-f)!(f-1)!}{(D-1)!}$
$\displaystyle\leq\mathbb{E}\Big{[}\frac{(f-2)(f-(D-f-
g_{2}))}{Df(f-1)(D-g_{2})(D-g_{2}+1)}\Big{]}$
$\displaystyle<\mathbb{E}\Big{[}\frac{(f-g_{0}-g_{1})}{Df(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]}.$

Consequently, we have

$\displaystyle\tilde{\delta}_{D}$
$\displaystyle>2a(f-a)\mathbb{E}\Big{[}\frac{2}{D(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}-\frac{f-g_{0}-g_{1}}{Df(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}$
$\displaystyle\hskip
144.54pt-\frac{f+g_{0}+g_{1}}{Df(f+g_{0}+g_{1})(f+g_{0}+g_{1}+1)}\Big{]}$
$\displaystyle=0,$

and note that this holds for $\forall D\geq K$. The proof is complete. ∎

###  A.6 Proof of Theorem 3.4

######  Theorem 3.4 (Uniform Superiority).

For any two binary vectors $\bm{v},\bm{w}\in\\{0,1\\}^{D}$ with $J\neq 0$ or
$1$, it holds that
$Var[\hat{J}_{\sigma,\pi}(\bm{v},\bm{w})]<Var[\hat{J}_{MH}(\bm{v},\bm{w})]$.

###### Proof.

By assumption we have $0<a<f$. To compare $Var[\hat{J}_{\sigma,\pi}]$ with
$Var[\hat{J}_{MH}]=\frac{J(1-J)}{K}=\frac{J}{K}+\frac{(K-1)J^{2}}{K}-J^{2}$,
it suffices to compare $\tilde{\mathcal{E}}$ with $J^{2}$. When $D=f$, we know
that the location vector $\bm{x}$ of $(\bm{v},\bm{w})$ contains no “$-$”
elements. It is easy to verify that in this case,
$|\mathcal{G}_{0}|=|\mathcal{G}_{1}|=|\mathcal{L}_{2}|=0$, and
$|\mathcal{L}_{0}|$ follows hyper($f-1,a,a-1$). By Theorem 3.1, it follows
that when $D=f$,

$\displaystyle\tilde{\mathcal{E}}_{D}$
$\displaystyle=\frac{1}{f}\mathbb{E}[|\mathcal{L}_{0}|]=\frac{a(a-1)}{f(f-1)}=J\tilde{J}<J^{2}.$

Recall the definition $\tilde{J}=\frac{a-1}{f-1}$, which is always less than
$J$. On the other hand, as $D\rightarrow\infty$, we have
$|\mathcal{L}_{0}|\rightarrow 0$, $|\mathcal{L}_{2}|\rightarrow a$,
$|\mathcal{G}_{0}|\rightarrow a$ and $|\mathcal{G}_{1}|\rightarrow f-a$. We
can easily show that

$\displaystyle\tilde{\mathcal{E}}_{D}\rightarrow J^{2},\hskip
7.22743pt\text{as}\ D\rightarrow\infty.$

By Lemma 3.3, the sequence
$(\tilde{\mathcal{E}}_{f},\tilde{\mathcal{E}}_{f+1},\tilde{\mathcal{E}}_{f+2},...)$
is strictly increasing. Since it is convergent with limit $J^{2}$, by the
Monotone Convergence Theorem we know that $\tilde{\mathcal{E}_{D}}<J^{2}$,
$\forall D\geq f$. ∎

###  A.7 Proof of Proposition 3.5

######  Proposition 3.5 (Consistent Improvement).

Suppose $f$ is fixed. In terms of $a$, the variance ratio
$\rho(a)=\frac{Var[\hat{J}_{MH}(\bm{v},\bm{w})]}{Var[\hat{J}_{\sigma,\pi}(\bm{v},\bm{w})]}$
is constant for any $0<a<f$.

###### Proof.

Let $\tilde{\mathcal{E}}$ be defined as in Theorem 3.1. Assume that $D$ and
$f$ are fixed and $a$ is variable. Firstly, we can write the variance ratio
explicitly as

$\displaystyle\rho(a)$
$\displaystyle=\frac{\frac{J-J^{2}}{K}}{\frac{J}{K}+\frac{(K+1)\tilde{\mathcal{E}}}{K}-J^{2}}=\frac{1-J}{1-J-(K-1)(J-\frac{\tilde{\mathcal{E}}}{J})}.$

We now show that the term $J-\frac{\tilde{\mathcal{E}}}{J}=C(1-J)$, where $C$
is some constant independent of $J$ (i.e., $a$). Then, for fixed $D$ and $f$,
by cancellation $\rho(a)$ would be constant for all $0<a<f$. We have

$\displaystyle J-\frac{\tilde{\mathcal{E}}}{J}$
$\displaystyle=\frac{a}{f}-\mathbb{E}_{a,f,D}\Big{[}\frac{fl_{0}}{a(f+g_{0}+g_{1})}+\frac{g_{0}+l_{2}}{f+g_{0}+g_{1}}\Big{]}$
$\displaystyle=\mathbb{E}\Big{[}\frac{a^{2}(f+g_{0}+g_{1})-f^{2}l_{0}-af(g_{0}+l_{2})}{af(f+g_{0}+g_{1})}\Big{]}$
$\displaystyle=\mathbb{E}\Big{[}\frac{a(a-f)(g_{0}+g_{1})+a^{2}f+afg_{1}-f^{2}l_{0}-afl_{2}}{af(f+g_{0}+g_{1})}\Big{]}$
$\displaystyle=\mathbb{E}\Big{[}\frac{a(a-f)(g_{0}+g_{1})+af(l_{0}+l_{1})+afg_{1}-f^{2}l_{0}}{af(f+g_{0}+g_{1})}\Big{]}$
$\displaystyle=\mathbb{E}\Big{[}\frac{a(a-f)(g_{0}+g_{1})+f(a-f)l_{0}+af(f-a-
h_{1})}{af(f+g_{0}+g_{1})}\Big{]},$ (29)

where we use the constraints (12) that $l_{0}+l_{1}+l_{2}=a$ and
$l_{1}+g_{1}+h_{1}=f-a$. We now study the three terms respectively. We have

$\displaystyle\mathbb{E}\Big{[}\frac{a(a-f)(g_{0}+g_{1})}{af(f+g_{0}+g_{1})}\Big{]}=-(1-J)\mathbb{E}\Big{[}\frac{g_{0}+g_{1}}{f+g_{0}+g_{1}}\Big{]}\triangleq-E^{\prime}(1-J).$

We have shown in the proof of Lemma 3.3 that

$\displaystyle\mathbb{E}_{a,f,D}\Big{[}\frac{l_{0}}{f+g_{0}+g_{1}}\Big{]}=\frac{a(a-1)}{D-1}\mathbb{E}_{a-1,f-1,D-1}\Big{[}\frac{1}{f+g_{0}+g_{1}}\Big{]}\triangleq\frac{a(a-1)}{D-1}E^{*},$

and by symmetry it holds that

$\displaystyle\mathbb{E}_{a,f,D}\Big{[}\frac{h_{1}}{f+g_{0}+g_{1}}\Big{]}=\frac{(f-a)(f-a-1)}{D-1}E^{*}.$

Note that Since $f$ is fixed, $(|\mathcal{G}_{0}|+|\mathcal{G}_{1}|)$ is
distributed independent of $a$. Consequently, $E^{\prime}$ and $E^{*}$ are
both independent of $a$. Next, we obtain

$\displaystyle\mathbb{E}\Big{[}\frac{f(a-f)l_{0}}{af(f+g_{0}+g_{1})}\Big{]}=-(1-J)\frac{f(a-1)}{D-1}E^{*},$

and

$\displaystyle\mathbb{E}\Big{[}\frac{af(f-a-h_{1})}{af(f+g_{0}+g_{1})}\Big{]}$
$\displaystyle=(1-J)fE^{*}-(1-J)\frac{f(f-a-1)}{D-1}E^{*}.$

Summing up the terms and substituting into (29), we derive

$\displaystyle J-\frac{\tilde{\mathcal{E}}}{J}$ $\displaystyle=C(1-J),$

where $C=-E^{\prime}+(f-\frac{f(f-2)}{D-1})E^{*}$, which is independent of
$a$. Taking into $\rho(a)$, we get

$\displaystyle\rho(a)=\frac{1-J}{1-J-(K-1)C(1-J)}=\frac{1}{1-(K-1)C},$

which is a constant only depending on $f$, $D$ and $K$. This completes the
proof. ∎

## References

  * Bendersky and Croft (2009) Michael Bendersky and W. Bruce Croft.  Finding text reuse on the web.  In _Proceedings of the Second International Conference on Web Search and Web Data Mining (WSDM)_ , pages 262–271, Barcelona, Spain, 2009.
  * Broder (1997) Andrei Z. Broder.  On the resemblance and containment of documents.  In _Proceedings of the Conference on Compression and Complexity of SEQUENCES_ , pages 21–29, Positano, Amalfitan Coast, Salerno, Italy, 1997\.
  * Broder et al. (1997) Andrei Z. Broder, Steven C. Glassman, Mark S. Manasse, and Geoffrey Zweig.  Syntactic clustering of the web.  _Comput. Networks_ , 29(8-13):1157–1166, 1997\.
  * Broder et al. (1998) Andrei Z. Broder, Moses Charikar, Alan M. Frieze, and Michael Mitzenmacher.  Min-wise independent permutations.  In _Proceedings of the Thirtieth Annual ACM Symposium on the Theory of Computing (STOC)_ , pages 327–336, Dallas, TX, 1998.
  * Buehrer and Chellapilla (2008) Gregory Buehrer and Kumar Chellapilla.  A scalable pattern mining approach to web graph compression with communities.  In _Proceedings of the International Conference on Web Search and Web Data Mining (WSDM)_ , pages 95–106, Stanford, CA, 2008.
  * Charikar (2002) Moses S. Charikar.  Similarity estimation techniques from rounding algorithms.  In _Proceedings on 34th Annual ACM Symposium on Theory of Computing (STOC)_ , pages 380–388, Montreal, Canada, 2002.
  * Chierichetti et al. (2009) Flavio Chierichetti, Ravi Kumar, Silvio Lattanzi, Michael Mitzenmacher, Alessandro Panconesi, and Prabhakar Raghavan.  On compressing social networks.  In _Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD)_ , pages 219–228, Paris, France, 2009.
  * Chum and Matas (2012) Ondrej Chum and Jiri Matas.  Fast computation of min-hash signatures for image collections.  In _2012 IEEE Conference on Computer Vision and Pattern Recognition, Providence, RI, USA, June 16-21, 2012_ , pages 3077–3084. IEEE Computer Society, 2012.
  * Das et al. (2007) Abhinandan Das, Mayur Datar, Ashutosh Garg, and Shyamsundar Rajaram.  Google news personalization: scalable online collaborative filtering.  In _Proceedings of the 16th International Conference on World Wide Web (WWW)_ , pages 271–280, Banff, Alberta, Canada, 2007.
  * Deng et al. (2012) Fan Deng, Stefan Siersdorfer, and Sergej Zerr.  Efficient jaccard-based diversity analysis of large document collections.  In _Proceedings of the 21st ACM International Conference on Information and Knowledge Management (CIKM)_ , pages 1402–1411, Maui, HI, 2012\.
  * Dua and Graff (2017) Dheeru Dua and Casey Graff.  UCI machine learning repository, 2017.  URL http://archive.ics.uci.edu/ml.
  * Fetterly et al. (2003) Dennis Fetterly, Mark Manasse, Marc Najork, and Janet L. Wiener.  A large-scale study of the evolution of web pages.  In _Proceedings of the Twelfth International World Wide Web Conference (WWW)_ , pages 669–678, Budapest, Hungary, 2003.
  * Greene and Cunningham (2006) Derek Greene and Pádraig Cunningham.  Practical solutions to the problem of diagonal dominance in kernel document clustering.  In _Proc. 23rd International Conference on Machine learning (ICML’06)_ , pages 377–384. ACM Press, 2006.
  * He et al. (2013) Kaiming He, Fang Wen, and Jian Sun.  K-means hashing: An affinity-preserving quantization method for learning binary compact codes.  In _2013 IEEE Conference on Computer Vision and Pattern Recognition, Portland, OR, USA, June 23-28, 2013_ , pages 2938–2945. IEEE Computer Society, 2013.
  * Henzinger (2006) Monika Rauch Henzinger.  Finding near-duplicate web pages: a large-scale evaluation of algorithms.  In _Proceedings of the 29th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR)_ , pages 284–291, Seattle, WA, 2006.
  * Indyk and Motwani (1998) Piotr Indyk and Rajeev Motwani.  Approximate nearest neighbors: Towards removing the curse of dimensionality.  In _Proceedings of the Thirtieth Annual ACM Symposium on the Theory of Computing (STOC)_ , pages 604–613, Dallas, TX, 1998.
  * Krizhevsky (2009) Alex Krizhevsky.  Learning multiple layers of features from tiny images.  2009\.
  * LeCun et al. (1998) Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner.  Gradient-based learning applied to document recognition.  _Proceedings of the IEEE_ , 86(11):2278–2324, 1998.
  * Lee et al. (2010) David C. Lee, Qifa Ke, and Michael Isard.  Partition min-hash for partial duplicate image discovery.  In _Proceedings of the 11th European Conference on Computer Vision (ECCV), Part I_ , pages 648–662, Heraklion, Crete, Greece, 2010.
  * Li and Church (2005) Ping Li and Kenneth Ward Church.  Using sketches to estimate associations.  In _Proceedings of the Conference on Human Language Technology and the Conference on Empirical Methods in Natural Language Processing (HLT/EMNLP)_ , pages 708–715, Vancouver, Canada, 2005.
  * Li and König (2011) Ping Li and Arnd Christian König.  Theory and applications of _b_ -bit minwise hashing.  _Commun. ACM_ , 54(8):101–109, 2011.
  * Li et al. (2011) Ping Li, Anshumali Shrivastava, Joshua Moore, and Arnd Christian König.  Hashing algorithms for large-scale learning.  In _Advances in Neural Information Processing Systems (NIPS)_ , pages 2672–2680, Granada, Spain, 2011.
  * Shrivastava and Li (2012) Anshumali Shrivastava and Ping Li.  Fast near neighbor search in high-dimensional binary data.  In _Proceedings of European Conference on Machine Learning and Knowledge Discovery in Databases (ECML-PKDD)_ , pages 474–489, Bristol, UK, 2012\.
  * Shrivastava and Li (2014) Anshumali Shrivastava and Ping Li.  In defense of minhash over simhash.  In _Proceedings of the Seventeenth International Conference on Artificial Intelligence and Statistics (AISTATS)_ , pages 886–894, Reykjavik, Iceland, 2014.
  * Tamersoy et al. (2014) Acar Tamersoy, Kevin A. Roundy, and Duen Horng Chau.  Guilt by association: large scale malware detection by mining file-relation graphs.  In _Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD)_ , pages 1524–1533, New York, NY, 2014.
  * Yu et al. (2017) Felix X. Yu, Aditya Bhaskara, Sanjiv Kumar, Yunchao Gong, and Shih-Fu Chang.  On binary embedding using circulant matrices.  _J. Mach. Learn. Res._ , 18:150:1–150:30, 2017.
  * Zamora et al. (2016) Juan Zamora, Marcelo Mendoza, and Héctor Allende.  Hashing-based clustering in high dimensional data.  _Expert Syst. Appl._ , 62:202–211, 2016.