# Stirling approximation for sum of factorials

I know that the Stirling approximation states that

$$\ln(x!) \approx x\ln x - x$$

However, in some derivations, this is also applied to what looks like a sum of factorial terms. For example, here, which is similar to the derivation in other places, one states that for $$W=\frac{N !}{\sum_{i}^{r} n_{i} !}$$, we have

$$\ln W=N \ln N-N-\sum_{i}^{r} n_{i} \ln n_{i}-n_{i}$$

How does one show the Stirling approximation for the denominator term of $$W$$?

• Hint $\ln(a\cdot b)=\ln(a)+\ln(b)$ and $\ln(\frac{a}{b})=\ln(a)-\ln(b)$ – Peter Jul 29 at 18:35
• In the linked paper, they write : the number of microstates is given by the following equation $W=\frac {N!}{n_0! \,n_1!\,n_2! \cdots}$ – Claude Leibovici Jul 30 at 5:16