Permutation & Combination Calculator
Introduction: Understanding Permutations and Combinations
Permutations and combinations are core tools in counting and probability. They answer questions like:
- How many different 4-digit PINs can be formed?
- In how many ways can 6 lottery numbers be chosen from 49?
- How many possible 5-card poker hands exist in a standard deck?
This calculator lets you enter the total number of items n and the number of items chosen r. It then computes both the permutations and combinations for those values, so you can quickly compare “order matters” versus “order does not matter” scenarios.
Key Definitions
Before using the formulas, it helps to clarify a few basic terms.
Total items (n)
n is the size of the full set you are choosing from. Examples:
- 10 students in a class: n = 10
- 52 cards in a standard deck: n = 52
- 26 letters of the English alphabet: n = 26
Items chosen (r)
r is how many items you take from the set at once.
- Creating a 3-person committee from 10 people: r = 3
- Choosing 5 lottery numbers from 49: r = 5
- Drawing a 5-card hand from 52 cards: r = 5
Factorials
Both permutations and combinations rely on the factorial function. For any non-negative integer n, the factorial of n, written n!, is:
Formula: n ! = ∏ k = 1 n(k)
In plain language, you multiply all positive whole numbers from 1 up to n. For example:
- 1! = 1
- 3! = 1 × 2 × 3 = 6
- 5! = 1 × 2 × 3 × 4 × 5 = 120
By convention, 0! = 1.
Permutation Formula (Order Matters)
A permutation counts how many different ordered arrangements you can form when selecting r items from n without repetition. Changing the order produces a different permutation.
The number of permutations is written as P(n, r) and defined by:
Formula: P(n, r) = (n !) / ((n − r) !)
Plain text version: P(n, r) = n! / (n − r)!
Use permutations when:
- You care about order (1-2-3 is different from 3-2-1).
- You do not reuse items (no repetition).
Combination Formula (Order Does Not Matter)
A combination counts how many different groups of size r you can form from n items when order does not matter. The group {A, B, C} is the same as {C, B, A}.
The number of combinations is written as C(n, r) or nCr and defined by:
Formula: C(n, r) = (n !) / (r !(n − r) !)
Plain text version: C(n, r) = n! / [r! × (n − r)!].
Use combinations when:
- Order does not matter (1-2-3 is the same group as 3-2-1).
- You do not reuse items (no repetition).
Permutations vs. Combinations at a Glance
The following table summarizes the main differences and gives quick examples so you can decide which one to use.
| Aspect | Permutations P(n, r) | Combinations C(n, r) |
|---|---|---|
| Does order matter? | Yes, different orders count as different outcomes. | No, different orders are treated as the same group. |
| Typical notation | P(n, r) or nPr | C(n, r), nCr, or |
| Formula | P(n, r) = n! / (n − r)! | C(n, r) = n! / [r! (n − r)!] |
| Example scenario | Arranging 3 winners as gold, silver, bronze from 10 runners. | Choosing 3 people from 10 to form a committee. |
| Result size | Always greater than or equal to C(n, r) for the same n, r (when r > 1). | Always less than or equal to P(n, r) for the same n, r (when r > 1). |
| Relationship | P(n, r) = C(n, r) × r! | C(n, r) = P(n, r) / r! |
Three Problems, Worked by Hand
Example 1: Committee vs. Officer Roles
Question: A club has 10 members.
- How many ways can you choose 3 members to form a committee (no roles)?
- How many ways can you choose a president, vice president, and secretary (distinct roles)?
Here, n = 10 and r = 3.
Committee (order does not matter): use combinations.
C(10, 3) = 10! / [3! × (10 − 3)!] = 10! / (3! × 7!)
Compute step by step:
- 10! / 7! = 10 × 9 × 8
- 3! = 3 × 2 × 1 = 6
- C(10, 3) = (10 × 9 × 8) / 6 = 720 / 6 = 120
Officer roles (order matters): use permutations.
P(10, 3) = 10! / (10 − 3)! = 10! / 7! = 10 × 9 × 8 = 720
So there are 120 possible committees but 720 ways to assign three distinct officer roles.
Example 2: Lottery Numbers
Question: A lottery asks you to choose 6 distinct numbers from 49, and the drawn numbers are not ordered. How many different tickets are possible?
Here, n = 49 and r = 6. Order does not matter, so we use combinations:
C(49, 6) = 49! / [6! × 43!]
Writing out all factorials is impractical by hand, but the calculator evaluates this quickly, giving:
C(49, 6) = 13,983,816 possible tickets.
This huge number illustrates why winning the jackpot with one ticket is very unlikely.
Example 3: Simple Passwords
Question: You create a 3-letter password using distinct uppercase letters (A–Z). How many possibilities are there if order matters?
There are n = 26 letters, and you use r = 3 distinct letters in each password. Order clearly matters (“ABC” is different from “CBA”), so use permutations:
P(26, 3) = 26! / (26 − 3)! = 26! / 23! = 26 × 25 × 24
Compute:
- 26 × 25 = 650
- 650 × 24 = 15,600
So there are 15,600 possible 3-letter passwords under these assumptions.
Running Your Own Numbers
Only two inputs stand between you and an answer. Put the size of the full set in Total items (n) — that is the pool you draw from, whether it is 10 students, 49 lottery balls, or the 52 cards in a deck. Put how many you pull out of that pool in Items chosen (r). Hit calculate and the page returns both counts at once: P(n, r) for the ordered arrangements and C(n, r) for the unordered groups.
Because you get both numbers on every run, the fastest way to build intuition is to fix n and r and just read the two answers side by side — the gap between them is exactly the r! reorderings of each group. Change either box and recalculate to test a different scenario; nothing you type leaves the page.
Reading the Two Answers
The calculator hands you two counts, and picking the right one comes down to a single question: does rearranging the same items give you something you would call a different outcome?
- If shuffling the order changes nothing — a lottery ticket, a poker hand, a subset of files to back up — the number you want is C(n, r). The listing order is just bookkeeping.
- If shuffling the order creates a genuinely new result — a podium of gold/silver/bronze, a password, a seating chart, a batting lineup — read P(n, r) instead.
The two counts always sit in a fixed ratio: P(n, r) is exactly r! times C(n, r), because every unordered group can be shuffled into r! distinct arrangements. That is why the permutation count balloons so much faster. Once P(n, r) climbs into the millions or billions, it is telling you that listing every outcome by hand is hopeless — from that point on, any probability you need has to come from the formula, not from enumeration.
Where These Formulas Stop Working
P(n, r) and C(n, r) describe one specific setup: you draw distinct items from a fixed pool and never put anything back. Stretch the problem outside that setup and these formulas quietly give the wrong count. Keep the boundaries in mind:
- Non-negative integers: n and r are whole numbers (0, 1, 2, …). Negative or non-integer values are not valid in these formulas.
- r ≤ n: You cannot choose more items than exist in the set. If r > n, P(n, r) and C(n, r) are defined as 0 in many contexts.
- No repetition: Once an item is chosen, it is not used again in the same selection (sampling without replacement).
- Standard factorials: Calculations are based on ordinary factorials n! with 0! = 1.
- Large numbers: For large n and r, factorials grow extremely quickly. Depending on implementation and your device, results may be shown in scientific notation or may reach the limits of numeric precision.
There are also related counting formulas for cases with repetition (for example, allowing the same letter to appear more than once in a code). Those are not covered by the basic P(n, r) and C(n, r) formulas used here.
Privacy and Local Computation
All calculations are performed directly in your browser using client-side code. The values you enter for n and r are not sent to a server for processing. This keeps your usage private and ensures that results appear instantly, even if you are offline after loading the page.
Related Topics
To go deeper into discrete mathematics and probability, you may also find these concepts and tools helpful:
- Factorials and properties of n! (including approximations like Stirling’s formula for large n).
- Basic probability rules (sample spaces, events, and conditional probability).
- Binomial coefficients and the binomial distribution, which also rely on C(n, r).
- Dedicated tools such as a factorial calculator or probability calculator for more complex problems.
Together, permutations and combinations give you a compact language for reasoning about large, complex sets of possibilities without having to list them all individually.
Arcade Mini-Game: Permutation & Combination Calculator Calibration Run
Use this quick arcade run to practice separating useful scenario inputs from common planning mistakes before you rely on the calculator output.
Start the game, then use your pointer or arrow keys to catch useful inputs and avoid bad assumptions.
