2026-08-07 9 min

Permutation and Combination Calculator

Calculate permutations (nPr) and combinations (nCr) with and without repetition, with factorials and step-by-step multiplication-principle solutions.

Calculator

Total items (n) Help

Non-negative integer

Items to choose (r) Help

Non-negative integer

Results update automatically
Results update live as you type
Status:n=8, r=4P = 1680C = 70

Results for n=8, r=4

P(n,r) no repetition1680
P(n,r) with repetition4096
C(n,r) no repetition70
C(n,r) with repetition330

Factorial Breakdown

TermValue
n!40320
r!24
(n−r)!24
P = n!/(n−r)!1680
C = P/r!70

Results

Optimal

Permutation (no repetition)

1680P(n,r)

Ordered picks: n!/(n−r)!

Permutation (with repetition)

4096n^r

Ordered picks with repeats: n^r

Combination (no repetition)

70C(n,r)

Unordered picks: n!/(r!(n−r)!)

Combination (with repetition)

330

Multiset picks: (n+r−1)!/(r!(n−1)!)

n! (Total Factorial)

40320

Ways to order all n items

r! (Pick Factorial)

24

Internal orderings divided out for combinations

(n−r)! (Leftover Factorial)

24

Orderings of the unpicked items

Counts assume n distinct items with integer n, r ≥ 0. Repetition-free modes require n ≥ r. Integers are exact below 1e15; larger counts display in scientific notation.

Visualizations

Counts on log₁₀ Scale

3.2P no rep
3.6P w/ rep
1.9C no rep
2.5C w/ rep

Picked vs Left (no repetition)

Picked (r=4)50%
Left (n−r=4)50%

Share of Items Picked

r / n50%

Combinations vs Permutations

C(n,r)1.9 log₁₀

Formula

Counting starts from the multiplication principle: r ordered slots offer n, n−1, … choices without repetition, or n each with repetition. Forgetting order divides by the r! internal arrangements; multisets map to stars-and-bars positions.

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

Alternative Form

With repetition: P = n^r · C = (n+r−1)!/(r!(n−1)!) · n! = n×(n−1)×…×1, 0! = 1

Variables

SymbolNameUnitDescription
nPool sizecountDistinct items available
rPick countcountItems chosen
!FactorialcountProduct of 1…n; orderings of n items
P(n,r)PermutationscountOrdered selections
C(n,r)CombinationscountUnordered selections
n^rWith-repetition permutationscountOrdered picks, repeats allowed
n−rLeftoverscountUnpicked items whose orderings cancel

Explanation

Order is the whole divide: permutations keep all r! arrangements distinct while combinations collapse them into one selection. Repetition multiplies choices back at every slot.

Derivation

P(n,r) telescopes n!/(n−r)! by canceling the leftover orderings. C(n,r) further cancels the r! pick orderings. With repetition, each of r slots has n options (n^r); multisets biject to binary strings with r stars and n−1 bars, counted by C(n+r−1,r).

Step-by-Step Calculation

Follow each step to understand how the result is calculated from your inputs.

Step 1

Validate that n and r are non-negative integers.

n, r ∈ {0, 1, 2, …}
n:8
r:4
Intermediate: integer and sign checks
Result: Inputs valid
Step 2

Check that enough items exist for repetition-free picks.

require n ≥ r
n:8
r:4
Intermediate: sufficient items
Result: Proceed with all four modes
Step 3

Count ordered picks without repetition via the multiplication principle.

P(n,r) = n × (n−1) × … × (n−r+1)
n:8
r:4
Intermediate: 8 × 7 × 6 × 5
Result: P = 1680
Step 4

Divide out internal orderings for unordered picks.

C(n,r) = P(n,r) / r!
P(n,r):1680
r!:24
Intermediate: 1680 / 24
Result: C = 70
Step 5

Allow repeats: every pick independently sees all n items.

n^r
n:8
r:4
Intermediate: 8^4
Result: P with repetition = 4096
Step 6

