Determining the relative number of moles of Mg and O