Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
No, it isn't. In R: 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...) – Stephan Kolassa Jan 12 at 23:31
Thank you for your comment. Yeah, the graph disproves the statement itself! – Blain Waan Jan 14 at 9:47
A change of location and scale makes $a=0,b=1$, in which case for any number $y\in[0,1]$, $\Pr(Y\le y)=y/X$ provided $X\ge y$ (and is $0$ otherwise). Use $\Pr(X\ge y)=1-y$ to work out that conditional probability. – whuber Jan 14 at 13:13
up vote 13 down vote accepted

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. enter image description here

y <- runif(1000, 0, runif(1000,0,1))
hist(y, prob =T)
curve( -log(x), add = TRUE, lwd = 2)
share|improve this answer
Thank you @JohnK – Blain Waan Jan 14 at 9:48

Definitely not.

For simplicity, let us define $a = 0, b = 1$.


$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).

share|improve this answer
Thank you @Cliff AB – Blain Waan Jan 14 at 9:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.