Counting Problem

Permutations vs. combinations (what this calculator does)

Permutations and combinations are two closely related counting tools used in probability, statistics, and everyday “how many ways?” questions. They answer different questions:

  • Permutation (nPr): counts ordered selections (order matters). Example: awarding 1st/2nd/3rd place, creating a PIN where each position is distinct, arranging speakers.
  • Combination (nCr): counts unordered selections (order doesn’t matter). Example: choosing a committee, selecting lottery numbers, picking toppings where order is irrelevant.

This calculator computes nPr, nCr, or both from your inputs n (total distinct items) and r (items selected).

Key definitions

Total items (n) and selected items (r)

n is the number of distinct items available. r is how many you pick from them. Typical counting problems use integers with 0 ≤ r ≤ n.

Factorial (n!)

The factorial of a non‑negative integer n is the product of all integers from 1 to n:

n! = n × (n − 1) × … × 2 × 1, and by definition 0! = 1.

Factorials grow very fast (e.g., 20! is already about 2.43×1018), which is why results can become extremely large even for moderate inputs.

Formulas used

These are the standard closed‑form formulas for permutations and combinations (without repetition):

Permutation (order matters): nPr

The number of ordered ways to pick r items from n distinct items is:

P(n,r) = n! (nr)!

Intuition: you have n choices for the first position, n−1 for the second, and so on, for r positions.

Combination (order doesn’t matter): nCr

The number of unordered ways to pick r items from n distinct items is:

C(n,r) = n! r!(nr)!

Because each set of r chosen items can be arranged in r! ways, combinations relate to permutations via:

C(n, r) = P(n, r) / r!

Interpreting your results

  • If nPr is large, it means there are many distinct ordered outcomes (rankings, sequences, arrangements).
  • If nCr is large, it means there are many distinct groups you can form (teams, sets, selections) regardless of order.
  • If you choose Both, you can compare how much “order” increases the count. Often nPr = nCr × r!, so order multiplies the number of outcomes by r!.

Worked example

Problem: You have n = 10 candidates and want to choose r = 3 people.

  • Combination (committee of 3): order does not matter.
    C(10, 3) = 10! / (3! · 7!) = (10·9·8) / (3·2·1) = 120
  • Permutation (gold/silver/bronze): order matters.
    P(10, 3) = 10! / 7! = 10·9·8 = 720

Interpretation: there are 120 possible groups of 3, but 720 possible podium outcomes because each group of 3 can be arranged into ranks in 3! = 6 ways.

Common scenarios (quick comparison)

Scenario Does order matter? Use Expression
Choose 5 players from 12 for a team No Combination C(12, 5)
Award 1st, 2nd, 3rd place among 12 finalists Yes Permutation P(12, 3)
Create a 4-character code from distinct symbols (no repeats) Yes Permutation P(n, 4)
Select 6 books from 20 to pack (order irrelevant) No Combination C(20, 6)

Assumptions and limitations (important)

  • Integers expected: n and r should be whole numbers. If you enter decimals, results may be invalid or rounded depending on implementation.
  • Typical domain: this page is for counting without repetition and usually assumes 0 ≤ r ≤ n.
  • If r > n: for “without repetition” problems, the count is 0 (you can’t pick more distinct items than you have).
  • Very large values: factorial-based results become enormous quickly. Large n (even a few hundred) can exceed standard number sizes; the page may display scientific notation, big integers, or overflow depending on how results are implemented.
  • Repetition allowed? Not in nPr/nCr as defined here. If your problem allows repeats (e.g., PIN digits can repeat), you need different formulas (such as nr for ordered selections with repetition).

Helpful properties (sanity checks)

  • Symmetry: C(n, r) = C(n, n − r). Choosing r items is the same as excluding n−r items.
  • Edge cases: C(n, 0) = 1 and P(n, 0) = 1 (there is exactly one way to choose “nothing”).

Embed this calculator

Copy and paste the HTML below to add the Permutation & Combination Calculator | AgentCalc to your website.