Compute the mean and median for this density histogram. To compute the mean, use
weighted average. The weights are the areas of each histogram bar and the
observations are the midpoints
of the bars
0.6 +
|
0.5 + +-------+
| | |
0.4 + | |
| | |
0.3 + +-------+ |
| | | |
0.2 + | | |
| | | |
0.1 + +-------+ | +-------+
| | | | | |
0.0 + +-------+-------+-------+-------+
0 1 2 3 4
Answer: the third histogram bar contains the median. (1-0)*0.1 + (2-1)*0.3 = 0.4 of the observations are to the
left of the bin from 2; (1-0)*0.1 + (2-1)*0.3 + (3-2)*0.5 = 0.9 of the observations are to the left of 3.
Therefore, if m is the median,
(0.5-0.4)/(0.9-0.4) = (m-2)/(3-2)
0.1/0.5 = (m-2)/1
0.2 = m - 2
m = 2.2
To compute the mean, we use the weighted average:
x1 w1 + ... + xn wn 0.5*0.1 + 1.5*0.3 + 2.5*0.5 + 3.5*0.1
-------------------- = -------------------------------------
w1 + ... + wn 0.1 + 0.3 + 0.5 + 0.1
0.05 + 0.45 + 1.25 + 0.35
------------------------- = 2.1
1.0