The volume of compartment is equal. One compartment has 1 mole of ideal gas a at pressure 1 atm and other compartment have 1 mole of ideal gas b at pressure 1 atm.
If the partition between the compartment is removed, the volume of gas a with 1 mole become twice of its initial value. Similarly, volume of gas b with 1 mole doubles.
Change in entropy is calculated as follows:
For gas a, \Delta S_{a}=Rln\frac{V_{2}}{V_{1}}
Since, V_{2}=2V_{1}
Thus,
\Delta S_{a}=Rln\frac{2V_{1}}{V_{1}}=Rln2
Similarly, change in entropy for gas b will be \Delta S_{b}=Rln2
Total entropy will be:
\Delta S_{a}+\Delta S_{b}=Rln2+Rln2=Rln4