Skip to content

Permutation and Combination Calculator

Updated:

Calculate permutations (nPr), combinations (nCr) and factorials instantly, with or without repetition. Enter the total number of items n, how many you choose r, and read all results at once.

Calculate Permutations & Combinations

Input Fields
n
Size of the full set. Whole number from 0 to 10,000.
r
How many items are selected or arranged. Without repetition, r cannot exceed n.
If enabled, the result will update automatically when you change any value.

Permutations & Combinations Formula

Formula
\[ P(n, r) = \frac{n!}{(n - r)!} \qquad C(n, r) = \frac{n!}{(n - r)! \, r!} \qquad P(n, r) = C(n, r) \cdot r! \\ \\ \text{With repetition:} \quad P_{rep}(n, r) = n^r \qquad C_{rep}(n, r) = \binom{n + r - 1}{r} = \frac{(n + r - 1)!}{r! \, (n - 1)!} \\ \\ n! = n \cdot (n - 1) \cdot (n - 2) \cdots 2 \cdot 1 \]

Where:

  • \(n\) — total number of distinct items in the set
  • \(r\) — number of items chosen or arranged
  • \(P(n, r)\) — number of ordered selections (permutations, also called variations \(V(n, r)\), or nPr)
  • \(C(n, r)\) — number of unordered selections (combinations, or nCr)
  • \(n!\) — factorial of \(n\), the number of ways to arrange all \(n\) items in a row

A permutation counts ordered arrangements: which item comes first, second, third matters. A combination counts unordered selections: only the chosen set matters. The two are linked by \(P(n, r) = C(n, r) \cdot r!\), because every unordered group of \(r\) items can be ordered in \(r!\) ways. When repetition is allowed, the same item may be picked more than once, which changes both formulas.

Permutations & Combinations – Calculation Example

Example: a club with 10 members must pick a president, secretary and treasurer (three different people), and separately wants to know how many 3-person committees it could form.

Ordered assignments (permutations):

\[ P(10, 3) = \frac{10!}{(10 - 3)!} = \frac{10!}{7!} = 10 \cdot 9 \cdot 8 = 720 \]

Unordered committees (combinations):

\[ C(10, 3) = \frac{10!}{7! \cdot 3!} = \frac{720}{6} = 120 \]

Arranging all 10 members in a row:

\[ 10! = 3{,}628{,}800 \]

Result: there are 720 ways to assign the three roles, 120 possible 3-person committees, and 3,628,800 orderings of the whole club. Note that \(720 = 120 \cdot 3!\), since each committee can distribute the three roles in \(3! = 6\) ways.

How to use the calculator

  1. Enter the Total number of items (n) — the size of the full set (0 to 10,000).
  2. Enter the Number of items chosen (r) — how many items you select or arrange. Without repetition, \(r\) cannot exceed \(n\); with repetition it can.
  3. Choose the Repetition mode: "Without repetition (all items distinct)" for drawing without replacement, or "With repetition (items may repeat)" for situations like dice rolls, PIN codes, or drawing with replacement.
  4. Read the results: Permutations / Variations (nPr), Combinations (nCr), Permutations of all n items (\(n!\)), plus an interpretation block that shows all four counts side by side.

Permutations, combinations and variations explained

Whenever you select items from a set, two questions decide which number you need. Does the order matter? And can items repeat? Crossing these two questions gives four classic counting problems, and this calculator shows all four for your inputs so you can compare them directly.

If order matters and items cannot repeat, you are counting permutations \(P(n, r)\) — in many European textbooks these are called variations \(V(n, r)\), which is exactly the nPr button on a scientific calculator. You have \(n\) choices for the first position, \(n-1\) for the second, and so on down to \(n-r+1\) for the last, giving \(n!/(n-r)\). If order does not matter, each unordered group was counted \(r!\) times, so you divide by \(r!\) and get the combination \(C(n, r)\). Combinations are always less than or equal to permutations for the same \(n\) and \(r\), and the gap grows quickly: for \(n = 52, r = 5\) there are about 311 million ordered draws but only 2,598,960 distinct poker hands.

With repetition, each choice is independent of the previous ones, so the ordered count is simply \(n^r\): a 4-digit PIN uses \(10^4 = 10{,}000\) codes. The unordered count with repetition answers a subtler question — how many multisets of size \(r\) can be built — and equals \(\binom{n+r-1}{r}\). For example, choosing 3 scoops of ice cream from 10 flavors (repeats allowed, order irrelevant) gives \(\binom{12}{3} = 220\) options.

Finally, arranging all \(n\) items in a sequence gives \(n!\) permutations — the special case \(r = n\). Factorial growth is extremely fast: \(10!\) already exceeds 3.6 million, and \(70!\) is larger than the number of atoms in the observable universe. For large inputs the calculator therefore displays results in scientific notation, e.g. \(5.47 \times 10^{157}\).

