# Finding density function of continuous random variable

A stick of length L is broken at a uniformly chosen random point. Let $$X$$ be the length of the smaller piece. Find the density of $$X$$.

# try

Notice that the probability that the stick is broken a certain is equally likely. So, we have that smaller piece is either $$[0,x]$$ or $$[x,L]$$

$$P(X \leq x) = \frac{ \text{length from origin to x}+\text{length from x to L}}{\text{total length} }= \frac{x + |x-L|}{L}$$

But, this leads anywhere. Instead I was thinking that the only way the $$X$$ is the smaller piece is if $$X$$ is less than $$L/2$$ thus $$X$$ is uniform on $$L/2$$ and s o

$$f_X(x) = \frac{2}{L}$$

Is this correct?

• $Y \sim U(0,L)$ Find $Y=min(X,L-X)$ – Daman deep Dec 15 '18 at 5:03
• "But, this leads anywhere" This very much leads to the result, only one should be more careful: for $x$ in $(0,L/2)$, the event $\{X<x\}$ corresponds to the location of the break being in $[0,x]$ or in $[L-x,L]$, thus, $$P(X<x)=\frac{x+(L-(L-x))}L=\frac{2x}L$$ and you are done. – Did Dec 15 '18 at 6:37