Count multisets with stars and bars.

C(n+r−1, r) = (n+r−1)!/(r!(n−1)!)
n:8
r:4
Intermediate: (8+4−1)!/(4!(8−1)!)
Result: C with repetition = 330
Final Answer
1680

Worked Examples

See how the calculator works with different scenarios.

Scenario

Choose any 4 players from 8 where order does not matter.

Inputs

n:8
r:4

Calculation

C = 8!/(4!×4!) = 40320/(24×24) = 70

Result

70 possible teams

Interpretation

Order-blind selection collapses 1,680 lineups into 70 squads — the r! = 24 collapse factor.

Understanding Your Result

Your Result: Permutation (no repetition): 1680 P(n,r)

Typical range: C(8,4)=70 teams; P(8,4)=1,680 lineups; C(49,6)≈14M lottery lines.

What This Means

Each count is the number of distinct outcomes under stated order/repetition rules — lineups, teams, codes, or multisets.

Why It Matters

Passwords, lotteries, trials, and sampling plans all stand on these counts; wrong-mode counting errs by factors of r!.

Professional Interpretation

Name the mode (ordered/unordered × with/without repetition) before quoting any count — the label is the calculation.

Recommendations

  • •Ask “does rearranging change it?” first
  • •Ask “can picks repeat?” second
  • •Use C(n,n−r) symmetry for big r
  • •Show factorials for auditability
  • •Watch for 170! overflow limits
  • •Convert counts to probabilities via ratios

Educational Content

Introduction

Combinatorics counts possibilities without listing them. Two binary choices — order matters? repetition allowed? — select among four formulas this calculator evaluates together.

Concept Explanation

The multiplication principle chains independent choices; factorials package descending chains; division forgets structure (order of picks, order of leftovers).

Applications

▸Lottery and raffle odds
▸Password and PIN strength estimates
▸Team and committee formation
▸Card and dice probabilities
▸Experimental design and sampling
▸Algorithm complexity counting

Benefits

  • •All four modes side by side
  • •Factorial audit trail included
  • •Invalid states explained, never broken output
  • •Log-scale chart tames huge counts
  • •Step-by-step multiplication chains

Limitations

  • •Distinct items assumed (no duplicates)
  • •No partial or weighted selection
  • •Exact only to ~18!, floating beyond
  • •Single (n,r) pair per run

Best Practices

  • •State the counting mode explicitly
  • •Reduce via C(n,n−r) for large r
  • •Use logs for astronomically large counts
  • •Verify n ≥ r for repetition-free modes
  • •Ratio counts for probabilities

Common Misconceptions

Myth: More formulas means harder problems.
Truth: Two yes/no questions (order? repeats?) pick the single correct formula every time.
Myth: 0! should be 0.
Truth: 0! = 1: exactly one way to arrange nothing — the empty product.
Myth: Combinations ignore order entirely.
Truth: They divide order out by r!, which is precisely why C = P/r!.
Myth: Bigger n always means bigger counts.
Truth: Raising r past n/2 shrinks combinations by symmetry.

Practical Tips

  • •Decide order first, repetition second
  • •Use symmetry C(n,r)=C(n,n−r)
  • •Keep n, r as integers ≥ 0
  • •Read huge counts in scientific notation
  • •Compare modes on the log chart
  • •Derive lottery odds as 1/C(n,r)
  • •Re-run for “what-if” roster sizes

Common Mistakes

Using permutations for teams
Teams ignore order — divide by r! by using combinations.
Forgetting PIN digits repeat
Codes reuse symbols: use with-repetition modes.
Picking r > n without repetition
Either allow repetition or shrink r; the math forbids distinct picks beyond n.
Computing giant factorials directly
Cancel first or use the multiplicative chain n×(n−1)×…×(n−r+1).
Mixing modes mid-problem
Fix one mode per count; multi-stage problems multiply mode-consistent counts.

Assumptions

This calculator makes the following assumptions to provide estimates:

Distinct Items: All n pool items are distinguishable.
Integer Inputs: n and r are non-negative integers.
Uniform Outcomes: Every counted arrangement is equally likely (for probability use).
Single Stage: One pick-set per calculation; chains multiply manually.
Exact Arithmetic Range: Integers exact below 1e15; scientific beyond.

Limitations

Be aware of these limitations when using this calculator:

No Duplicate Items: Multiset pools need manual factorial division.
No Weights: Biased selections are not modeled.
Overflow Ceiling: Factorials past 170! exceed doubles.
One Pair Only: Compare scenarios across runs.

Frequently Asked Questions

Answers to common questions about this calculator.

What is the difference between permutation and combination?
Order matters in permutations (ABC differs from CBA); it does not in combinations (both are one team). Permutations count arrangements; combinations count selections. P(n,r) is always ≥ C(n,r).
What is the permutation formula?
Without repetition: P(n,r) = n!/(n−r)!. With repetition allowed: n^r. For n=8, r=4: P = 8×7×6×5 = 1,680 without repetition, 8⁴ = 4,096 with.
What is the combination formula?
Without repetition: C(n,r) = n!/(r!(n−r)!). With repetition: (n+r−1)!/(r!(n−1)!). For n=8, r=4: C = 70 without repetition, 330 with.
What is a factorial?
n! = n×(n−1)×…×1, the number of ways to order n distinct items. By convention 0! = 1. Factorials grow explosively: 10! = 3,628,800 and 20! ≈ 2.43×10¹⁸.
When do I allow repetition?
Allow repetition when picks can repeat — digits in a PIN, dice rolls, scoops of ice cream. Forbid it for teams, committees, and card hands, where each item is used at most once.
When does order matter?
Order matters for passwords, rankings, and starting lineups (permutations). It does not for teams, toppings, or lottery numbers (combinations). Ask: does rearranging change the outcome?
Why must n be ≥ r without repetition?
You cannot pick 5 distinct items from 3. The formulas divide by (n−r)!, which is undefined for negative integers — the calculator reports this as invalid instead.
What is C(n,r) symmetry?
C(n,r) = C(n,n−r): choosing 4 from 8 (70) equals leaving 4 behind. Compute with the smaller of r and n−r to keep factorials small.
How do permutations relate to probability?
Classical probability divides favorable arrangements by total ones: P = C(favorable)/C(total) for equally likely selections. Lottery odds are pure combination ratios.
What are permutations with identical items?
For multiset arrangements divide by repeated-item factorials: n!/(a!b!…). MISSISSIPPI arrangements = 11!/(1!4!4!2!) = 34,650.
How large can n be before overflow?
JavaScript doubles hold factorials exactly to 18! and finitely to 170!. This calculator shows exact integers below 1e15 and scientific notation beyond.
What is the stars-and-bars method?
The with-repetition combination formula C(n+r−1,r): distribute r identical picks among n types. Choosing 4 scoops from 8 flavors gives C(11,4) = 330.

Related Calculators

Explore more calculators related to this topic.

Related Guides

Deepen your understanding with these educational resources.

Glossary

Technical terms used in mortgage calculations explained in plain language.

Permutation
Ordered arrangement; P(n,r).
Combination
Unordered selection; C(n,r).
Factorial
n! = product 1…n; 0! = 1.
nPr
Permutation count notation.
nCr
Combination count notation (“n choose r”).
Repetition
Whether picks may reuse items.
Multiplication principle
Chain choice counts by multiplying.
Stars and bars
Bijection counting multisets as C(n+r−1,r).
Symmetry
C(n,r) = C(n,n−r).
Sample space
Set of all counted outcomes.

Authoritative References

Trusted sources and standards referenced by this calculator.

Applicable Standards

NCTM data-analysis standards for school mathematics

Was This Calculator Helpful?

Page Information

Last Updated:

2026-08-07

Version:

2.0.0

License:

Free to use for educational and professional purposes.