The correct option is B X2Y
100 g of sample contains 50 g of element X and 50 g of element Y.
The atomic masses of elements X and Y are 10 and 20 g/mol respectively.
The number of moles of element X present in 50 g is 5010=5
The number of moles of element Y present in 50 g is 5020=2.5
Hence, the mole ratio X:Y is 2:1
Thus, the simplest formula of a compound containing 50% of element X and 50% of the element Y by weight is X2Y.