Advanced Combinatorics Calculator

Enter n, r and group sizes to get exact permutations, combinations, repetitions, circular and necklace arrangements, multinomial coefficient and special counting numbers.

S'executa al teu navegador. Els fitxers mai no surten del dispositiu. Mira com comprovar-ho

…

Com es fa

  1. 1
    Enter n

    Number of objects.

  2. 2
    Enter r

    Number chosen or groups.

  3. 3
    Enter group sizes

    For the multinomial.

  4. 4
    Read the counts

    Exact results.

Sobre aquesta eina

Counting problems go far beyond nPr and nCr. How many ways can guests sit at a round table? How many ways can letters all go into the wrong envelopes? How many ways can a set be split into groups, or a number be written as a sum? This calculator answers these with exact big-integer arithmetic, so even huge answers are exact, and covers the classic special numbers of combinatorics.

Who this is for

Mathematics students, puzzle and competition enthusiasts, programmers and probability learners.

Arrangements and selections

- **Permutations nPr** = n!/(n − r)!: ordered selections without repetition. - **Combinations nCr** = n!/(r!(n − r)!): unordered selections. - **With repetition, ordered**: n^r, like PIN codes. - **With repetition, unordered**: C(n + r − 1, r), like choosing r scoops from n flavours.

Circular arrangements

Seating n people around a round table: (n − 1)! ways, because rotations are the same. If reflections also count as the same (a necklace or key ring), (n − 1)!/2.

Multinomial coefficients

Splitting n items into groups of sizes k₁, k₂, …: n!/(k₁! k₂! …). The letters of MISSISSIPPI can be arranged in 11!/(1! 4! 4! 2!) = 34,650 ways.

Derangements

!n counts permutations where nothing stays in place, the "hat-check problem". !5 = 44. As n grows, !n/n! approaches 1/e ≈ 0.368.

Stirling and Bell numbers

The Stirling number of the second kind S(n, r) counts ways to split n objects into r non-empty groups; the Bell number B(n) sums over all r. B(5) = 52.

Integer partitions

p(n) counts ways to write n as a sum of positive integers ignoring order: p(10) = 42, p(100) = 190,569,292. The calculator uses Euler's pentagonal number recurrence.

Catalan numbers

C_n counts correctly nested brackets, binary trees and many other structures: 1, 1, 2, 5, 14, 42, …

Good practice

Decide first whether order matters and whether repetition is allowed; that picks the formula.

Probability with counting

Many probabilities are counts divided by counts. The chance that a random permutation of 10 letters puts none in its own envelope is !10/10! ≈ 0.368. The chance of a particular poker hand is the number of such hands divided by C(52, 5) = 2,598,960.

Growth of the numbers

Factorials grow faster than exponentials: 20! already exceeds 2 × 10¹⁸. That is why exact big-integer arithmetic matters for anything beyond small n.

Check small cases by listing them.

Small cases make good sanity checks.

Worked example

With n = 10 and r = 3: 720 permutations, 120 combinations, 1000 ordered selections with repetition and 220 unordered. Ten people can sit round a table in 362,880 ways. There are 1,334,961 derangements of 10 items, S(10, 3) = 9330, B(10) = 115,975, p(10) = 42 and C₁₀ = 16,796.

Limits

n up to 400 (Bell numbers up to 200); very large results are shown in scientific notation. Not an official proof checker.

Exemple resolt

There are 44 ways to put 5 letters all in the wrong envelopes.

En resum

Preguntes freqüents

How many ways can n people sit at a round table?

(n − 1)!.

What is a derangement?

A permutation with no element in its original place.

How do combinations with repetition work?

C(n + r − 1, r) ways to choose r items from n types.

What are Bell numbers?

The number of ways to partition a set into groups.

Are the answers exact?

Yes, computed with big integers.

Is my data stored?

No. Everything is calculated in your browser.

Totalment gratisSense cost, sense registre
Els fitxers es mantenen privatsTot funciona al teu navegador
Fàcil en el teu idiomaDisponible en molts idiomes