Let $X$ and $Y$ are two independent binomial random variables where $X\sim B(K, q), Y\sim B(K, p)$. I am wondering how to compute or estimate the following expectations: $$ \ \mathbb{E}[|pX-qY|]\ \ \text{and}\ \ \mathbb{E}[\text{ReLU}(pX-qY)].$$

where ReLU($x$) = max($x, 0$) Furthermore, what does the distribution of $pX-qY$ look like?

Update: Actually I'm more interested in $\mathbb{E}[pX\mathbb{1}(pX-qY>0)]\ \text{and}\ \mathbb{E}[qY\mathbb{1}(pX-qY>0)]$, where $\mathbb{1}$ is the indicator function. We know that $\mathbb{E}[pX\mathbb{1}(pX-qY>0)]-\mathbb{E}[qY\mathbb{1}(pX-qY>0)]=\mathbb{E}[\text{ReLU}(pX-qY)]$ for which @PedroSebe has presented a nice idea below.

  • $\begingroup$ Cross-posted at math.stackexchange.com/q/3580440/321264. $\endgroup$ – StubbornAtom Mar 14 at 7:46
  • $\begingroup$ There doesn't seem to be a closed form. $\endgroup$ – gunes Mar 14 at 9:05
  • $\begingroup$ @gunes Thanks! I have modified the question a bit. $\endgroup$ – luw Mar 14 at 14:47

Although there is no closed form, if $K$ is big enough we can use Central Limit Theorem to approximate $X\sim\mathcal{N}(Kq,Kq(1-q))$ and $Y\sim\mathcal{N}(Kp,Kp(1-p))$. It follows that $pX-qY$ has asymptotically normal distribution with mean zero and variance given by:

$$\sigma^2=p^2\cdot Kq(1-q)+q^2\cdot Kp(1-p) \\=Kpq\left[p(1-q)+q(1-p)\right]\\=Kpq(p+q-2pq)$$

Then, using a property of the normal distribution, we get: $$\mathbb{E}[|pX-qY|]=\sqrt{\frac{2}{\pi}}\sigma=\sqrt{\frac{2Kpq}{\pi}(p+q-2pq)}$$

Now, for the ReLU, let us denote $Z=pX-qY$, for clarity. Then:


Since $\text{ReLU}(Z)=0$ if $Z<0$ and $=Z$ otherwise. Then, using the fact that our distribution is symmetric around zero, we have:


| cite | improve this answer | |
  • $\begingroup$ Thank you for your answer! Actually I'm more interested in $\mathbb{E}[pX\mathbb{1}(pX-qY>0)]\ \text{and}\ \mathbb{E}[qY\mathbb{1}(pX-qY>0)]$. (I have updated my question a bit.) Do you have any advice for this? $\endgroup$ – luw Mar 15 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.