= Solution
Squaring a variable with the <standard normal distribution> gives the required <chi-squared distribution>. Its two inverse images at $y>0$ are $\pm\sqrt y$, so the change-of-variable formula gives
$$
g(y)=\frac{\exp(-y/2)}{\sqrt{2\pi y}}.
$$
Draw the branch-selection uniform variable independently of the randomness used for the normal draw. Then the pair $(Y,U)$ has the product law: conditioning on $Y$ leaves $U$ uniform. This independence is exactly what justifies interpreting the subsequent threshold as the <conditional probability> of selecting the smaller root.
Back to article page