Determination of molecular formula of hydrocarbons by combustion analysis

So, I've this question in my textbook:

$$\pu{20 mL}$$ of unknown gaseous hydrocarbon reacts with excess oxygen gas. It decreases by $$\pu{30 mL}$$ upon cooling down. It decreases farther $$\pu{40 mL}$$ after it passes through an alkali solution. What is the formula of the hydrocarbon?

There is an answer provided, and I get the part where they calculate the "$$x$$" or how many carbon atoms one molecule of the hydrocarbon has. But, I cannot understand how they calculate the number of hydrogen atoms. There is a strange line,

$$\pu{20 mL} + 20(x + y/4)~\pu{mL} - \pu{20x mL} = \pu{30mL}$$

The statement is:

combustion of hydrocarbon and the following cooling down of the resultants mean the decreased volume of water vapor is $$\pu{30 mL}$$.

I do not get this line. Do they mean that the combined volumes of the reactants and the resultants are the same? That's an incorrect inference, isn't it?

P.S. Sorry for poor translation. The question is in my native language.

The combustion can be described by the following reaction:

$$\ce{C_xH_y (g) + (x + y/4) O2 (g) ->[\Delta] x CO2(g) + y/2 H2O (g)}$$

All products are gaseous at first, but as the system cools down to the room temperature, water condenses attributing to the decrease in $$\pu{30 mL}$$. Further decrease in $$\pu{40 mL}$$ is due to reaction of alkali with the remaining gaseous product, $$\ce{CO2}$$:

$$\ce{CO2 (g) + 2 M^IOH (aq) -> M^I2CO3 (aq) + H2O}$$

From the ideal gas law it's obvious that amounts of gaseous substances are proportional to their volumes:

$$n = \frac{p}{RT}V \quad\to\quad n\propto V$$

Let's rewrite the first equation with assigned volumes:

$$\ce{\underset{\pu{20 mL}}{C_xH_y (g)} + (x + y/4) O2 (g) ->[\Delta] \underset{\pu{40 mL}}{x CO2(g)} + \underset{\pu{30 mL}}{y/2 H2O (g)}}$$

Since $$n\propto V$$, and for the balanced chemical equation amounts of reactants and products are equal, so are their volumes. Hence:

Q: Do they mean that the combined volumes of the reactants and the resultants are the same? That's an incorrect inference, isn't it?

A: Yes; no, this is correct for the given reaction.

That "strange line"

$$\pu{20 mL} + 20(x + y/4)~\pu{mL} - \pu{20 mL} = \pu{30mL}$$

is a direct consequence of that as it can also be rewritten as

$$\underset{\ce{C_xH_y}}{\pu{20 mL}} + \underset{\ce{O2}}{20(x + y/4)~\pu{mL}} = \underset{\ce{CO2}}{\pu{20 mL}} + \underset{\ce{H2O}}{\pu{30mL}}.$$

However, as this is a single equation with two unknowns, it only illustrates the preservation of the total amounts of products and reactants. In order to find the formula of unknown hydrocarbon, you just have to equate corresponding coefficients with the ratio between $$\ce{C_xH_y}$$, $$\ce{CO2}$$ and $$\ce{H2O}$$ ($$20:40:30 = 1:2:1.5$$):

$$x = 2$$ $$y/2 = 1.5 \to y = 3$$

which results in empirical formula $$\ce{C2H3}$$. In order to find out the molecular formula you would also need auxiliary data such as molecular weight of the hydrocarbon.

• 1. This is a combustion reaction, so it is an exothermic reaction. Shouldn't the T increase and as P is proportional to T, it'll also increase? Does this affect the "n is proportional to V" statement? and 2. I did a mistake, the equation should be '20mL + 20(x + y/4)mL - 20xmL = 30mL" the "x" is getting multiplied with "20", so the answer should be C2H2 (provided in my textbook) – duckkkk Dec 26 '18 at 6:50
• I edited the question and added the "x" – duckkkk Dec 26 '18 at 6:51