Can the entropy of mixing be negative? There is a general notion that the entropy of mixing should always be positive (or zero if we are mixing exactly the same stuff). However, I have a seeming counterexample at hand.
Consider a box partitioned into volumes $V_1$ and $V_2$ both of which are kept at the same temperature and pressure. Suppose that $V_1$ is filled with a solution (of ideal gases) containing $N_a$ particles of the solvent species $a$ and $N_b$ particles of the solute species $b$. Now suppose that $V_2$ is filled with the same solution containing the same amount of solvent but $N_c$ particles of solute $b$. By ideal gas law, this means that
\begin{equation}
\frac{N_a + N_b}{V_1} = \frac{N_a + N_c}{V_2} = \frac{2N_a + N_b + N_c}{V_1 + V_2}\,.
\end{equation}
The entropy of mixing is given by
\begin{align}
\Delta S &= -k \ln \left(4^{N_a} \frac{\left(N_b+N_c\right)^{N_b+N_c}}{N_b^{N_b}N_c^{N_c}} \left(\frac{V_1}{V_1+V_2} \right)^{N_a+N_b}\left(\frac{V_2}{V_1+V_2} \right)^{N_a+N_c} \right) \\
&= -2kN_a\ln2 + k \sum_{x=b,c} \left(N_x\ln \frac{N_x}{N_b+N_c} - ({N_a+N_x})\ln \left(c_a + c_x \right) \right)  \,,
\end{align}
where $c_x \equiv N_x/(2N_a + N_b + N_c)$ is the molar fraction of component $x$. In terms of molar concentrations $n_a,n_b$ and $n_c$, one can rewrite the above as follows.
\begin{equation}
\Delta S = -2R\ n_a\ln2 + R \sum_{x=b,c} \left(n_x\ln \frac{n_x}{n_b+n_c} - ({n_a+n_x})\ln \left(c_a + c_x \right) \right)\,.
\end{equation}
Notice that the first term above is negative. The remain contribution could be positive or negative depending on the difference. However, the odd thing is that this change in entropy could, in general, be negative (what prevents it?). That is very counter-intuitive!
I could be mistaken in either of three ways:


*

*There is a proof that shows that the change in entropy in the example given above is indeed non-negative.

*It is negative due to the wrong assumption that the entropy of the system is expressed as I have expressed. But I have used the well-known entropy for a grand canonical ensemble and its additivity to derive the result. Is that not applicable here? Why?

*It is negative due to the false expression of the ideal gas law. If so, why?
Can someone tell me which of the three it is and why? Thanks.
 A: I get the following result which is equivalent to your final answer:
