Finding Variance and Expectation of Boolean Variable

3.3k Views Asked by At

Below is the joint distribution of Boolean random variables X1, X2 and X3. How do I find variance and expectation of X2? I understand that variance is "average of squares of difference from mean value". But here we have boolean values. I am confused. Can somebody suggest how to do this? I am a newbie to probability and random variables.

3

There are 3 best solutions below

5
On BEST ANSWER

For reference, I am repeating the PDF (or PMF) table of $X_2.$ Then $E(X_2) = \sum_{i=0}^6 v_i p_i,$ the terms and total of which are in the third row. (My notation may different from that of your book, so make sure you connect the table with whatever formula your book has.)

 value     0    0    1    1    0    0    1    1     Total
 prob.    .04  .08  .08  .20  .06  .12  .12  .30     1.00
 product   0    0   .08  .2    0    0   .12  .30     0.70

The result is that $E(X_2) = 0+0+.08+\cdots+.30 = .70.$ To find the variance $V(X_2),$ there are two possible paths. The easiest is to use the general formula $$V(Y) = E(Y^2) - [E(Y)]^2.$$

For your 0-1 random variable, $E(X) = E(X^2)$ because $0^2 = 0$ and $1^2 = 1$ are the only two values involved. Applied to $X_2,$ the general formula gives $$V(X_2) = .7 - (.7)^2 = .7 - .49 = .21.$$ This is the point I was trying to make in my note.

A second way to find the variance of $X_2$ is to use the definition of the variance of a discrete random variable: $$ V(Y) = \sum p_i(v_i - \mu)^2,$$ where the sum is taken over all values for which a probability has been defined, and $\mu = E(Y).$ In order to illustrate this, I will make a new table with rows 'values' and 'prob' as before, but with new rows 'diff' to show $(v_i - \mu)$, 'sqr' to show $(v_i - \mu)^2$, and 'Prod2' to show $p_i(v_i - \mu)^2.$

 values   0     0      1     1      0     0     1     1    Total
 prob    .04   .08    .08   .20   .06    .12   .12   .30    1.0     
 dif    -.7   -.7     .3    .3   -.7    -.7    .3    .3     ---
 sqr     .49   .49    .09   .09   .49    .49   .09   .09    ---
 Prod2   .0196 .0392  .0072 .0180 .0294  .0588 .0108 .0270  0.21

This gives the same variance as before. But the previous method is simpler in your case.

I hope these illustrations have helped you understand the basic formulas and that you can find means and variances of the other two random variables in your problem.

10
On

It's no different than an integer variable with values $\{0,1\}$. Naturally, both EV and variance will be in the real interval $[0,1]$.
What you have to do is simply find the distribution of $X_2$ from the table - this will be parameterized by $p\in[0,1]$ with $P(X_2=1) = p$ and $P(X_2=0)=1-p$.
The expected value will then be $\mathbb E(X_2) = p$ and the variance will be $\mathrm{Var}(X_2) = p(1-p)^2 + (1-p)p^2 = p(1-p)$

0
On

It looks like you're asking why the variance and expected value of a boolean variable isn't itself boolean. The problem goes away if you consider variance to be a measure of the variable rather than the variable itself, and consider 'expected value' to be a form of scaled probability rather than the domain value to 'expect'.

For example, given instances {0,1,1}, the mean is 2/3, which isn't binary; variance is analogous. Likewise, if you consider the same 3 instances to represent something you could earn in a single 3-outcome event, then assuming equal probability of each outcome, in 100 events, you would expect your earnings to be represented by 2/3 * 100, which isn't binary.