To study the crystal structure of the Si(111) 2 × 2-(Bi,Mg) surface reconstruction, formed during the adsorption of magnesium on the Si(111) \(\sqrt 3 \times \sqrt 3 \) -Bi surface phase, ab initio calculations have been performed. The stoichiometric composition of the unit cell of the 2 × 2 surface reconstruction has been determined. Using the calculated formation energies, the most stable structures for the two-dimensional Bi \(_{X}\) Mg \(_{Y}\) alloy have been identified. It has been shown that the structural model with the configuration \(X = 2\) and \(Y = 4\) is in good agreement with the low-energy electron diffraction and scanning tunneling microscopy results observed for the reconstructed Si(111) 2 × 2-(Bi,Mg) surface.