# Var(x) = E[ x^2] - (E[X])^

1. May 22, 2005

### vptran84

Hi,

Can someone please please show me why Var(x) = E[ x^2] - (E[X])^2.

I just dont get it. THanks in advance.

2. May 22, 2005

### kleinwolf

Var(X)=E([X-E(X)]^2)

3. May 22, 2005

### vptran84

yeah i got that part, similar to distributive property, but where does variance come from? Like how did they get E[x^2]-(E[X])^2 ??? How did they get E[x^2] and (E[X])^2 ??

4. May 22, 2005

### SpaceTiger

Staff Emeritus
$$(x-<x>)^2=x^2-2x<x>+<x>^2$$

$$\sigma^2=<(x-<x>)^2>=<x^2-2x<x>+<x>^2>=<x^2>-2<x><x>+<x>^2$$

$$\sigma^2=<x^2>-<x>^2$$

This just follows from the properties of expectation values, which follow from the properties of integrals:

$$<x>=\frac{\int xf(x)dx}{\int f(x)dx}=\int xP(x)dx$$

5. May 23, 2005

### BicycleTree

So <x> = E(x). The denominator there, $$\int f(x)dx$$, always equals 1 because f is a probability density function. The definition of an expected value is just the numerator of that fraction.

6. May 23, 2005

### SpaceTiger

Staff Emeritus
I'm not defining f(x) to be the probability density, just some distribution function. P(x) is the probability density. Sorry for not making that clear. But yes, <x>=E(x).

7. May 23, 2005

### BicycleTree

So then what is <x>? Are you just defining it here or does it mean something else?

What's the difference between a distribution function and a density function? In my course they were used synonymously, except a distribution function could also be a probability mass function.

8. May 23, 2005

### SpaceTiger

Staff Emeritus
You were right, it's the expectation value.

I suppose I was using the wrong terminology. What my advisors sometimes call simply a "distribution function" is sometimes actually a "frequency distribution". This is what I meant by f(x). The idea is that the integral over its domain is not equal to one, but is instead equal to the number of objects in the sample (for example). The "distribution function" is actually something entirely different; that is, the cumulative probability of the value being less than x. Check Mathworld for the definitions of these things if you want more precision. If you don't want to bother (I wouldn't blame you), then disregard the middle part of my last equation (with f(x)) and just consider the part with P(x), the probability density.

9. May 23, 2005

### BicycleTree

Yes, I know what a distribution function is.

It's just a different notation. In the course I took, P(...) means the probability of the stuff in the parentheses (which would be a logical formula). So you might say P(X=x). Also, distribution functions were denoted by capital letters and density/mass functions were denoted by the corresponding lowercase letters, so even if P didn't mean "the probability of," it would be a distribution function, not a density function.

10. Jun 14, 2005