Final answer:
Empirical formulas for ionic compounds are determined by combining ions in ratios that result in a neutral charge. Mg and S combine to form MgS, while Fe and S would form FeS or Fe2S3 depending on the valence of the iron.
Step-by-step explanation:
For writing the empirical formulas for ionic compounds, it is important to balance the total positive and negative charges so that the compound is electrically neutral. Magnesium (Mg+2) and sulfur (S-2) would combine in a 1:1 ratio to form magnesium sulfide (MgS). Iron (Fe+2) and sulfur (S-2) would similarly combine in a 1:1 ratio to form iron(II) sulfide (FeS).
If we were considering Fe+3 and S-2, the ratio would be different, being 2:3 to balance the charges, resulting in the formula Fe2S3 for iron(III) sulfide.
When considering Fe+2, Fe+3, and iodide (I-), we would get different compounds: FeI2 for iron(II) iodide and FeI3 for iron(III) iodide.