An elegant tool to compute certain densities over the integers is called the local to global principle. This principle was introduced by Poonen and Stoll [1]} and uses a local characterization of the target set, i.e., over the \(p\) -adic integers.
In fact, all of the above mentioned examples have a density that can be computed through this tool. The local to global principle has been generalized to number fields by Bright et al. in [2]} and to function fields by Micheli in [3]}.
