Multinomial Distribution Calculator
Find the probability of a three category count outcome from a fixed number of trials.
What it does
The multinomial distribution generalises the binomial to experiments with more than two possible outcomes. It answers questions such as the chance of getting a particular mix of colours from a draw, or a particular pattern of categories in a survey, when each trial is independent and has the same outcome probabilities.
The probability mass function has two parts. The multinomial coefficient counts the number of orderings that produce the observed counts, and the product of probabilities raised to those counts gives the chance of any one such ordering. Multiplying them gives the total probability.
This page handles three categories, which is enough for many teaching examples and simple applications. The three counts must add up to the number of trials, and the three probabilities must add up to one. The tool checks both conditions before computing.
Calculating with factorials directly would overflow for moderately large trials. The tool instead works with log gamma functions and returns the log probability as well as the probability. That makes the result reliable across the whole allowed input range.
The result is a probability mass, not a density, because the distribution is discrete. This page does not compute cumulative probabilities over sets of outcomes or fit probabilities from observed data.
How to use
- Enter the total number of independent trials.
- Enter the observed count in each of the three categories.
- Enter the probability of each category.
- Check that counts sum to trials and probabilities sum to one.
- Read the probability and its logarithm.
- Read the multinomial coefficient, which counts orderings.
Formula
- n
- Number of independent trials.
- xi
- Observed count in category i.
- pi
- Probability of category i on a single trial.
- P
- Probability of the exact count vector.
The coefficient is evaluated as the exponential of log gamma of n plus one minus the sum of log gamma of each count plus one. A zero probability with a zero count is handled by omitting that term rather than evaluating zero to the power zero.
Worked example
Example: 10 trials with counts 3, 3 and 4
Defaults: n 10, counts 3, 3 and 4, probabilities 0.2, 0.3 and 0.5.
- Coefficient: 10 factorial divided by 3 factorial, 3 factorial and 4 factorial is 4,200.
- Probability product: 0.2 cubed times 0.3 cubed times 0.5 to the fourth.
- That product is 0.008 x 0.027 x 0.0625 = 0.0000135.
- Multiply by 4,200 to get about 0.0567.
- The log probability is about -2.8700.
- The tool shows 0.0567, -2.8700 and 4200.
Reference table
| Counts | Coefficient |
|---|---|
| 10, 0, 0 | 1 |
| 5, 5, 0 | 252 |
| 4, 3, 3 | 4,200 |
| 4, 4, 2 | 3,150 |
Limits
- Handles exactly three categories.
- Requires counts that sum to the trial count.
- Requires probabilities that sum to one.
- Does not compute cumulative probabilities.
Common mistakes
- Entering counts that do not add to the trial count.
- Entering probabilities that do not add to one.
- Treating the coefficient as the probability.
- Using percentages rather than decimal probabilities.
- Expecting a density value for a discrete distribution.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is the coefficient for counts 5, 5 and 0?
It is 10 factorial divided by 5 factorial and 5 factorial, which is 252.
Why report a log probability?
Because the probability can be extremely small for large trials, and the logarithm avoids underflow while preserving precision.
What if the probabilities sum to 0.99?
The tool returns the error The three probabilities must be non negative and add up to 1.
Questions
What is the multinomial distribution?
A discrete distribution for counts across several categories from a fixed number of independent trials.
How is it related to the binomial?
With two categories it reduces to the binomial distribution.
Why must probabilities sum to one?
Because every trial must result in one of the listed categories.
What does the coefficient mean?
The number of distinct orderings of trials that produce the same category counts.
Can I use more than three categories?
Not with this page. The inputs are fixed at three categories.
Does the order of trials matter?
Only through the coefficient. The probability is for the total counts, not a specific sequence.