Solution (source code)

= Solution

Using $|\psi_b\rangle$ as the horizontal axis and $|\psi_g\rangle$ as the vertical axis,
$$
|\Omega\rangle=\cos\theta|\psi_b\rangle+sin\theta|\psi_g\rangle.
$$
Thus $\sin\theta=\sqrt p$ and
$$
\boxed{\theta=\arcsin\sqrt p.}
$$