Jen’s dog broke her six inch long pencil off at a random point on the pencil. Find the density function and the expected value of the ratio of the shorter piece and the longer piece.
$X$ is longer piece and $Y$ is smaller
$U \sim U(0,6)$
Define $X = \text{max}\{U, 6-U\}$
so that
$$X = \begin{cases} 6-U, & 0 < U < 3 \\ U, & 3 \leq U < 6 \end{cases} $$
It follows that
$$X = \frac{6 + |2U - 6|}{2}$$
Similarly
$$Y = \frac{6 - |6-2U|}{2}$$
Let $Z=Y/X$
$$F_Z(z) = P (Z \leq z)$$
$$=P\left(\frac{6 + |2U - 6|}{6 - |6-2U|} \leq z \right)$$
I don't know what to do next