$$\Delta S=R\left[-2n_a\ln{2}+n_a\ln{\frac{(2n_a+n_b+n_c)^2}{(n_a+n_b)(n_a+n_c)}}+n_b\ln{\frac{n_b(2n_a+n_b+n_c)}{(n_a+n_b)(n_b+n_c)}}+n_c\ln{\frac{n_c(2n_a+n_b+n_c)}{(n_a+n_c)(n_b+n_c)}}\right]$$
ADDENDUM
The partial molar entropy of a given species in an ideal gas mixture is the same as that of the pure species at the same temperature as the mixture and at the partial pressure of the species in the mixture.  Therefore, we have $$\bar{S}=S^0(T,P)-R\ln{\frac{p}{P}}=S^0(T,P)-R\ln{x}$$where $S^0(T,P)$ is the  is the entropy of the pure species at the temperature T and total pressure P and x is the mole fraction in the mixture.
Let the subscript 1 refer to species A, and the subscript 2 refer to species B,C.  So, in the initial mixtures, 
$$S_{initial}=n_a\left(S_1^0-R\ln{\frac{n_a}{(n_a+n_b)}}\right)+n_a\left(S_1^0-R\ln{\frac{n_a}{(n_a+n_c)}}\right)+n_b\left(S_2^0-R\ln{\frac{n_b}{(n_a+n_b)}}\right)+n_c\left(S_2^0-R\ln{\frac{n_c}{(n_a+n_c)}}\right)$$
Similarly, in the final mixture,
$$S_{final}=2n_a\left(S_1^0-R\ln{\frac{2n_a}{(2n_a+n_b+n_c)}}\right)+(n_b+n_c)\left(S_2^0-R\ln{\frac{(n_b+n_c)}{(2n_a+n_b+n_c)}}\right)$$
From this it follows that the entropy of mixing is given by $$\Delta S=S_{final}-S_{initial}$$This reduces to the expression I gave above.
PROVING THAT THE ENTROPY INCREASES
We begin by making the following substitutions into the equation for the entropy change:
$$\lambda=\frac{n_b+n_c}{2}$$
$$\xi=\frac{n_b-n_c}{2}$$ We will show that the entropy change is positive definite in $\xi$.  Substituting, we obtain:
$$\frac{\Delta S}{R}=\lambda\ln{\left[1-\left(\frac{\xi}{\lambda}\right)^2\right]}-(\lambda+n_a)\ln{\left[1-\left(\frac{\xi}{\lambda+n_a}\right)^2\right]}+\xi\left[\ln{\frac{\left(1+\frac{\xi}{\lambda}\right)}{\left(1-\frac{\xi}{\lambda}\right)}}-\ln{\frac{\left(1+\frac{\xi}{\lambda+n_a}\right)}{\left(1-\frac{\xi}{\lambda+n_a}\right)}}\right]$$
If we expand this in a Taylor series in $\xi$, we obtain:
$$\frac{\Delta S}{R}=\lambda\left(\alpha^2+\frac{\alpha^4}{6}+\frac{\alpha^6}{15}...\right)-(\lambda+n_a)\left(\beta^2+\frac{\beta^4}{6}+\frac{\beta^6}{15}...\right)$$where $$\alpha=\frac{\xi}{\lambda}$$and$$\beta=\frac{\xi}{\lambda+n_a}$$
This can readily be seen to be positive definite since $\beta<\alpha$.  For example, if we include only the first terms in the expansions, we obtain:
$$\frac{\Delta S}{R}\approx n_a\frac{\xi^2}{\lambda(\lambda+n_a)}=n_a\frac{(n_b-n_c)^2}{(n_b+n_c)(2n_a+n_b+n_c)}$$In short, the contribution of each term in the negative expansion is smaller than that of the corresponding term in the positive expansion.
A: As I indicated,
I prefer to use $A_1$, $B_1$ for the initial numbers of atoms of each species in the box with volume $V_1$,
and $A_2$, $B_2$ for the corresponding numbers in $V_2$.
Of course, you can set $A_1=A_2$ afterwards.
But this highlights the symmetry and simplifies the proof.
My version of your equations for the initial and final entropies is
\begin{align*}
S_{\mathrm{init}}/k &= A_1 \left(\frac{5}{2} + \ln \frac{V_1}{A_1\lambda_a^3}\right) 
+ B_1 \left(\frac{5}{2} + \ln \frac{V_1}{B_1\lambda_b^3}\right)\\ 
& + A_2 \left(\frac{5}{2} + \ln \frac{V_2}{A_2\lambda_a^3}\right) 
+ B_2 \left(\frac{5}{2} + \ln \frac{V_2}{B_2\lambda_b^3}\right) ,
\\
S_{\mathrm{final}}/k &= 
(A_1+A_2) \left(\frac{5}{2} + \ln \frac{V_1+V_2}{(A_1+A_2)\lambda_a^3}\right) 
\\
&+ (B_1 + B_2) \left(\frac{5}{2} + \ln \frac{V_1+V_2}{(B_1 + B_2)\lambda_b^3}\right) .
\end{align*}
In calculating the difference, the $5/2$ terms and the de Broglie wavelengths all cancel, and the result can be expressed as a sum of two terms, each applying to one of the two species:
\begin{align*}
\Delta S/k &= 
(A_1+A_2)\ln\left(\frac{V_1+V_2}{A_1+A_2}\right)
-A_1\ln\left(\frac{V_1}{A_1}\right) -A_2\ln\left(\frac{V_2}{A_2}\right) 
\\
&+
(B_1+B_2)\ln\left(\frac{V_1+V_2}{B_1+B_2}\right)
-B_1\ln\left(\frac{V_1}{B_1}\right) -B_2\ln\left(\frac{V_2}{B_2}\right) 
\\
& \equiv \Delta S_A/k + \Delta S_B/k .
\end{align*} 
I believe that this is equivalent to your first equation for $\Delta S$, before you start introducing molar fractions and molar concentrations;
your factor $4^{N_a}$ has become the appropriate more general formula involving $A_1$ and $A_2$, analogous to your factor
involving $N_b$ and $N_c$.
(Technically I shouldn't write these log terms separately, because the argument of log should be dimensionless, but it is more readable this way. I'll recombine them in the equation below.)
This equation for $\Delta S$ makes sense because,
for this simple example, 
"mixing" really means "expansion" of each of the (independent) gases.
We could do the mixing in two separate steps,
using a semi-permeable membrane,
and the positive entropy change would drive both steps.
Both the "A" term and the "B" term are non-negative. Let's just look at $\Delta S_A$.
Define
$$
x_1=\frac{A_1}{A_1+A_2}, \quad x_2=\frac{A_2}{A_1+A_2}, \quad
\text{so}\quad x_1+x_2=1
$$
and also define $v_1=V_1/A_1$ and $v_2=V_2/A_2$. Notice that
$$
\frac{V_1+V_2}{A_1+A_2} = x_1v_1 + x_2v_2 .
$$
Then
$$
\Delta S_A/k = (A_1+A_2) \ln \left(\frac{x_1v_1+x_2v_2}{v_1^{x_1}v_2^{x_2}}\right) .
$$
This is guaranteed to be non-negative because of the general inequality
$$
x_1 v_1 + x_2 v_2 \geq v_1^{x_1}\,v_2^{x_2} \qquad
\text{given $x_1+x_2=1$}
$$
which you can find on the generalized mean Wikipedia page
(it goes by several names, such as Jensen's inequality,
following from the concave property of the log function,
or Maclaurin's inequality).
So both $\Delta S_A$ and $\Delta S_B$, and hence $\Delta S$,
are non-negative.
