Solution (source code)

= Solution

A prime ideal of $K$ is principal exactly when its Artin symbol in
$$
\operatorname{Gal}(H_K/K)\cong\operatorname{Cl}(K)
$$
is the identity. The group has order two. Applying the <Chebotarev density theorem> to the identity conjugacy class gives density
$$
\boxed{\frac12}.
$$