What is the formula of magnesium oxide?

Are you trying to determine the formula of magnesium oxide from first principles? Given that it is a binary compound, we predict a formula of $M {g}_{x} {O}_{y}$. Of course, we know that magnesium oxide has a formula of $M g O$, (i.e. $x = y = 1$), but the experiment that established this formulation would not be straightforward.