Given a stick of length $l$. We cut the stick twice. Let $X$ be the random variable defined by the length of the stick after the first cut, and $Y$ be the random variable defined by the length of the stick after the second cut. What is the probability for $Y>\frac{l}{4}$?
First, the PDF of $X$ is uniform, thus $f_{X}(x)=\frac{1}{l}$ (since $0\le X\le l$). $Y$ is uniform in $[0,X]$, then $f_{Y|X}(y|x)=\frac{1}{x}$. Then the probability of $Y>\frac{l}{4}$ is $$\int_{l/4}^{x}\frac{1}{x}dy=1-\frac{l}{4x}$$
On the other hand, we have $$f_{X,Y}=f_Xf_{Y|X}=\frac{1}{lx}$$ We write the probability of $Y>\frac{l}{4}$ as follow: $$P\left(\frac{l}{4}<Y<x|\frac{l}{4}\le X \le l\right)=\frac{P(l/4<Y<x,l/4\le X \le l)}{P(l/4\le X\le l)}=\frac{\int_{l/4}^{x}\int_{l/4}^{l} \frac{1}{lx}dxdy}{\frac{1}{l}}$$
which leads to a different result from $1-\frac{l}{4x}$.
My question is which of the solution is correct, and what's wrong with the incorrect solution?
Thanks in advance.