Expected value of a continuous random variable of a stick

A $1m$ stick breaks randomly, every point has the same probability. What's the quotient of the average shortest and longest length?

So for the shorter piece we have $0 < x < 0,5$, the average is $0,25$. For the longer piece we have $0,5 < x <1$, so the averge is $0,75$. The quotient would be $0,25/0,75=1/3$.

I think that this is correct but how do I write this rigorously?


Let $U \sim \mathrm{Unif}[0, 1]$. Then, the shortest piece has length $X := \min\{U, 1 - U\}$. That is, $X = U$ if $U \le \tfrac12$ and $X = 1 - U$ if $U \ge \tfrac12$. But, $(U \mid U \le \tfrac12) \sim \mathrm{Unif}[0, \tfrac12]$ and $(1 - U \mid U \ge \tfrac12) \sim \mathrm{Unif}[0, \tfrac12]$. Thus, in either case, $X \sim \mathrm{Unif}[0, \tfrac12]$.

As you then point out, $\mathbb E(X) = \tfrac14$ and $\mathbb E(1 - X) = \tfrac34$, so the ratio is $1/3$.