In order to determine if compounds X and Y are the same, the mole percentages of the elements present should be equal in both compounds.
For compound X
number of moles H = 15/ 1 =15 mol H
number of moles O = 120/ 16 = 7.5 mol O
total moles = 22.5 mol
mole percentages
% mole H = 67%
% mole O = 33%
For compound Y
mole of H = 2 /1 = 2
mole of O = 32/16 = 2
total mole = 4 mole
mol %
% mol H = 50%
% mol O = 50%
there the two compounds are not the same.