Density is a measurement of how tightly matter is packed together in an object. It is calculated by dividing an object's mass by its volume. Ice floats in water because it has a lower density than water - ice has a density of about 0.9 g/cm3 while water has a density of 1 g/cm3. Hot air balloons and magma rise because they have lower densities than the surrounding air and rock, respectively. A ship will float if its overall density is less than that of water, which is 1 g/cm3.