![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=1739638671-5gZ6RSAFQrx093SoRWe9jpHIKaA7lPXT-0-655906fb97fc526be3c8bd931861626b)
Then, the trinomial is as follows:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_1378.jpg?sign=1739638671-uT9YVFk0wEtD7D2sL9PCcI39F2k4VJji-0-eb80f3ca1b93e5e243e96dbe7da431ef)
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=1739638671-BWz9Uri4BVGOHxxuzPLjCNUoK2fQ5655-0-7e36251cf790fbff8a184c76561dad71)
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=1739638671-cJ1FePERqb4sxQFSUl4euokDkcwhymQV-0-698a214d31a42750f698aa4170eebe9e)
This is absolutely massive!
This is where Stirling's formula comes to the rescue. It allows us to approximate the answer.