terican

Last verified · v1.0

Calculator · math

Permutation And Combination Calculator

Compute permutations P(n,r) and combinations C(n,r) with or without repetition. Enter total items n and selection size r for instant, accurate results.

FreeInstantNo signupOpen source

Inputs

Number of Arrangements

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Number of Arrangements

The formula

How the
result is
computed.

Understanding Permutations and Combinations

Permutations and combinations are foundational counting techniques in combinatorics and probability theory. The essential distinction: permutations count ordered arrangements where sequence matters, while combinations count unordered selections where only membership matters. Both concepts extend to cases where items may be reused, producing four distinct formulas in total.

Permutation Formula (No Repetition)

When selecting and arranging r items from n distinct items without replacement, the count of possible ordered arrangements is:

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

For example, arranging 3 books chosen from a shelf of 10 gives P(10, 3) = 10! / 7! = 10 × 9 × 8 = 720. Each unique ordering counts as a separate permutation — placing book A first is distinct from placing it second.

Combination Formula (No Repetition)

When only the selection matters and not the arrangement, the combination formula divides out the r! redundant orderings:

C(n, r) = n! / (r! × (n − r)!)

Choosing 3 students from a class of 30 to form a committee yields C(30, 3) = 30! / (6 × 27!) = 4,060 possible committees. The order of selection is irrelevant — the same three students always form the same committee. This expression is also written as the binomial coefficient and appears throughout algebra, probability, and statistics. Khan Academy's combination formula lesson walks through the step-by-step derivation with visual examples.

Permutation With Repetition

When items can be reused and order still matters, each of the r positions independently holds any of the n items:

Prep(n, r) = nr

A 4-digit PIN using digits 0–9 with repetition allowed yields 104 = 10,000 possible codes. This formula is central to password security analysis, cryptographic keyspace estimation, and information entropy calculations.

Combination With Repetition (Multiset Coefficient)

When items may repeat and order does not matter, the multiset — or stars-and-bars — formula applies:

Crep(n, r) = (n + r − 1)! / (r! × (n − 1)!)

Selecting 4 scoops of ice cream from 6 flavors, with repeats allowed, gives Crep(6, 4) = 9! / (4! × 5!) = 126 distinct combinations. As explained in Whitman College's combinatorics and graph theory textbook, this identity maps each multiset onto a binary string of r ones and (n−1) zeros, making the count equivalent to choosing positions in that string.

Key Variables

  • n (Total Items): The size of the full set from which items are drawn. Must be a non-negative integer; for no-repetition formulas, n must be greater than or equal to r.
  • r (Items to Choose): The number of items selected or arranged. Must be a non-negative integer and, without repetition, cannot exceed n.
  • Calculation Type: Permutation or combination, each optionally allowing repetition — this four-way choice determines which formula the calculator applies.

Real-World Applications

  • Lottery odds: C(49, 6) = 13,983,816 — the number of ways to pick 6 numbers from 49 in a standard lottery draw.
  • Password security: Prep(26, 8) = 268 ≈ 208 billion possible 8-character lowercase-only passwords.
  • Sports podiums: P(8, 3) = 336 distinct gold/silver/bronze arrangements for 8 competing athletes.
  • Menu ordering: Crep(5, 3) = 35 ways to order 3 dishes from a 5-item menu when the same dish may be ordered more than once.
  • Genetics: C(20, 4) = 4,845 possible allele combinations when selecting 4 loci from a pool of 20.

Factorial Foundations

All four formulas depend on the factorial function: n! = n × (n−1) × … × 1, with the universal convention that 0! = 1. For large inputs, direct factorial multiplication is computationally intensive; efficient implementations cancel common factors before multiplying rather than computing full factorials. The Richland College statistics counting techniques reference and the Hagerstown Community College statistics formula packet both document these definitions as standard academic references for counting methods.

Choosing the Correct Formula

Follow this decision path: Does order matter? If yes, apply a permutation formula (P). Is repetition allowed? Yes: use nr. No: use n!/(n−r)!. If order does not matter, apply a combination formula (C). Is repetition allowed? Yes: use (n+r−1)!/[r!(n−1)!]. No: use n!/[r!(n−r)!]. Correctly identifying whether order and repetition are relevant to the real-world scenario is the most critical step in any combinatorial problem — the calculator handles the arithmetic once the right formula type is selected.

Reference

Frequently asked questions

What is the difference between a permutation and a combination?
A permutation counts ordered arrangements — the sequence {A, B, C} is distinct from {C, B, A}, so both are counted separately. A combination counts unordered selections — {A, B, C} and {C, B, A} represent the same group and are counted once. Use permutations for rankings, race finishes, and password sequences; use combinations for committees, card hands, and team selections where position is irrelevant.
How do you calculate P(10, 3) step by step?
Apply the permutation formula P(n, r) = n! / (n - r)!. For P(10, 3): P(10, 3) = 10! / (10 - 3)! = 10! / 7!. Since the 7! terms cancel, this simplifies to 10 × 9 × 8 = 720. There are 720 distinct ordered arrangements of 3 items drawn from 10 — for example, 720 different ways to award gold, silver, and bronze medals among 10 athletes.
When should repetition be allowed in permutation and combination calculations?
Repetition should be allowed when the same item can appear more than once in a selection or arrangement. Common examples include numeric PIN codes (the same digit can appear twice), ice cream scoops (the same flavor can fill multiple positions), and character-based passwords. Repetition must not be allowed when each item can only be used once — such as assigning unique roles to distinct people or arranging books that each have one copy.
What does C(n, r) equal when r is 0 or when r equals n?
C(n, 0) equals 1 for any value of n, because there is exactly one way to choose nothing — the empty set. C(n, n) also equals 1 because there is exactly one way to select every item in the set. Both results follow directly from the formula: C(n, 0) = n! / (0! × n!) = 1 and C(n, n) = n! / (n! × 0!) = 1, using the convention that 0! = 1.
What is the combination with repetition formula used for in practice?
The combination with repetition formula C_rep(n, r) = (n + r - 1)! / [r! × (n - 1)!] counts multisets — selections where the same item may appear multiple times and order does not matter. Practical uses include distributing identical candies into distinct bags, choosing ice cream flavors with repeats from a fixed menu, counting non-decreasing sequences in number theory, and solving resource-allocation problems where multiple units of the same resource can be assigned to one recipient.
Why is 0! defined as 1 and how does it affect permutation and combination results?
The convention 0! = 1 is necessary to keep factorial-based formulas consistent. Without it, C(n, n) = n! / (n! × 0!) would require dividing by zero, which is undefined — yet choosing all items from a set clearly has exactly one outcome. Mathematically, 0! = 1 also follows from the gamma function identity Γ(1) = 1, which extends the factorial to non-integer values and confirms the base case. Every permutation and combination formula with r = 0 or r = n depends on this convention to return meaningful results.