MHB Discrete-continuous random variable

OhMyMarkov
Messages
81
Reaction score
0
Hello everyone!

I'm looking at the following random variables:

$Z_1$ is normally distributed with zero mean and variance $\sigma _1 ^2$
$Z_2$ is normally distributed with zero mean and variance $\sigma _2 ^2$

$B$ is Bernoulli with probability of success $p$.

$X$ is a random variable that takes $Z_1$ if $B=1$ and $Z_2$ if $B=0$.

What is the variance of $X$?
 
Physics news on Phys.org
Re: Dicrete-continuous random variable!

OhMyMarkov said:
Hello everyone!

I'm looking at the following random variables:

$Z_1$ is normally distributed with zero mean and variance $\sigma _1 ^2$
$Z_2$ is normally distributed with zero mean and variance $\sigma _2 ^2$

$B$ is Bernoulli with probability of success $p$.

$X$ is a random variable that takes $Z_1$ if $B=1$ and $Z_2$ if $B=0$.

What is the variance of $X$?

The 'instinctive' answer should be...

$\displaystyle \sigma_{X}^{2}= p\ \sigma_{1}^{2} + (1-p)\ \sigma_{2}^{2}$ (1)

Kind regards

$\chi$ $\sigma$
 
Re: Dicrete-continuous random variable!

My statistics are a bit rusty, but we have:

$$P(B = 1) = p$$
$$P(B = 0) = 1 - p$$

And we're given that:

$$VAR(X | B = 1) = \sigma_1^2$$
$$VAR(X | B = 0) = \sigma_2^2$$

And since $Z_1$ and $Z_2$ are independent, you can just add the variances up:

$$VAR(X) = P(B = 1) VAR(X | B = 1) + P(B = 0) VAR(X | B = 0)$$

Which gives:

$$VAR(X) = p \sigma_1^2 + (1 - p) \sigma_2^2 = \sigma_1^2 + (\sigma_2^2 - \sigma_1^2) p$$

I've checked the result empirically.
 
Re: Dicrete-continuous random variable!

Bacterius said:
[snip]

And since $Z_1$ and $Z_2$ are independent, you can just add the variances up:

$$VAR(X) = P(B = 1) VAR(X | B = 1) + P(B = 0) VAR(X | B = 0)$$

[snip]
Hi Bacterius,

I don't think that is true, in general. Have you thought about what would change if $Z_1$ and $Z_2$ did not have the same mean?

Suggestion: You might start with
$$var[X] = E[X^2] - E[X]^2$$
 
Re: Dicrete-continuous random variable!

awkward said:
Hi Bacterius,

I don't think that is true, in general. Have you thought about what would change if $Z_1$ and $Z_2$ did not have the same mean?

Suggestion: You might start with
$$var[X] = E[X^2] - E[X]^2$$

Yes, it only works in this particular case. I did not consider beyond the problem asked.
 
Re: Dicrete-continuous random variable!

Cool problem.

Assign $Z_{i}$ to have mean $\mu_{i}$ and pdf $f_{i}(x)$.

Everything should follow if we find a pdf $f(x)$ for $X$.

$f(x)=P(X=x)=P(X=x|Z_{1})P(Z_{1})+P(X=x|Z_{2})P(Z_{2})$
(Law of Total Probability)
$=pf_{1}(x)+(1-p)f_{2}(x).$

$E(X)=\int_{\mathbb{R}}x*f(x)dx$
$=\int_{\mathbb{R}}{x*[pf_{1}(x)+(1-p)f_{2}(x)]}dx $
$=p\int_{\mathbb{R}}{x*f_{1}(x)dx} + (1-p)\int_{\mathbb{R}}{{x}*f_{2}dx}$
$=pE(Z_{1})+(1-p)E(Z_{2})$
$=p\mu_{1}+(1-p)\mu_{2}$.

$E(X^{2})=\int_{\mathbb{R}}{x^{2}}f(x)dx$
$=\int_{\mathbb{R}}{x^{2}}[pf_{1}(x)+(1-p)f_{2}(x)]dx $
$=p\int_{\mathbb{R}}{x^{2}f_{1}(x)dx}+(1-p)\int_{\mathbb{R}}{x^{2}f_{2}(x)dx}$
$=pE(Z_{1}^{2})+(1-p)E(Z_{2}^{2}) $
$=p(\sigma_{1}^{2}+\mu_{1}^2)+(1-p)(\sigma_{2}^{2}+\mu_{2}^2)$
(Because we know $var(Z)=E(Z^{2})-E(Z)^{2}$)

$var(X)=E(X^{2})-E(X)^2$, for which I am getting
$p\sigma_{1}^{2}+(1-p)\sigma_{2}^{2}+p(1-p)(\mu_{1}-\mu_{2})^{2}$.

This concurs with past answers, but it's strange. The problem is what the variance of X would be if the means are very different like two distributions:

... .. . .. ... ... _________________________ . .. . ... . ... .. ... ..

Calculating the total variance should involve the distance from each point to the total mean where the total mean is pretty far from each distribution's mean. But if the above work is correct, all the information you need about how the total variance is changed when the means are changed is in the difference between the means. (Not the sum- made a mistake typing it up).
 
Last edited:
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Namaste & G'day Postulate: A strongly-knit team wins on average over a less knit one Fundamentals: - Two teams face off with 4 players each - A polo team consists of players that each have assigned to them a measure of their ability (called a "Handicap" - 10 is highest, -2 lowest) I attempted to measure close-knitness of a team in terms of standard deviation (SD) of handicaps of the players. Failure: It turns out that, more often than, a team with a higher SD wins. In my language, that...

Similar threads

Replies
30
Views
4K
Replies
42
Views
4K
Replies
2
Views
2K
Replies
7
Views
1K
Replies
7
Views
2K
Back
Top