Derive expression for internal energy of mixing and entropy of mixing using statistical thermodynamics
In the solution there are two types of molecules $N_1$ and $N_2$. Assume that they do not interact with one another but simply occupy particular 'lattice' sites by blocking them. The total number occupied sites is $N=N_1 + N_2$. The first molecule can be placed at any of the $N$ sites, the second at $N-1$ empty sites and so on. The total number of possibilities is $N(N-1)(N-2)\cdots = (N_1 + N_2)!$ . Now, molecules of the same type are not distinguishable from one another thus this number must be divided by $N_1$ for molecules of the first type and similarly for the other type. Thus the number of distinguishable arrangements is

$$W_\mathrm{mix}= \frac{(N_1 + N_2)!}{N_1!N_2!} $$

The pure compounds have only one type of molecule thus for them $W_1=N_1!/N_1! = 1$ etc.

The entropy is defined as $S=k\ln(\Omega)$ where $\Omega$ is the number of arrangements $W_\mathrm{mix}/(W_1W_2)$ thus 
$$ \Delta S=k\ln\left(\frac{(N_1 + N_2)!}{N_1!N_2!}\right)$$

To simplify this it is convenient to use Stirling's approximation as $N$ is large:

$$\ln(N!) \approx N\ln(N)-N+1$$ and also as $N$ is large the $1$ can be ignored, giving $$\ln(N!) \approx N\ln(N)-N$$

Expanding gives 
$$ \Delta S = k[(N_1 + N_2)\ln(N_1 + N_2)-N_1\ln(N_1)-N_2\ln(N_2)]$$
expanding, multiplying by $-1$ and simplify gives

$$ \Delta S = -k\left[N_1\ln (\frac{N_1}{N_1 + N_2} )+ N_2\ln(\frac{N_1}{N_1 + N_2})\right]  $$

which can be expressed as mole fractions
$$ \Delta S= -k[N_1\ln(x_1) + N_2\ln(x_2)]$$

in molar terms, $ \Delta S= -R[n_1\ln(x_1) + n_2\ln(x_2)]$. This is the ideal solution entropy of mixing.

If the molecules do interact then this is a complicated problem in regular solutions, the free energy is 
$$\Delta G = RT[n_1\ln(x_1)+n_2\ln(x_2)] +(n_1+n_2)x_1x_2w$$

where $w \approx (2E_{12}- E_{11} - E_{22})$ and $E_{12}$ is the interaction energy between molecules of type $1$ and $2$ when they are adjacent and similarly for $E_{11}$ and $E_{22}$ all of which are negative. From a consideration of the energies involved $w$ is expected to be positive.