# Minimizing the probability that two iid binomials RVs are equal

Let $$X$$ and $$Y$$ be iid with distribution $$\text{Bin}(n,p)$$. I would like to show $$P(X=Y)$$ is minimzed when $$p=1/2$$.

$$P(X=Y)=\sum_{i=0}^n P(X=i)P(Y=i)=(1-p)^{2 n} \, _2F_1\left(-n,-n;1;\frac{p^2}{(p-1)^2}\right)$$ ($$_2F_1$$ is the Hypergeometric Function)

I'm wondering how to show that such a complicated function is minimzed at $$p=1/2$$ or if there is an all-around simpler approach for this problem.

• Very nice question. If we let $f(p)=P(X=Y)$, it is clear that $f(p)=f(1-p)$, and the problem would be solved if one could show $f$ was convex. Mar 22, 2022 at 1:42

The characteristic function (CF) of $$X-Y$$ has a tractable form: \begin{aligned}\varphi_{n,p}(a)&=E[e^{ia(X-Y)}]=\\ &=E[e^{iaX}]E[e^{-iaY}]=\\ &=[(q+pe^{ia})(q+pe^{-ia})]^n=\\ &=(q^2+2qp\cos(a)+p^2)^n=\\ &=(\varphi_{1,p}(a))^n\end{aligned} where $$q=1-p$$. We want to minimize (wrt $$p$$) the integral $$P_{n,p}(X=Y)=\frac{1}{2\pi}\int_{(-\pi,\pi]}\varphi_{n,p}(a)da$$ It remains to argue that $$\varphi_{n,1/2}\leq \varphi_{n,p}$$. Indeed: $$\varphi_{n,1/2}(a)=(\varphi_{1,1/2}(a))^n\leq (\varphi_{1,p}(a))^n=\varphi_{n,p}(a),\,a \in (-\pi,\pi]$$
• Thanks for this! Why is the integral from $(-\pi, \pi]$ and not over $\mathbb{R}$ Mar 22, 2022 at 16:04