Permutation and Combination Calculator

The Permutation and Combination Calculator solves two fundamental problems in combinatorics: how many ways can you arrange or select items from a set? Permutations count ordered arrangements (the order matters), while combinations count unordered selections (order doesn't matter). This calculator handles both cases, with and without repetition, showing every step of the factorial calculation so you can understand the math behind the answer.

star 4.9
auto_awesome AI
New

nPr & nCr Calculator calculator

calculate Inputs

Total items in the set (max 170)

Quick Examples

analytics Results

Without Repetition

Permutations nPr Order matters
Combinations nCr Order doesn't matter

Step-by-Step

lightbulb Tips

  • Order matters → Permutation (nPr)
  • Order doesn't matter → Combination (nCr)
  • C(n,r) = C(n, n−r) — symmetric property
  • nCr ≤ nPr always (for same n, r)

functions Formulas

Without Repetition
nPr n! / (n−r)!
nCr n! / (r!×(n−r)!)
With Repetition
nPr (rep)
nCr (rep) C(n+r−1, r)
Common Examples
Lottery C(49,6) 13,983,816
Cards C(52,5) 2,598,960
4-digit PIN (rep) 10,000

The Formula

Permutations (nPr) count ordered arrangements. Combinations (nCr) count unordered selections. With repetition: nPr = nʳ, nCr = (n+r−1)! / (r!(n−1)!)

nPr = n! / (n−r)! | nCr = n! / (r! × (n−r)!)

lightbulb Variables Explained

tips_and_updates Pro Tips

1

Use permutation when order matters (e.g., first/second/third place finishes)

2

Use combination when order doesn't matter (e.g., selecting a team)

3

nCr is always ≤ nPr for the same n and r

4

C(n,r) = C(n, n−r) — choosing 3 from 10 = choosing 7 from 10

5

For repetition allowed: arranging r items from n gives nʳ permutations

Permutations and combinations are fundamental counting techniques in probability and statistics that determine the number of ways to select and arrange items from a set. The key distinction is order: permutations count arrangements where order matters (ABC ≠ BCA), while combinations count selections where order does not matter (ABC = BCA). The formulas — P(n,r) = n!/(n-r)! for permutations and C(n,r) = n!/[r!(n-r)!] for combinations — answer questions from lottery odds and password security to team selection and experimental design. From a group of 10 people, there are P(10,3) = 720 ways to assign president, VP, and secretary (order matters), but only C(10,3) = 120 ways to select a 3-person committee (order doesn't matter). Our permutation and combination calculator computes both values for any n and r, handles large factorials precisely, shows step-by-step solutions, and supports repetition variants for scenarios where items can be reused.

When to use permutations vs combinations

Use permutations when the order or arrangement of selected items matters: assigning ranked positions (1st, 2nd, 3rd place), arranging books on a shelf, creating passwords or PIN codes, seating arrangements, and phone numbers. Use combinations when you are simply choosing a subset and order is irrelevant: selecting team members, choosing lottery numbers, picking menu items, and forming committees. A helpful test: if swapping two selected items creates a different outcome, use permutations; if the swap doesn't matter, use combinations. Lottery numbers illustrate this perfectly — the Mega Millions drawing selects 5 numbers from 70 plus 1 from 25: C(70,5) × 25 = 302,575,350 possible tickets. If order mattered, there would be P(70,5) × 25 = 36,309,042,000 possibilities — 120 times more.

Formulas and calculation techniques

Basic permutations: P(n,r) = n!/(n-r)!. P(10,3) = 10!/7! = 10×9×8 = 720. Basic combinations: C(n,r) = n!/[r!(n-r)!]. C(10,3) = 10!/(3!×7!) = 720/6 = 120. With repetition allowed: permutations = n^r (e.g., a 4-digit PIN from digits 0-9 has 10⁴ = 10,000 possibilities). Combinations with repetition: C(n+r-1, r) — choosing 3 scoops from 5 ice cream flavors with repeats allowed gives C(7,3) = 35. For large values, use the multiplicative formula to avoid computing huge factorials: C(52,5) = (52×51×50×49×48)/(5×4×3×2×1) = 2,598,960 — the number of possible 5-card poker hands.

Real-world applications and probability

Password security: an 8-character password using uppercase, lowercase, digits, and 10 symbols (72 characters) has 72⁸ = 722 trillion permutations with repetition — taking a brute-force attack approximately 22,800 years at 1 billion attempts per second. Adding just 2 more characters (10-character password) increases this to 3.7 quadrillion — 5,140 times harder to crack. In genetics, the number of ways to choose 23 chromosome pairs from a parent's 46 chromosomes is C(46,23) ≈ 8.2 billion, explaining genetic diversity. In quality control, selecting 5 items from a batch of 100 for testing involves C(100,5) = 75,287,520 possible samples. In tournament brackets, the number of possible NCAA March Madness brackets is 2⁶³ ≈ 9.2 quintillion — which is why no one has ever correctly predicted a perfect bracket.

Frequently Asked Questions

sell

Tags

verified

Data sourced from trusted institutions

All formulas verified against official standards.