Understanding the expected value from a uniform distribution

2.8k Views Asked by At

Anyone know how this was determined. Let X, Y, and Z be a random sample from a uniform distribution over the range [0,1]. The expected value of the distribution is $$(0+1)/2 = 1/2$$

I thought the formula for f(x) of an uniform distribution was $$\frac{1}{b-a}$$

2

There are 2 best solutions below

0
On

Yes, for a continuous uniform random variable $X$ with support on an interval $[a,b]$, where $a < b$, the probability density function of $X$ is given by $$f_X(x) = \begin{cases} \frac{1}{b-a}, & a \le X \le b, \\ 0, & \text{otherwise}. \end{cases}$$ However, this only tells us the density. To get the expected value, you must calculate $$\operatorname{E}[X] = \int_{x = -\infty}^\infty x f_X(x) \, dx = \int_{x=a}^b x \cdot \frac{1}{b-a} \, dx = \left[\frac{x^2}{2(b-a)}\right]_{x=a}^b = \frac{b^2 - a^2}{2(b-a)} = \frac{a+b}{2}.$$ And this is how one gets, for $a = 0$, $b = 1$, $$\operatorname{E}[X] = \frac{0 + 1}{2} = \frac{1}{2}.$$

0
On

By $f(x)$ you're referring to the probability density function (PDF), which tells you the probability of observing a single value.

The expected value, call it $\mathbb{E}[X]$, is the long-run average. For a continuous uniform distribution running from 0 to 1 this is defined as: $$\mathbb{E}[X]=\int_{0}^{1}xf(x)dx=\int_{0}^{1}xdx$$

This is just $\frac{1}{2}.$