Consider U(0, b). I shift up the density the segment from [0, 0.2*b) to contain probability 0.8, and shift down the density in segment from [0.2*b, b] to contain probability 0.2.
I know that the mean will be in the segment [0, 0.2*b) because at least 50% is under the curve there. I compute the c.d.f.
$$\int_0^x \! \frac{0.8}{0.2\times b} \, \mathrm{d} x. = \frac{4\times x}{b}$$
and set it equal to 0.5 (which is where the mean is).
$$\frac{4\times x}{b} = 0.5$$ $$x = 1/8 \times b$$
- Is this approach correct? I'm not sure if I'm calculating the median or mean. If not, please suggest an alternative. Can I simply calculate first moments of each segment and then add ALL the integrals together? EDIT: RESOLVED: Its the latter.
- In the case where the first segment does not contain the mean, I subtract the area under the curve in the first segment from 0.5. Then, use the c.d.f. of the next segment and set it equal to that difference and solve for x to get the mean? Or is there a more elegant way to do this?EDIT: RESOLVED:
- Somehow related: If I take the probability distribution of any random variable and shift around density (cont.) or weight (discrete) at arbitrary intervals and points around, does the variance stay the same? My intuition tells me yes, because the mean remains unchanged and the dispersion at each value in the support does not get lost.