If $X \sim U(a, b)$ and $Y \sim U(a, X)$, then can I say that $Y \sim U(a, b)?$
I am talking about continuous uniform distributions with limits $[a, b]$. A proof (or disproof!) will be appreciated.
We can derive the distribution of $Y$ analytically. First, notice that it is $Y|X$ that follows the uniform distribution, i.e.
$$f\left(y|x \right) = U(a, X) $$
and so
$$\begin{align} f(y) = \int_{-\infty}^{\infty} f(y|x) f(x) dx & = \int_{y}^{b} \frac{1}{x-a} \frac{1}{b-a} dx \\ & = \frac{1}{b-a} \int_{y}^{b} \frac{1}{x-a} dx \\ &= \frac{1}{b-a} \left[ \log(b-a)-\log(y-a) \right] ,\quad a<y<b \end{align}$$
which is not a uniform distribution on account of $\log(y-a)$. Here is what the simulated density looks like for a $U(0,1)$ distribution, overlaid with what we just computed.
y <- runif(1000, 0, runif(1000,0,1))
hist(y, prob =T)
curve( -log(x), add = TRUE, lwd = 2)
Definitely not.
For simplicity, let us define $a = 0, b = 1$.
Then
$P(Y > 0.5) = P(Y > 0.5 | X > 0.5)P(X > 0.5)$
$ < P(X< 0.5) = 0.5$
Because of the strict inequality, it is not possible that $Y \sim $ Unif(0,1).
hist(runif(1e4,0,runif(1e4)))
pretty clearly shows that $Y$ is certainly not uniformly distributed. (I'm posting this as a comment since you asked for a proof, which shouldn't be hard, but to be honest, given the skewed histogram, I don't think a proof is necessary...) $\endgroup$