A gas produced in a chemical reaction can be collected by water displacement. Because the gas is collected over water, it is not pure but is mixed with vapor from the evaporation of the water. Dalton's law can be used to calculate the amount of the desired gas by subtracting the contribution of the water vapor.