Molar atomic mass of magnesium = 24g mol−1 Number of moles = Given massMolar mass Number of moles of Mg =12g24g mol−1=0.5 mol .