The law of definite proportions states that pure samples of the same compound contain the same elements combined in the same proportion by mass. This means that no matter where or how the compound is obtained, the ratio of the masses of the elements in the compound will always be the same. For example, if a water molecule contains 2 hydrogen atoms and 1 oxygen atom, the ratio of the masses of hydrogen to oxygen will always be 2:1 in any sample of water.