The chemical symbol of magnesium (Magnesium) is Mg, and the chemical symbol of fluorine (Fluorine) is F. The outermost layer of a magnesium atom has 2 electrons, and it is easy to lose these 2 electrons to form a magnesium ion ($Mg ^ {2 + }$); The outermost layer of a fluorine atom has 7 electrons, and it is easy to get 1 electron to form a fluoride ion ($F ^ - $). In order to achieve electron balance, 1 magnesium ion will combine with 2 fluorine ions, so the chemical formula of the compound composed of magnesium and fluorine is $MgF_ {2} $.
This chemical principle is described in classical Chinese as follows:
Magnesium, its quality is active, the outer layer of the atom has two electrons, and it often wants to go to a stable state, so it forms a two-positively charged ion, denoted as $Mg ^ {2 +} $. Fluorine, also active, has seven electrons in the outer layer of the atom, and thirsts for one electron to stabilize at eight corners, so it forms a negatively charged ion, numbered $F ^ - $. Yin and yang attract each other, and it is natural. In order to form a stable compound, a magnesium ion must combine with a difluoride ion, and with a flat charge, the chemical formula of the final compound is $MgF_ {2} $. This is the balance of anions and cations according to the number, and the wonder of combining with each other to form a product.