Σ
Configure Your Set
Separate items with commas. Each unique entry counts as one element of your set (n). n = 4 items detected
Total number of distinct items in your set.
Items will appear in the list as 1, 2, 3 ... n
How many items to choose from the set.
Order
Repetition
Permutation, No Repetition P(n, r) = n! / (n - r)!
Total Possible Arrangements
12
P(4, 2) = 4! / (4 - 2)! = 12
Cannot choose more items than exist in the set when repetition is not allowed. There are 0 valid arrangements.
All Possible Arrangements Showing 12 of 12
💡
The Fruit Bowl vs. Padlock Analogy

The fastest way to lock in the permutation-combination difference is to picture two everyday objects.

🍎
Fruit Bowl = Combination

Imagine reaching into a bowl and grabbing an apple, an orange, and a banana. Does it matter which one your hand touched first? Of course not. You end up with the same three pieces of fruit regardless of order. {Apple, Orange, Banana} is identical to {Banana, Apple, Orange} because you only care about which items you have, not the sequence you picked them in.

Order does NOT matter - use a Combination
🔒
Padlock = Permutation (Not a Combination!)

A padlock labeled "combination lock" is mathematically a misnomer. Entering 3-1-2 is completely different from entering 1-2-3 or 2-3-1. Each distinct sequence unlocks a different vault. The order of the digits is everything. Despite its name, every padlock in existence is a permutation problem - because sequence defines the correct answer.

Order DOES matter - use a Permutation
📖
Key Terms Explained
Permutation
An arrangement of items where order matters. Selecting A then B is a different permutation from selecting B then A, even though both use the same two items.
Combination
A selection of items where order does not matter. {A, B} and {B, A} are the same combination because they contain the same elements in any sequence.
Factorial (n!)
The product of all positive integers from 1 up to n. Example: 5! = 5 x 4 x 3 x 2 x 1 = 120. By definition, 0! = 1. Factorials count all possible orderings of n items.
Set
The total pool of distinct items you are choosing from. The size of this pool is represented by n (Total Items) in all four formulas.
Subset
A smaller group selected from the full set. The number of items to choose is called r (Subset Size). When repetition is off, r cannot exceed n.
Repetition
Whether an item can appear more than once in a single selection. Allowing repetition significantly increases the total count, especially as r grows large.
Probability Space
The complete set of all possible outcomes for a random experiment. The total count this tool produces is the size of the probability space for your scenario.
Ordered Pair
A sequence of elements where position is significant. (A, B) is a different ordered pair from (B, A). Permutations produce ordered pairs or, for r items, ordered tuples.
Multiset
A collection that allows repeated elements. Combinations with repetition produce multisets, where {A, A, B} is a valid result even if A appears only once in the source set.
Sample Space
In probability theory, the sample space is every possible outcome of an experiment. Each arrangement listed by this tool is one member of the sample space for your configuration.

The Complete Guide to Permutations and Combinations

Whether you are solving a statistics homework problem, designing a password policy, scheduling a tournament bracket, building a recommendation engine, or analyzing a lottery draw - you are working with permutations and combinations. This guide explains the four fundamental formulas, when to use each one, and how to interpret the numbers they produce.

How to Use This Tool

Switch between Custom Array mode and Numbers Only mode using the tabs at the top of the calculator. In Custom Array mode, paste your actual items separated by commas (for example: Ace, King, Queen, Jack, Ten) and the tool counts them automatically to set n. In Numbers Only mode, type n directly and the list generator will use numbers 1 through n as placeholder item names.

Set r to control how many items you are choosing. Toggle the Order and Repetition options to select one of the four formula states. Every output - including the formula display, total count, and the arrangement list below - updates in real time with no button press required.

The Four Formulas at a Glance

Type Repetition Formula n=4, r=2
Permutation No n! / (n - r)! 4! / 2! = 12
Permutation Yes n^r 4^2 = 16
Combination No n! / (r! x (n - r)!) 4! / (2! x 2!) = 6
Combination Yes (n+r-1)! / (r! x (n-1)!) 5! / (2! x 3!) = 10

