Can you compare a continuous vs. discrete random variable?

118 Views Asked by At

Let's say X is a continuous random variable: say $X \sim Uniform(0,n)$ for some n.

Let's say Y is a discrete random variable: say $Y \sim Binomial(n,p)$ for that same n and some $ 0 \le p \le 1 $.

Would it make sense to compare these distributions to each other? For example, how would one go about finding $P(X\le Y)$? There's not really a common "area of integration" or something to link them together (via double integral). Since both X and Y are independent, I can't see how one RV's value would matter for the other either.

2

There are 2 best solutions below

1
On

If $X$ and $Y$ are independent then $P(X\leq Y)= \sum\limits_{k=0}^{n} P(X\leq k)\binom {n} {k} p^{k}(1-p)^{n-k}=\sum\limits_{k=0}^{n} \frac k n \binom {n} {k} p^{k}(1-p)^{n-k}$.

0
On

More generally, if $X, Y$ are independent and $Y$ is discrete, then $$\Pr(X\leq Y)=\sum_{y} \Pr(X\le y) \Pr(Y=y) = \text{E}(F_X(Y))$$ where $F_X(t)=\Pr(X\le t)$ is the CDF of $X.$

For your problem, $F_X(t)=t/n$ for $0\le t\le n$ and $Y$ takes values in $[0,n]$. Hence, $E(F_X(Y))=E(Y/n)=p.$

$\textbf{Further note.}$ We do not require $Y$ to be discrete as well. Suppose that $X, Y$ are independent, and $Y$ has finite expectation. Denote $Z=\mathbf{1}(X\le Y)$ (a random variable which equals $1$ if $X\le Y$, equals 0 otherwise). Then, $$\Pr(X\le Y) = E(Z) = E(E(Z | Y)) = E(F_X(Y)).$$

In similar fashion, if $X, Y$ are independent and $X$ has finite expectation then we can show that $\Pr(X\le Y) = 1- E(F_Y(X)).$