What is the formula for the compound that forms when magnesium bonds with phosphorus?
The formula would be
First, we know this is an ionic compound because one of the elements is a metal.
From the periodic table or from the valence shells of the atoms, we can determine that magnesium forms an ion of
The formula is based on combining these ions in the smallest ratio that results in a total charge of zero, because all compounds must be electrically neutral.
A compound with three magnesium ions and two phosphorus ions would be written