Molar mass of CO2 = 44.01 g/mol
Molar mass of H2O = 18.02 g/mol
Molar mass of C = 12.01 g/mol
Molar mass of H = 1.01 g/mol
Moles of CO2 = 1.32 g / 44.01 g/mol = 0.03 mol
Moles of H2O = 0.54 g / 18.02 g/mol = 0.03 mol
Moles of C = 0.03 mol
Moles of H = 0.5 * 0.03 mol = 0.015 mol
Mass of C = 0.03 mol * 12.01 g/mol = 0.36 g
Mass of H = 0.015 mol * 1.01 g/mol = 0.015 g
To simplify the ratio, we divide both masses by the smaller mass (0.015 g):
Mass of C / 0.015 g = 0.36 g / 0.015 g = 24
Mass of H / 0.015 g = 0.015 g / 0.015 g = 1
The empirical formula of the hydrocarbon X is CH4.