Will the volume occupied by a mixture of nitrogen and water be same as the volume occupied by them individually? 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) -&gt; 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.
The idea behind the question is that you know the partial pressure of N$_2$ is 0.96 atm (= 1 atm - 0.04 atm). And you know that the partial pressure of all the H$_2$ that can be produced from the water is thus (1.86 atm - 0.96 atm)* 2/3 = 0.6 atm. [Ignoring the volume of liquid water, which is only ~1/1000 that of the gas.] From this you can determine the number of moles of H$_2$, which is equal to the number of moles of water = 0.6 atm *3 L/(302 K * 0.0821 atm L / mol K). 

Note the number of moles of water given in your answer isn't the total no. of moles of water, it's the number of moles of water vapor prior to the electrolysis.