# How to compute $\mathbb{E}[\text{ReLU}(pX-qY)]$ and $\mathbb{E}[pX\mathbb{1}(pX-qY>0)]$ where $X\sim B(K, q), Y\sim B(K, p)$?

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)]$$.

• The title doesn't reflect the question. The question in the title is trivial due to the linearity of expectation, whereas the question in the body of the text leads to a double sum for which I don't think there's a closed form. Mar 14 '20 at 7:32
• It does not look pretty to me, though I think you can say $\mathbb{E}[|pX-qY|] = \mathbb{E}[\text{ReLU}(pX-qY)] + \mathbb{E}[\text{ReLU}(qY-pX)] =2 \mathbb{E}[\text{ReLU}(pX-qY)]$. If $Z=pX-qY$ then I think $-qK \le Z \le pK$ and $\mathbb{E}[Z]=0$ and $\text{Var}(Z) = (p+q-2pq)pqK$ Mar 14 '20 at 7:37
• Also asked at stats.stackexchange.com/q/454103/119261. Mar 14 '20 at 7:46
• @Henry Thank you! How do you deduce $\mathbb{E}[\text{ReLU}(pX-qY)]=\mathbb{E}[\text{ReLU}(qY-pX)]$ and the value of Var($Z$)?
– luw
Mar 14 '20 at 14:38
• @joriki Thank you! I have modified the title.
– luw
Mar 14 '20 at 14:45