Both samples have a mass of 1 g. Suppose the first sample has a generic mass, X, of 0.34 then it follows that the mass of Y = 1 - 0.34 = 0.66g. So we have a mass ratio of 0.34 : 0.66 where our ratio is of the form X : Y. If we divide by the smallest mass we end up with 1 : 1.94. But Since 1.94 ~ 97/50 then we multiply through by 50, when we do, we end up with a chemical form of the form X50Y97. On the other hand if the sample has a mass of 0.44 of Y then it also follows that the mass of X = 1 - 0.44 = 0.56. So we have a mass ratio of 0.56 : 0.44. If we divide by the smallest mass we end up with 1.27 : 1. Since 1.27 ~ 127/100 then if we multiply through by 100, we end up with a chemical form X127Y100