![Hands-On Mathematics for Deep Learning](https://wfqqreader-1252317822.image.myqcloud.com/cover/81/36698081/b_36698081.jpg)
Multinomial coefficient
We know from the binomial theorem (which you likely learned in high school) that the following is true:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_1810.jpg?sign=1739284659-NO88ubv655PwD8h49Ft47qTHcV6DSz03-0-d2aeb0a91b4a6ee3759acf84eab3d32b)
Then, the trinomial is as follows:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_1378.jpg?sign=1739284659-hOIO9HOMW5CRUnukqzP5PUnBUHSF8dn6-0-b1bc764396057fc8f8d5827dc78a439b)
Say we have n pieces of candy and there are blue- and red-colored candies. The different ways that we can pick the candies is defined as , which is read as n choose k.
The multinomial coefficient is as follows:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_1449.jpg?sign=1739284659-7gnlAABGm17ChKcT5RMM4wEKlzTQkDE9-0-fda08fa32b72de3c48d730a2add09dfd)
This way, we spread n items over k positions, where the ith position has ni items.
For example, say we're playing cards and we have four players. A deck of cards has 52 cards and we deal 13 cards to each player. So, the number of possible ways that we can distribute the cards is as follows:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_40.jpg?sign=1739284659-fXk1tgW3hXtiHALZHA1K9nHF8e1iHOpz-0-925901d4520e029496c9f9eee1903765)
This is absolutely massive!
This is where Stirling's formula comes to the rescue. It allows us to approximate the answer.