Answer: The chemical formula for the given compound is

Step-by-step explanation:
Magnesium is the 12th element of the periodic table having electronic configuration of
![[Ne]3s^2](https://img.qammunity.org/2017/formulas/chemistry/high-school/9mwzgwbpzl63tmdm1x2gw49eh2o6vri7jc.png)
This element will loose 2 electrons and form an oxidation state of +2 units.
Nitrogen is the 7th element of the periodic table having electronic configuration of
![[He]2s^22p^3](https://img.qammunity.org/2017/formulas/chemistry/high-school/diky29gndw3cwjijvqdtxwmud5p2cly7a5.png)
This element requires 3 electrons and thus shows an oxidation state of -3 units.
By criss-cross method, the oxidation state of the ions gets exchanged and this form the subscripts of the other ions. It results in the formation of a neutral compound.
Thus, the chemical formula for the given compound is
