Statistics for Cavitation due to Rarefaction Waves and the Reflection of Shock Waves from the Free Surface of a Liquid