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.
Inputs
Number of Arrangements
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
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