How is $\Pr(X > 0)= \mathbb{E}[XY]$?

80 Views Asked by At

Let $X=\sum_{i=1}^n{X_i}$, where each $X_i$ is $0$-$1$ random variable.

The prove starts with

Let $Y=1/X$ if $X>0$, with $Y=0$ otherwise. Then $$\Pr(X >0) = \mathbb{E}[XY] $$

I understand that $$\Pr(X>0)= \Pr(X=1) + \dots + \Pr(X=n)$$ and $$ \mathbb{E}[XY] = \sum{(xy)\Pr(x,y)}$$ but cannot prove these quantities are equal. Could someone give me a hint?


Reference: Probability and Computing by M.Mitzenmacher & E.Upfal, pg 137.

1

There are 1 best solutions below

4
On BEST ANSWER

Using the piecewise definition of $Y$, $$XY=\begin{cases}X\cdot(1/X)&\text{if }X>0\\X\cdot(0) & \text{if }X=0\end{cases}=\begin{cases}1&\text{if }X>0\\0 & \text{if }X=0\end{cases}$$ So $XY$ takes on two values; it equals $1$ with probability $P(X>0$), and it equals $0$ with probability $P(X=0)$. Therefore, $$ E[XY]=1\cdot P(XY=1)+0\cdot P(XY=0)=1\cdot P(X>0)+0\cdot P(X=0)=P(X>0). $$