Random hyperplane rounding (source code)

= Random hyperplane rounding

For <unit vectors> $u,v$ and a random normal $a$ with independent <standard normal distribution> coordinates,
$$
\mathbb P\{\operatorname{sign}\langle a,u\rangle\ne\operatorname{sign}\langle a,v\rangle\}
=\frac{\arccos\langle u,v\rangle}{\pi}.
$$
The <Gaussian distribution> is invariant under <orthogonal transformations>. Projecting onto the <plane> spanned by $u,v$ therefore gives a uniformly distributed direction. If the angle between $u,v$ is $\theta$, the sign-disagreement directions form two sectors of total angle $2\theta$ out of $2\pi$. The endpoint cases $u=v$ and $u=-v$ give probabilities zero and one directly.