Introduction to permutations, combinations, order and repetition
This permutation and combination calculator answers four related counting questions from the same two inputs. Enter the number of available, distinguishable items as n and the number of positions or picks as r. The result panel then shows every standard interpretation: an ordered selection without repeats, an unordered selection without repeats, an ordered selection with repeats, and an unordered selection with repeats. Seeing all four together is useful because the arithmetic is often easy while choosing the right model is not.
Before selecting a formula, describe the outcome in ordinary language. Ask whether swapping two selected items changes the outcome. A podium of Ana, Ben and Chi is different from a podium of Chi, Ben and Ana, so order matters. A three-person committee containing the same people is unchanged when its names are written in a different order, so order does not matter. Then ask whether an item may be selected more than once. A card drawn from a deck is normally removed before another draw, while a digit in a PIN can usually appear in several positions. Those two decisions create the four rules reported below.
The distinction is about the meaning of the outcome, not about how a question happens to be written. A list can represent an unordered set, and a group can represent ordered roles. For example, choosing three books to borrow is normally a combination even if the books are named one after another. Assigning those same three books to first, second, and third display positions is a permutation because the positions distinguish the arrangements.
How to use the permutation and combination calculator
Enter n as the number of items available and r as the number of items chosen, placed, or drawn. Select Calculate counts to see all four interpretations at once. This approach is particularly helpful when a word problem is ambiguous: read the labels in the results panel and match the label to the situation. The reset button clears both fields and removes the values from the page address.
Use “order matters, no repetition” for distinct roles, rankings, and sequences built without replacement. Use “order ignored, no repetition” for a group, hand, or subset. Use “order matters, repetition allowed” for passwords, repeated dice-like choices, or strings of symbols. Use “order ignored, repetition allowed” for a multiset, such as scoops of ice cream where the same flavour may be requested more than once.
Inputs for the permutation and combination calculation
The value n is the size of the pool: 10 club members, 49 lottery numbers, 52 cards, or 26 letters are typical examples. The value r is the number selected at one time, or equivalently the number of slots being filled. Both inputs must be non-negative whole numbers. The page permits values through 2,000 and uses arbitrary-precision integers, so returned counts are exact rather than floating-point estimates.
The calculator assumes that pool items are distinguishable. Red, blue and green balls count as different items; individual students count as different people. If several items are genuinely identical, a different model such as a multinomial coefficient may be necessary. It also counts possible outcomes, not probabilities. A count can become part of a probability calculation only after the problem establishes which outcomes are equally likely.
A quick wording test can prevent a common error. If you can replace “then” with “and” without changing the outcome, order may be irrelevant. If the question names separate positions, times, ranks, or tasks, order is usually relevant. Likewise, phrases such as “without replacement,” “distinct,” and “different” generally prohibit repeats, whereas “with replacement,” “may repeat,” and “any of” usually permit them.
Permutation formula when order matters and repetition is forbidden
A permutation P(n, r), also written nPr, counts ordered arrangements selected without replacement. The first slot has n choices, the next has n − 1, and the choices continue to shrink until r slots are filled. This makes permutations appropriate for officer roles, race positions, seating assignments, and codes whose characters cannot repeat.
Formula: P(n, r) = (n !) / ((n − r) !)
The factorial notation means multiplication of positive integers through its argument. In particular, 5! is 5 × 4 × 3 × 2 × 1, and 0! is defined as 1. The calculator evaluates the shorter falling product n × (n − 1) × … rather than constructing large factorials merely to cancel them later.
The same permutation calculation can be written as a product of the available choices for each successive position:
Formula: P(n, r) = n × (n − 1) × … × (n − r + 1)
Combination formula when order is ignored and repetition is forbidden
A combination C(n, r), also written nCr, counts groups rather than arrangements. A committee made from A, B and C is one committee regardless of whether the names are listed ABC, BAC or CBA. The permutation count includes each group r! times, once for every ordering, so dividing by r! removes that over-counting.
Formula: C(n, r) = (n !) / (r !(n − r) !)
Combinations are the usual rule for lottery tickets, poker hands, committees, and choosing a set of products when sequence has no meaning. For the same valid n and r, P(n, r) equals r! × C(n, r). This identity explains why permutation results are larger whenever more than one item is selected: each unordered group can be placed into the ordered slots in several ways.
Formula: P(n, r) = r ! × C(n, r)
There is also a useful symmetry check for combinations: choosing r people to include from n is equivalent to choosing n − r people to leave out. Thus C(n, r) and C(n, n − r) must match. This can make a hand calculation shorter when r is close to n.
Repetition-allowed formulas for codes and multisets
When an item remains available after a pick, the ordered rule becomes much simpler. Each of r positions has all n choices, independently, so there are n raised to the r power possible sequences. A four-digit PIN using ten digits therefore has 10,000 possible values, including values with repeated digits such as 1001.
Formula: N = n^r
For an unordered selection that permits repeats, use combinations with repetition. This models multisets such as three ice-cream scoops selected from five flavours when a flavour may appear twice. The stars-and-bars interpretation treats the r selected items as stars and uses n − 1 dividers to separate categories.
Formula: N = C(n + r − 1, r) = ((n + r − 1) !) / (r !(n − 1) !)
In this final case, the selected flavours or categories matter but their order does not. Vanilla, vanilla, chocolate is the same cup as chocolate, vanilla, vanilla. By contrast, a two-character code AB is different from BA, so it belongs to the ordered repetition-allowed model. Keeping these interpretations separate is more important than memorizing the notation.
Worked permutation and combination example with n = 10 and r = 3
Suppose a club of 10 members needs either a three-person committee or three distinct officer roles. For the committee, order is ignored and members cannot repeat, so the answer is C(10, 3) = 120. For president, vice president and secretary, order matters, so the answer is P(10, 3) = 10 × 9 × 8 = 720. The difference is exactly 3! = 6 because every committee can be arranged among the three named roles in six ways.
Now consider a three-letter code from 26 letters. If letters cannot repeat, P(26, 3) gives 15,600 codes. If repetition is allowed, 26³ gives 17,576 codes. Finally, selecting three scoops from five flavours with repeats allowed but order ignored gives C(5 + 3 − 1, 3) = C(7, 3) = 35 possible cups. The same style of question can therefore have very different answers; the assumptions decide the formula.
As another practical example, suppose a photographer chooses two different finalists from eight images. Selecting the images for a gallery wall is C(8, 2) = 28 because the pair has no internal order. Awarding gold and silver to two images is P(8, 2) = 56 because exchanging the prizes creates a different outcome. If a two-symbol label can use any of eight symbols twice, the count is 8² = 64. These small comparisons show why no single “choose” formula fits every problem.
Limits and interpretation of the four counting results
If r is greater than n, it is impossible to select r distinct items from a pool of n items. The calculator consequently reports zero for the two no-repetition cases. It still returns meaningful repetition-allowed values, because a PIN can reuse digits and an ice-cream order can reuse flavours. The special case n = 0 and r = 0 has one empty outcome, consistent with the convention 0! = 1.
Very large exact integers can be cumbersome to read on a phone. For results longer than 21 digits, the display gives a scientific-notation summary and the exact digit count. The underlying integer is still computed exactly. All arithmetic runs locally in the browser; no n or r value is submitted to a server. For further study, standard references include NIST Digital Library of Mathematical Functions §26.3 and discrete mathematics texts covering binomial coefficients and stars and bars.
These formulas count labelled possibilities under stated assumptions; they do not decide whether outcomes are equally likely, physically possible, or equally desirable. A security question may also need to exclude leading zeroes, prohibited characters, or predictable patterns. A probability question may require multiplying or dividing by additional probabilities. Check the wording and constraints before treating a count as a final answer.
When should I choose a permutation?
Choose a permutation when positions, roles, rank, or sequence make a difference and no item may be reused. Examples include first through third place, assigning distinct offices, and arranging different books on a shelf.
When should I choose a combination?
Choose a combination when only the members of the selected group matter and each item can appear at most once. Examples include a committee, a card hand, or a set of lottery numbers.
Arrange & Choose counting game
Use this optional mini-game to practice the distinction between an arrangement and a selection. Start a round, choose tokens, and discover unique outcomes under the active rule. In unordered rounds, AB and BA count only once; in no-repeat rounds, a repeated token is rejected.
Rule
1 of 5
Found
0 / 12
Score
0
Best
0
Streak
0
Repeats bounced
0
Time
0:00
Press Start round, then select tokens from the canvas.
