What's the variance of a uniform distribution defined on [0,6]?
Answers
Answer:
3
Step-by-step explanation:
Let's change the 6 to b and deal with this more generality.
First, the density function is f(x) = 1 / b for x in [0, b], and it is 0 elsewhere. That much is reasonably clear since the full area under the curve has to be 1 for a probability density function.
Since it's uniform, we can see quickly that the mean is b/2 by virtue of this being the "middle" and the distribution being symmetric about this point. So we don't need any maths to do get that far. Formally, if X is a random variable with this distribution, then we have said E(X) = b/2 (the expected value of X is b/2).
For the variance, we use the fact that
var(X) = E(X²) - ( E(X) )².
To get E(X²), we calculate the integral of x² times the density function:
E(X²) = ∫ x² (1/b) dx (integrating from 0 to b)
= (1/b) ∫ x² dx (integrating from 0 to b)
= (1/b) [ x³ / 3 ] (evaluating from 0 to b)
= (1/b) (b³/3) = b²/3.
Now we plug the values that we have into the formula for the variance:
var(X) = E(X²) - ( E(X) )²
= b²/3 - ( b/2 )²
= b²/3 - b²/4
= b² / 12.
For our special case where b = 6, the variance is then
6² / 12 = 6 / 2 = 3.