  It is widely accepted that supersonic, magnetised turbulence plays a
fundamental role for star formation in molecular clouds. It produces the
initial dense gas seeds out of which new stars can form. However, the exact
relation between gas compression, turbulent Mach number, and magnetic field
strength is still poorly understood. Here, we introduce and test an analytical
prediction for the relation between the density variance and the
root-mean-square Mach number in supersonic, isothermal, magnetised turbulent
flows. We approximate the density and velocity structure of the interstellar
medium as a superposition of shock waves. We obtain the density contrast
considering the momentum equation for a single magnetised shock and extrapolate
this result to the entire cloud. Depending on the field geometry, we then make
three different assumptions based on observational and theoretical constraints:
B independent of density, B proportional to the root square of the density and
B proportional to the density. We test the analytically derived density
variance--Mach number relation with numerical simulations, and find that for B
proportional to the root square of the density, the variance in the logarithmic
density contrast, $\sigma_{\ln
\rho/\rho_0}^2=\ln[1+b^2\mathscr{M}^2\beta_0/(\beta_0+1)]$, fits very well to
simulated data with turbulent forcing parameter b=0.4, when the gas is
super-Alfv\'enic. However, this result breaks down when the turbulence becomes
trans-Alfv\'enic or sub-Alfv\'enic, because in this regime the turbulence
becomes highly anisotropic. Our density variance--Mach number relations
simplify to the purely hydrodynamic relation as the ratio of thermal to
magnetic pressure $\beta_0$ approaches infinite.
