Probability of cavity formation in water and corresponding Lennard-Jones liquid