I am working on a problem in which we know that a certain population follows a uniform distribution over $[M-(1/2),M+(1/2)]$, and we know that $M$ follows a uniform distribution over $[0,1]$. So we have a kind of uniform distribution inside another. We know that the density function for $M$ is $1$, but how do we get the density function for the population, since that should depend on $M$?
2026-03-30 13:53:28.1774878808
What is the density function of a distribution that has another random variable in itself?
51 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2

Let $X\sim U(M-0.5,M+0.5)$ where $M\sim U(0,1)$. From the formula for conditional probability density function we have that
$$f_{X,M}(x,m) = f_X(x|M=m)f_M(m).$$
Since $$f_M(m) = \begin{cases}1,\quad m\in[0,1]\\0,\quad \text{otherwise}\end{cases}$$ and
$$f_X(x|M=m) = \begin{cases}1,\quad x\in[m-0.5,m+0.5]\\0,\quad \text{otherwise}\end{cases}$$
it follows that
$$f_{X,M}(x,m) = \begin{cases}1,\quad m\in[\max(0,x-0.5),\min(1,x+0.5)]\\0,\quad \text{otherwise}\end{cases}$$
Finally, for $x\in[-0.5,1.5]$,
$$f_{X}(x) = \int_{-\infty}^{\infty} f_{X,M}(x,m)dm=\int_{\max(0,x-0.5)}^{\min(1,x+0.5)} 1dm=\min(1,x+0.5)-\max(0,x-0.5),$$
or
$$ f_{X}(x) = \begin{cases} 0\quad\quad\;\;,\quad x<-0.5\\ 0.5+x,\quad x\in[-0.5,0.5]\\ 1.5-x,\quad x\in(0.5,1.5]\\ 0\quad\quad\;\;,\quad x>1.5\\ \end{cases}$$