Why Does Repetition Increase the Count So Dramatically?

Without repetition, every time you pick an item it is removed from the available pool, so your options narrow with each selection. If you have 4 items and choose 2, your first pick has 4 options and your second has only 3 - giving 4 x 3 = 12. With repetition, both picks have the full 4 options because the pool never shrinks: 4 x 4 = 16. As r grows, this gap becomes enormous. With n=10 and r=10 and no repetition, the result is 10! = 3,628,800. With repetition it is 10^10 = 10,000,000,000 - nearly 2,756 times larger.

Real-World Applications

Passwords and PINs use permutations with repetition: a 4-digit PIN from digits 0-9 has 10^4 = 10,000 possible values. Lottery draws use combinations without repetition: picking 6 numbers from 49 gives C(49,6) = 13,983,816 possible tickets. A round-robin sports tournament schedule uses combinations (which teams play each other) while playoff seedings use permutations (who finishes in which position). Cryptography, genetics (codon arrangements), and network routing all rely on these same four formulas at massive scale.

Browser Safety and Large Numbers

Factorials grow extremely fast. This tool uses JavaScript's built-in BigInt type to compute exact integer results for any n up to 5,000 and any r. When the result exceeds JavaScript's Number.MAX_SAFE_INTEGER (approximately 9 x 10^15), the total is displayed in scientific notation to avoid rounding errors. For values beyond BigInt precision, a log-based approximation is shown instead. The arrangement list is always capped at 500 entries to prevent browser slowdowns - a notice appears when the cap is active.

Frequently Asked Questions

What is the difference between a permutation and a combination?
A permutation counts arrangements where order matters: choosing A then B is different from choosing B then A, so (A, B) and (B, A) are two separate permutations. A combination counts selections where order does not matter: {A, B} and {B, A} are the same group, so they count as one combination. Because every combination can be rearranged in multiple ordered ways, the permutation count is always equal to or greater than the combination count for the same n and r. Specifically, P(n,r) = C(n,r) x r! because every combination can be permuted in r! ways.
Why does allowing repetition drastically increase the number of possibilities?
Without repetition, each pick removes one item from the available pool, so your options narrow with every selection. With repetition, the full pool is available at every pick because items are not consumed. For permutations the formula jumps from n!/(n-r)! to n^r. At small values the difference is minor, but as r approaches or exceeds n the gap becomes exponential. With n=26 letters and r=8 choices, no-repetition gives about 62 billion arrangements while repetition gives 26^8 = 208 billion - more than three times as many. Allowing repetition is what makes PINs, passwords, and padlocks generate so many more values than equivalent no-repetition problems.
Why is a padlock combination technically a permutation?
The term "combination lock" is a historical misnomer that has stuck in everyday language. Mathematically, a padlock requires you to enter digits in a specific sequence: 3-1-2 opens the lock while 1-2-3 does not. Because the order of the digits is critical to the correct result, the accurate mathematical term is a permutation, not a combination. A true combination lock - in the mathematical sense - would open with any ordering of the correct digits, which no real lock does. The padlock is actually a permutation with repetition, since the same digit can appear more than once.
How do factorials work in probability math?
A factorial (written n!) is the product of every whole number from 1 up to n. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120. Factorials count the number of ways to arrange n distinct items in a sequence. Dividing one factorial by another cancels out shared terms efficiently: n!/(n-r)! is the same as multiplying just the top r descending terms (for n=5, r=3: that is 5 x 4 x 3 = 60). By convention, 0! = 1, which ensures the formulas produce correct results when r = 0 (one way to choose nothing: the empty selection) or when r = n (one way to arrange all items: the full set in order).
What happens if the subset size r is larger than the total set n?
When repetition is not allowed, it is physically impossible to choose more unique items than exist in the set - you would run out of items before reaching your target count. The result is exactly 0 valid arrangements, and this tool displays a warning when this condition is detected. When repetition is allowed, r can freely exceed n because items can be selected multiple times, so the pool never runs dry. For example, with n=2 items (Heads, Tails) and r=5 flips, there are 2^5 = 32 possible sequences even though r is far larger than n.