Solution (source code)

= Solution

With $N/2$ white balls, uniform <sampling without replacement> gives the <probability>
$$
p_w=\frac{N/2}{N}\frac{N/2-1}{N-1}=\frac{N-2}{4(N-1)}.
$$
Rearranging, $4p_w(N-1)=N-2$, so
$$
\boxed{N=\frac{2-4p_w}{1-4p_w}=\frac{2(1-2p_w)}{1-4p_w}.}
$$
A finite admissible population has even $N\geq2$ and $0\leq p_w<1/4$, so the denominator is nonzero.