Assumptions, limitations and practical tips

  • All items are distinct. The formulas assume every item is distinguishable. If your set contains identical objects (e.g. the letters in a word with repeated letters), the standard permutation formula overcounts; those cases need the multinomial approach instead.
  • Repetition mode changes the interpretation. "With repetition" means each draw is independent (sampling with replacement). If you are modelling lottery draws, card hands, or committee selections, use "without repetition".
  • \(r > n\) without repetition is impossible and the calculator will tell you so; with repetition it is perfectly valid (you can roll a die 20 times even though it has 6 faces).
  • Edge cases follow the standard conventions: \(P(n, 0) = C(n, 0) = 1\) (there is exactly one way to choose nothing), and \(0! = 1\).
  • Large numbers. Inputs up to 10,000 are supported, but results beyond roughly 15 digits are shown as a mantissa times a power of ten, since no standard number format can hold such values exactly.
  • Choosing the right count. Ask yourself: "If I swapped two chosen items, would the outcome be different?" If yes, use permutations; if no, use combinations. And ask: "Could I pick the same item twice?" If yes, use the repetition formulas.

Quick reference: 10 items, choose 3

Count Formula Value
Variations without repetition (nPr) \(\frac{n!}{(n-r)!}\) 720
Variations with repetition \(n^r\) 1,000
Combinations without repetition (nCr) \(\frac{n!}{(n-r)!\,r!}\) 120
Combinations with repetition \(\binom{n+r-1}{r}\) 220
Permutations of all items \(n!\) 3,628,800

This table, which mirrors the calculator's interpretation block for \(n = 10\), \(r = 3\), shows how strongly the answer depends on whether order matters and whether repeats are allowed — the same pair of inputs yields answers ranging from 120 to 1,000.

Frequently Asked Questions

How do I calculate permutations and combinations by hand?

Cancel factorials before multiplying. For permutations, \(P(n,r) = n \cdot (n-1) \cdot \ldots \cdot (n-r+1)\) — just multiply the top \(r\) factors of the factorial. For combinations, compute \(P(n,r)\) and divide by \(r!\). Example: \(C(8,3) = \frac{8 \cdot 7 \cdot 6}{3 \cdot 2 \cdot 1} = 56\). This shortcut avoids computing huge factorials like \(52!\) when you only need a small part of them.

Why does my scientific calculator show an error for large n?

Handheld calculators overflow quickly — most cannot handle factorials beyond about \(69!\), which already exceeds \(10^{99}\). If the nPr or nCr button fails, reduce the fraction manually: write \(\frac{n!}{(n-r)!}\) as a product of only \(r\) terms, or use the symmetry \(C(n,r) = C(n, n-r)\) so the smaller of \(r\) and \(n-r\) appears in the formula. This calculator handles inputs up to \(n = 10{,}000\) using logarithms.

How do I count arrangements when some items are identical?

The standard formulas assume all items are distinct, so they overcount when objects repeat. For a word like LEVEL (5 letters, but L appears twice and E twice), the count is \(\frac{5!}{2! \cdot 2!} = 30\), not \(5! = 120\). In general, arrange \(n\) items where one letter repeats \(a\) times, another \(b\) times, and so on, using \(\frac{n!}{a!\,b!\,\cdots}\). This is the multinomial approach.

Why is 0! equal to 1, and what does choosing zero items mean?

Both are conventions that keep the formulas consistent. There is exactly one way to arrange an empty set (do nothing), so \(0! = 1\). Similarly, \(P(n,0) = C(n,0) = 1\): there is exactly one way to select nothing — the empty selection. The calculator therefore returns 1, not 0, for these inputs. Note also the symmetry \(C(n,r) = C(n,n-r)\): choosing what to keep is the same as choosing what to leave out.

What are typical real-life situations for each of the four counts?

Permutations without repetition: podium finishes in a race, assigning distinct job roles, seating arrangements. Combinations without repetition: lottery numbers, poker hands, committee members. Permutations with repetition: PIN codes, license plates, dice roll sequences. Combinations with repetition: choosing scoops of ice cream or donuts where duplicates are allowed and order does not matter — a multiset. Matching your problem to one of these four is the key step.

What is the most common mistake when using these formulas?

The classic error is using permutations where combinations apply, inflating the answer by a factor of \(r!\). Quick test: swap two of the chosen items — if the outcome changes (gold medal vs silver medal), order matters; if not (a hand of cards), use combinations. The second most common mistake is forgetting to check whether repeats are allowed: a 4-digit PIN has \(10^4\) possibilities because digits repeat, while a lottery draw does not.

How do I use this to find lottery odds?

Count the possible draws with combinations: for a 6-from-49 lottery, \(C(49,6) = 13{,}983{,}816\), so a single ticket has a 1-in-13.98 million chance of matching all six numbers. If the lottery draws numbers in a specific order, you would instead need \(P(49,6)\), which is \(6! = 720\) times larger. Note that these are odds of winning, not of profiting — expected payouts are typically far below the ticket price.

Leave a Reply

Your email address will not be published. Required fields are marked *