Permutations vs Combinations: How to Count Arrangements
Does order matter, and can items repeat? Those two questions decide which of four counting formulas to use. Learn where each formula comes from, with examples from elections, handshakes, codes and ice cream.
How many ways can a club pick a president and a vice president? How many different pairs of people can shake hands at a party? How many four-letter codes are possible? These look like three different puzzles, but they all come down to two questions: does order matter, and can the same item be used twice? Answer those, and you know which of four formulas to use.
The two questions that decide everything
Does order matter? If choosing Alice then Ben gives a different result from choosing Ben then Alice, you are counting permutations, which are arrangements. If both orders give the same group, you are counting combinations, which are selections.
Is repetition allowed? If each item can be used only once (a person cannot hold two offices; a card cannot be dealt twice), repetition is not allowed. If an item can be picked again (a digit in a PIN, a flavor of ice cream), it is.
Those two yes-or-no answers give four cases:
- Order matters, no repetition:
nPr = n! / (n − r)! - Order does not matter, no repetition:
nCr = n! / (r! × (n − r)!) - Order matters, repetition allowed:
n^r - Order does not matter, repetition allowed:
C(n + r − 1, r)
Here n is how many items you can choose from, r is how many you pick, and n! (n factorial) means n × (n − 1) × … × 1.
Where the formulas come from
You do not need to memorize these if you understand the counting behind them.
Suppose you fill r slots in order from n items with no repeats. The first slot has n choices, the second n − 1, the third n − 2, and so on, until you have filled r slots. Multiplying those choices gives nPr. For example, 8 runners finishing first, second and third: 8 × 7 × 6 = 336 possible results.
Now forget the order. Any group of 3 runners can be lined up in 3! = 6 ways, and all six orderings were counted separately in the 336. Divide them out: 336 ÷ 6 = 56 groups of three. That is why nCr is always nPr divided by r!.
With repetition allowed and order mattering, every slot has all n choices again, so the count is n × n × … × n = n^r.
The last case, combinations with repetition, is the "stars and bars" result: choosing r items from n types with repeats allowed is equivalent to arranging r stars and n − 1 dividers in a row, which gives C(n + r − 1, r).
Worked examples for each case
A club election (order matters, no repetition)
A club of 12 members elects a president and a vice president. The roles are different, so order matters: 12P2 = 12 × 11 = 132 possible outcomes.
Handshakes at a party (order does not matter, no repetition)
The same 12 people, but now we just want pairs. Alice shaking Ben's hand is the same handshake as Ben shaking Alice's, so 12C2 = 132 ÷ 2 = 66 handshakes. At a smaller party of 6 people there are 6C2 = 15.
Letter codes (order matters, with and without repetition)
A four-letter code using A to Z, letters allowed to repeat: 26^4 = 456,976 codes. If every letter must be different: 26P4 = 26 × 25 × 24 × 23 = 358,800. Banning repeats removes more than one code in five.
Scoops of ice cream (order does not matter, with repetition)
A cup of 3 scoops from 5 flavors, where you may have the same flavor more than once and the order in the cup does not matter: C(5 + 3 − 1, 3) = C(7, 3) = 35 different cups. If order did matter (a cone, stacked), it would be 5^3 = 125.
The shape of combinations
For a fixed n, the number of combinations rises and then falls as r grows. With 10 items:

The chart is perfectly symmetric because choosing r items to keep is the same as choosing n − r to leave out: C(10, 3) = C(10, 7) = 120. The peak is always in the middle; with 20 items, C(20, 10) = 184,756. These numbers are the rows of Pascal's triangle, which is also where the coefficients of (a + b)^n come from.
How fast these numbers grow
Factorials explode. 5! is 120, but 52!, the number of ways to shuffle a standard deck, is about 8.07 × 10^67, a number with 68 digits. That is why a well-shuffled deck is almost certainly in an order no one has ever seen before. It is also why ordinary calculators give up on large inputs, and why tools that count combinations need exact big-number arithmetic.
How to use the calculator
The Permutation and Combination Calculator asks for n (total items), r (items chosen) and whether repetition is allowed. Without repetition it returns nPr and nCr; with repetition it returns n^r and the number of combinations with repetition. It works out the steps and gives exact whole numbers for n and r up to 1,000. Very long results are summarized in scientific notation, with the full value in the details panel.
A good habit: before you press Calculate, decide which of the four cases you are in. The tool gives you the numbers, but choosing the right question is the real skill.
Common mistakes
- Using combinations when roles differ. A team with a captain and a vice captain is a permutation problem, even though it sounds like "choosing a group."
- Forgetting that r can exceed n only with repetition. You cannot pick 5 different items from 4, so nPr and nCr are 0. With repetition, a 6-digit PIN from 10 digits is fine.
- Double counting by mixing methods. Count the slots once, then divide by the arrangements you do not care about. Do not divide twice.
- Assuming lottery tickets are permutations. In most draws only the set of numbers matters, so the count is a combination.
FAQ
Is a "combination lock" really a combination?
No. The order of the numbers matters and digits can repeat, so mathematically it is a permutation with repetition. A three-dial lock with digits 0 to 9 has 10^3 = 1,000 settings.
Why does 0! equal 1?
There is exactly one way to arrange zero items: do nothing. Defining 0! = 1 also keeps the formulas consistent, so that nC0 and nCn both equal 1.
How do permutations relate to probability?
Many probabilities are "favorable outcomes divided by all outcomes," and permutations or combinations count both. For example, the chance that a random 2-person pick from 6 people is one specific pair is 1 out of 6C2, or 1 in 15.
What if some items are identical?
Arrangements of a word like "LEVEL" need a different formula: divide n! by the factorial of each repeated letter's count. LEVEL has 5! ÷ (2! × 2!) = 30 distinct arrangements.