3.1K Downloads
Updated 31 Jan 2005
No License
MULTINOMIAL(N, K1, K2, ..., Km) where N and Ki are numeric arrays of non-negative integers satisfying N = K1 + K2 + ... + Km, returns the multinomial coefficient N!/( K1!* K2! ... *Km!).
MULTINOMIAL(N, [K1 K2 ... Km]) when Ki's are all scalar, returns the same as MULTINOMIAL(N, K1, K2, ..., Km).
Non-integer input arguments are pre-rounded by FLOOR function.
EXAMPLES:
multinomial(8, 2, 6) returns 28
binomial(8, 2) returns 28
multinomial(8, 2, 3, 3) returns 560
multinomial(8, [2, 3, 3]) returns 560
multinomial([8 10], 2, [6 8]) returns [28 45]
Cite As
Mukhtar Ullah (2023). MULTINOMIAL (https://www.mathworks.com/matlabcentral/fileexchange/6156-multinomial), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- AI, Data Science, and Statistics > Statistics and Machine Learning Toolbox > Probability Distributions > Discrete Distributions > Multinomial Distribution >
Tags
Acknowledgements
Inspired: Multinomial Expansion
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 | a minor improvement: replace round with floor |