ForHosting KIT · Developer Utilities

Multinomial Coefficient Expansion Calculator

This multinomial coefficient expansion calculator counts how many distinct arrangements are possible when a known number of different items is divided into labeled groups of fixed sizes.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the total number of items and the size of every group. The calculator verifies that those sizes add up to the declared total, then evaluates the coefficient exactly. Because the result is returned as a decimal string, even values beyond the safe integer range remain complete and unrounded. It is useful for combinatorics exercises, repeated-symbol arrangements, probability formulas, and software tests that need a reliable partition count.

Understand what the coefficient counts

A multinomial coefficient extends the familiar idea of choosing a subset. Instead of separating a collection into just a selected part and a remainder, it divides all distinct items among several labeled groups whose sizes are fixed in advance. For a total of n items and sizes n1, n2, and so on, the coefficient is n factorial divided by the product of every group-size factorial. The labels matter: assigning three people to morning, three to afternoon, and two to evening is different from merely creating unlabeled clusters. Order inside one group does not matter, because exchanging two members of the same group leaves the assignment unchanged. The same expression also counts distinct expansions of a multiset arrangement. For example, arranging letters with repeated copies uses one group size for each repeated symbol. The result is always a non-negative whole number. A zero-size group is permitted and contributes a factorial of one, while a single group containing the full total produces coefficient one. This capability returns the exact coefficient rather than an approximation, making it suitable for comparisons, grading, and later exact calculations.

Provide a total and a complete list of group sizes

Send an object with total and group_sizes. The total must be a non-negative integer no greater than ten thousand. The group_sizes value must be a non-empty array of non-negative integers. Most importantly, every size must describe part of the same complete partition: adding the entries must give total exactly. For total eight and group sizes three, three, and two, the response contains coefficient 560. It means eight distinct items can be assigned to three labeled groups of those sizes in 560 ways. The returned group_sizes repeats the validated input so a caller can associate the answer with the correct partition. The coefficient is a decimal string, not a JSON number, because exact combinatorial results quickly pass the largest integer that JavaScript can represent safely. Treat that string as an integer in languages with arbitrary-precision support, or preserve it as text for display and storage. The API costs $0.002 for a successful request. Validation failures are reported as invalid input rather than being adjusted silently, so a typo cannot produce a plausible answer for a different mathematical problem.

Interpret validation and use exact results safely

The sum check is part of the mathematical contract, not merely a convenience. If total is ten but the supplied sizes add to nine, one item has no destination and the requested partition is incomplete. If the sizes add to eleven, they demand more items than exist. In either case the capability rejects the request and reports both the received sum and declared total. It also rejects fractions, negative values, missing fields, an empty size list, and totals beyond the published bound. The implementation evaluates the expression as a product of exact binomial coefficients instead of constructing several enormous factorials and dividing afterward. It first chooses the members of the first group, then chooses the next group from the remaining items, continuing until none remain. Each division is exact, and BigInt arithmetic prevents rounding. This makes results stable across repeated calls, browsers, and server runs. When using the coefficient inside a multinomial probability calculation, convert it with an arbitrary-precision library before combining it with probability powers. When only counting arrangements, keep the decimal string unchanged so no low-order digits are lost during JSON parsing, spreadsheet import, or database storage.

Count repeated-symbol arrangements

Use the frequency of each symbol as a group size to obtain the number of distinct sequences without overcounting identical copies.

Build probability calculations

Compute the exact combinatorial factor used in a multinomial probability mass before applying category probabilities.

Validate combinatorics exercises

Compare a hand-derived expansion or partition count with a deterministic exact result and catch incomplete group-size lists.

What must the group sizes add up to?

They must add up exactly to total. A smaller or larger sum is rejected because it does not describe a complete partition of the items.

Why is the coefficient returned as a string?

Multinomial coefficients can exceed the safe integer range quickly. A decimal string preserves every digit without JSON number rounding.

Can a group size be zero?

Yes. Zero is a valid non-negative group size and contributes no items; its factorial is one.

Are the groups labeled?

Yes. The formula counts assignments to distinct group positions or categories. It does not merge arrangements that exchange entire groups.

How much does one API request cost?

A successful API request costs $0.002. The calculation is also deterministic, with no network or model dependency.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/multinomial-coefficient

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/multinomial-coefficient \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"total":8,"group_sizes":[3,3,2]}'
{
  "total": 8,
  "group_sizes": [
    3,
    3,
    2
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.multinomial_coefficient",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_total10000
max_groups10000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →