I understand all volumes are at SLC. Thus volume of CO2 in reaction is 280-40=240ml. Therefore ratio of 2*n(CxHy) = N(CO2)
We can find the length of the hydrcarbon which is 2 carbons long. The thing im confused about is how to find the ratio for hydrogen
You got the first part correct in calculating the volume of carbon dioxide gas as 240ml (280-40ml).
Thus we have 120ml of hydrocarbon : 240ml of CO2.
Since all gasses are at SLC we can then say the molar ration of hydrocarbon to CO2 is 1:2 (this can be explained by applying the universal gas equation PV=nRT, where n=PV/RT with V/RT being the same for both gasses (due to identical pressure and temperature conditions) such that something of twice the volume will be twice the molar amount)
We can also calculate the volume of oxygen that reacted with the hydrocarbon by subtracting the remaining 40ml of gas (which is excess oxygen) from the 400ml of oxygen initially present. This gives us a volume of 360ml of oxygen that reacted with the unknown hydrocarbon.
Since this oxygen is also at SLC, we can say the ration of oxygen:hydrocarbon:CO2 is 3:1:2.
We can now apply this information to the general formula for the complete combustion of a hydrocarbon:
1CxHy + 3O2 --> 2CO2 + ?H2O
First we can balance the carbons:
C
2Hy + 3O2 --> 2CO2 + H2O
Now we can balance the oxygens:
C2Hy + 3CO2 --> 2CO2 +
2H2O
And lastly, we can balance the hydrogens:
C2H
4 + 3CO2 --> 2CO2 + 2H2O
Thus we arrive at the formula for the hydrocarbon!
It seems you got confused with the ratio of hydrocarbon:CO2 and flipped it the wrong way around - remember that there was twice the amount of CO2 produced as there was hydrocarbon initially.
I think the main reason you got stumped after that was perhaps that you didn't realise that the remaining 40ml of gas were oxygen. Since oxygen was in excess, it would be expected that there would be oxygen remaining (hence the 40ml of gas that were remaining). This 40ml of remaining gas would not have been composed of any other gas as the complete combustion of a hydrocarbon only produces CO2 as a product and water (as another product of the combustion reaction) would have existed in liquid form at SLC.
Hopefully this clarifies things!