D. Mg(ClO₄)₂.
Explanation
- Mg²⁺ is the formula for magnesium ions. The charge on each magnesium ion is +2.
- ClO₄⁻ is the formula for perchlorate ions. The charge on each perchlorate ion is -1.
Mg²⁺ ions carry positive charges. ClO₄⁻ ions carry negative charges. The ratio between the two types of ions shall ensure that the ionic compound is overall neutral. +2 + 2 × (-1) = 0. As a result, each Mg²⁺ ion shall pair up with two ClO₄⁻ ions. The ratio between Mg²⁺ and ClO₄⁻ ions shall be 1:2.
Simplify this ratio such that the two numbers in the ratio are relatively prime. This ratio shall appear in the subscript of the empirical formula. Omit the number "1" in the subscript next to Mg. Hence the formula Mg(ClO₄)₂.