Hello, Ivy,
To calculate the molarities, we need the molar masses of both compounds. Those are the sum of the atomic masses for each atom in each compound. For example, MgCl2 has one Mg and 2 Cl atoms, for a total mass of 95.2 AMU, which can also be expressed as 95.2 g/mole. 95.2 grams of MgCl2 is also Avogadro's number of molecules: 6.02x1023.
Molarity is defined as moles/liter. We have the moles and volume of the sample, but the volume is in ml. Convert that to liters: 54.0 ml * (1 liter/1000ml) = 0.054 liters.
The moles of MgCl2 is the mass of the sample divided by it's molar mass: 5.90g/(95.2 g/mole) = 0.061975 moles. We are limited to 3 sig figs, so the concentration is 0.0620M.
While we're on MgCl2, let's calculate the number of ions from this compound. When dissolved, we get one Mg+2 ion and 2 Cl- ions. So there are 3 ions for every molecule. To get the number of molecules, multiply the number of moles of MgCl2 times Avogadro's number. Then multiply that times the number of ions per molecule (3, in this case).
0.0620 moles * 6.02 x 10 23 molecules/mole * 3 ions/molecule= 1.12 x 1023 ions
Look at how the units cancel to leave just ions.
The sodium bicarbonate is done exactly the same way. Add up the element AMU's to get the molar mass (g/mole) and divide the mass by the molar mass to get moles. Do the same steps as above to get the molarity. In this case, we also get three ions per molecule: The sodium(Na+), the hydrogen (H+), and the carbonate (CO32-). Multiply the concentration (in M) times Avogadro's Number, time 3 to get the number of ions from the sodium bicarbonate.
Then add the ion count from both compounds to get the total ions.
I hope this helps,
Bob