I am currently studying gaseous state and I encountered the following problem.
A container with a volume 3 liter holds $\ce{N2(g)}$ and $\ce{H2O(l)}$ at $\pu{29 ^\circ C}$. The pressure is found to be $\pu{1 atm}$. The water is then split into hydrogen and oxygen by electrolysis according to the reaction $$\ce{H2O (l) -> H2 (g) + 1/2 O2 (g)}$$ After the reaction is complete, the pressure is $\pu{1.86 atm}$. What mass of water was present in the container? The aqueous tension of water at $\pu{29 ^\circ C}$ is $\pu{0.04 atm}$.
This is one of the steps of the solution given along with the question (edited to show the units):
Amount of substance of nitrogen: $$n(\ce{N2}) = \frac{\pu{0.96 atm} \cdot \pu{3 L}}{\pu{0.0821 atm L mol-1 K-1}\cdot \pu{302 K}} = \pu{0.116 mol}$$ Amount of substance of water: $$n(\ce{H2O}) = \frac{\pu{0.04 atm} \cdot \pu{3 L}}{\pu{0.0821 atm L mol-1 K-1}\cdot \pu{302 K}} = \pu{0.00484 mol}$$
The thing I don't understand here is that how can the volume of nitrogen and water be taken as $\pu{3 l}$? Both of them would occupy some volume not the whole volume will not be occupied by one of them.