Skip to content

Combinatorics Calculator

Count the possibilities. Understand the choice.

Your selection

Whole numbers · 0–1000. Without repetition, r > n gives zero.

Find the right operation

Does order matter?
Allow repetition?

Hand arranging wooden letter tiles

Ordered selection · No repetition

PERMUTATIONS
—

Combinations · Same n and r

—
Ordered, repeat—
Unordered, repeat—
Step-by-step solution

Exact integers. Long results scroll horizontally. Derangements use all n items.

Text summary · PDF in member tools

Which counting rule fits?

Choose a cell to explore its formula and steps.

Selection ruleNo repetitionRepetition allowed
Order matters
Order does not matter

Why order changes the count

A B CA C BB A C

Each group of r distinct items has r! orders. Dividing the ordered count by r! counts each group once.

With repetition, ordered positions each have n choices. Unordered selections use the stars-and-bars formula when n ≥ 1.

Derangements exclude every original position. They use D₀ = 1, D₁ = 0 and Dₙ = (n − 1)(Dₙ₋₁ + Dₙ₋₂), with no floating-point approximation.

Frequently asked questions

When does order matter?

Order matters when changing positions creates a different outcome. A podium, PIN or sequence is ordered; a committee is unordered.

What does repetition mean?

Repetition allows the same available item to be selected more than once. Without repetition, each of the n distinct items can be selected at most once.

Why do derangements only use n?

Derangements rearrange all n distinct items so that none stays in its original position. The chosen-items input r is not used.

Can r be greater than n?

Yes for repeated selections when n is positive. Without repetition, r greater than n gives zero possible selections.

Show all questions (12)Show fewer questions
Are these results exact?

All five counts use exact BigInt integer arithmetic. Inputs must be whole numbers from 0 to 1000. Long results are scrollable and exported in full.

How are empty selections handled?

Choosing zero items has one outcome: the empty selection. This tool uses 0^0 = 1 for that counting convention. From zero available items, choosing any positive number gives zero outcomes. There is one derangement of zero items.

Are the objects distinct?

Yes. The n available item types are distinct. Permutations of a collection that already contains indistinguishable duplicates require a different multinomial formula.

What does the Combinatorics calculate?

Count the possibilities. Understand the choice.

Which values should I enter?

Enter whole numbers n and r from 0 to 1000. n counts distinct available items and r counts selected positions or items.

What formula does this calculator use?

The formula depends on order and repetition. The decision matrix and worked steps show the formula for your selection. Derangements use an exact integer recurrence.

Why might my result differ from another source?

Check whether order matters, whether repetition is allowed, and whether objects are distinct. Derangements rearrange all n objects.

Does the result update automatically?

Yes. Counts, the decision matrix, item diagram and expandable solution update with the inputs.

Sources & mathematical references

Original logos identify references, not endorsement.

Page information

Updated: October 7, 2026