Finding simplest formula of a compound with following specifications

I ran into the following problem, wherein I'm asked to find the simplest formula of a compound containing $50 \%$ of element $X$ (atomic wt. 10) and $50\%$ of element $Y$ (atomic wt. 20). 


I know about few laws of chemical combinations. I think Law of Definite Proportions may come into play. 


$$\text{atomic wt. }X:\text{atomic wt. } Y=1:2\implies XY\_2$$


Am I correct in my reasoning? If not kindly point out the flaws, if any? Thanks




$$M=\frac{m}{n}\ \curvearrowright\ m=M\cdot n$$


$$M\_X=10\ g\ mol^{-1},\ M\_Y=20\ g\ mol^{-1}$$


$$\frac{m\_X}{m\_X+m\_Y}=50\ \%,\ \frac{m\_Y}{m\_X+m\_Y}=50\ \%:$$


$$m\_X=m\_Y$$


$$M\_X\cdot n\_X=M\_Y\cdot n\_Y$$


$$\frac{n\_X}{n\_Y}=\frac{M\_Y}{M\_X}=\frac{20\ g\ mol^{-1}}{10\ g\ mol^{-1}}=2$$


$$n\_X=2\ n\_Y$$


$$\curvearrowright\ X\_2Y$$


 1