Let the formula of the hydrocarbon be CxHy. The combustion of the hydrocarbon can be shown as:
CxHy10 ml+(x+y4)O210(xy4)ml → xCO210x ml+y2H2O
The first reduction in volume after explosion
=10+10(s+y4)−10x=20
=10+10y4=20
Thus, y=10×410=4
Volumeofcarbondioxideproduced=20ml
Thus, 10x=20
⟹x=2010=2
Hence, the molecular formula of the hydrocarbon is C2H4.