Statistics & probability

Multinomial probability calculator from counts

Calculate the probability and log probability of a complete category-count vector under fixed multinomial probabilities.

Your numbers

Enter 1–20 nonnegative whole-number counts, total at most 1,000,000.
Use the same category order. Each probability is 0–1 and the sum must be one within 10⁻¹².

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A multinomial model describes a fixed number of independent trials whose outcomes belong to mutually exclusive, exhaustive categories. The entered counts specify one complete count vector, not one particular chronological sequence. The multinomial coefficient counts all sequences that produce those totals; category-probability powers supply the probability of each sequence. This calculator evaluates the mass through log-gamma arithmetic to avoid constructing enormous factorials directly.

THE FORMULAP(C=c) = n! ∏p_i^c_i / ∏c_i!, where n=Σc_i.

A worked example

For four trials with probabilities 0.5,0.25,0.25 and counts 2,1,1, the arrangement count is 4!/(2!1!1!) = 12. Each such sequence has probability 0.5²×0.25×0.25 = 1/64. Multiplying gives the joint count-vector probability 12/64 = 0.1875. This differs from the probability of one named order, which would be only 1/64.

Good to know

Supports 1–20 categories and total count at most 1,000,000. Counts must be whole and nonnegative. Probabilities must align, lie between zero and one and sum to one within 10⁻¹²; no automatic normalization is applied. Trials require the same probability vector and independence. Extremely small positive probabilities may underflow numerically, so the natural log probability is also returned.

A vector of totals includes many chronological sequences

The coefficient depends on repeated category counts. If every outcome belongs to the first category, there is only one sequence consistent with that vector. With two occurrences of one category and one each of two others, twelve sequences share the same counts. The existing multinomial-arrangements calculator reports this combinatorial count alone; this page includes the fixed category probabilities to answer a different probability question.

A zero count contributes no logarithmic probability term. In particular, zero observations from a zero-probability category do not make an otherwise possible event impossible. A positive count in such a category does make the vector impossible and is reported explicitly with probability zero and log probability minus infinity. That exact impossibility is distinguished from a positive mass too tiny for floating-point representation.

Four trials can produce counts two one one in twelve ordersp=1/22p=1/41p=1/4112 orders × 1/64 = 0.1875
Counts 2,1,1 have arrangement coefficient twelve. Fixed probabilities 1/2,1/4,1/4 give each sequence probability 1/64, so the count-vector mass is 12/64 = 0.1875.

The Dirichlet posterior predictive calculator for categorical counts integrates uncertainty in the category probability vector, while this multinomial page treats the entered probabilities as fixed.

The categories and trial model must match the experiment

Category probabilities describe all possible outcomes of a trial. Omitting an other category while keeping its probability outside the list makes the supplied vector incomplete. Conversely, overlapping categories can count one outcome twice. The sum-to-one check catches a numerical inconsistency, but it cannot determine whether your definitions really are mutually exclusive and exhaustive. Establish those definitions before entering the counts.

The total count is the implied number of trials; no separate sample-size field can contradict it. Sampling without replacement from a small finite population generally needs a different model because trial probabilities change. If category probabilities are unknown and inferred from previous counts, the Dirichlet posterior-predictive page can integrate that uncertainty. Plugging estimated probabilities into this fixed-probability mass does not create the same Bayesian joint prediction.

A few questions, answered

Does this return a goodness-of-fit p-value?

No. It returns the mass of one specified count vector. A test p-value requires an explicit statistic and a set of outcomes considered at least as extreme.

Are counts allowed to sum to zero?

Yes. The empty trial sequence has all-zero counts and probability one, provided the category probabilities themselves form a valid vector.

Find your calculator

Start typing to explore the library.