In ZnO, O− ions are present on the corners and face centers of the cubic unit cell and Zn2+ ions are present in the alternate tetrahedral voids.
The tetrahedral voids are two in number on each body diagonal. So, in total there are 4 tetrahedral voids. Now, 4 tetrahedral voids are already filled by Zn2+ and the 4 which are left are filled by Mg2+.
So, the new composition is :-
Mg2+:ZN2+:O2−
4 : 4 : 4
Now, ions of a single body diagonal are removed. So, one Zn2+ ion and one Mg2+ ion is removed. So, now the composition of ions is:
Mg2+:ZN2+:O2−
3 : 3 : 4−28 (Since, O2− are at corners of body diagonal)
⇒Mg2+:Zn2+:O2− ⇒ Mg2+:ZN2+:O2−
3 : 3 : 154 4 : 4 : 5
So, new formula of unit cell is Mg4Zn4O5