Variance of a continuous and discrete

89 Views Asked by At

I am trying to solve the following.

$X$ is an exponential random variable with mean $\theta$ while $Y$ is a Bernoulli random variable with probability of success $p$. Find the $Var[XY]$

I have no idea what to do here, because one is continuous while the other is discrete. All I know is that I am trying to add all the $xy P[X=x,Y=y]$ but how do we work on this case?

2

There are 2 best solutions below

2
On

The probability distribution of variable $z = XY$ is $$ f(z) = (1-p)\delta(z) + p \theta e^{-\theta z} \Theta(z) $$ where $\delta(z)$ is the usual Heaviside delta function and $\Theta (z)$ is a step function keeping the exponential only for positive $z$.

The expectation is $$ \int_{-\infty}^{+\infty} z (1-p)\delta(z) dz + \int_{-\infty}^{+\infty} z p \theta e^{-\theta z} \Theta(z)dz = (1-p)\cdot 0 + p \theta \int_{0}^{+\infty} z e^{-\theta z} dz = p/\theta $$
The second moment about zero is $$ \int_{-\infty}^{+\infty} z^2 (1-p)\delta(z) dz + \int_{-\infty}^{+\infty} z^2 p \theta e^{-\theta z} \Theta(z)dz = (1-p)\cdot 0 + p \theta \int_{0}^{+\infty} z^2 e^{-\theta z} dz = 2p/\theta^2 $$
The variance is thus $$ \sigma^2 = \left( 2p/\theta^2 \right) - \left( p/\theta \right)^2 = \frac{p(2-p)}{\theta^2} $$

2
On

$X$ is an exponential random variable with mean $\theta$ while $Y$ is a Bernoulli random variable with probability of success $p$. Find the $Var[XY]$

Given:

  • $X \sim Exponential(\theta)$ with $E[X] = \theta$ and $Var(X) = \theta^2$.

  • $Y \sim Bernoulli(p)$ with $E[Y] = p$ and $Var(Y) = p(1-p)$.

Solution: The easy way to solve this is to express the variance of a product $(X*Y)$ in terms of: the moments of $X$ (which we know) and the moments of $Y$ (which we know). In particular, if $X$ and $Y$ are independent:

$$Var(X Y) = Var(X) Var(Y) + Var(X) E[Y]^2 + Var(Y) E[X]^2 = p(2-p) \theta^2 $$