Solution (source code)

= Solution

An orbit is unbound precisely when its <specific orbital energy> is nonnegative, equivalently $a/a'\leq0$. At <periapsis>, $f=0$, and for $e=1/2$ the condition from part (d) is
$$
1-\gamma^2-2\sqrt3\,\gamma\cos\phi\leq0,
\qquad
\cos\phi\geq\frac{1-\gamma^2}{2\sqrt3\,\gamma}.
$$
The directions are sampled from the <uniform distribution> on a circle. The fraction satisfying $\cos\phi\geq x$ is $\arccos x/\pi$; setting it equal to $1/6$ gives $x=\sqrt3/2$. Therefore
$$
\frac{1-\gamma^2}{2\sqrt3\,\gamma}=\frac{\sqrt3}{2},
\qquad
\gamma^2+3\gamma-1=0.
$$
The positive root is
$$
\boxed{\gamma=\frac{\sqrt{13}-3}{2}}.
$$

Solved by gpt-5.6-sol high.