combinatorics calculator

Interactive Combinatorics Calculator

Compute factorials, combinations, and permutations instantly using exact integer math.

Formula: C(n, r) = n! / (r!(n-r)!)

What Is Combinatorics?

Combinatorics is the branch of mathematics focused on counting and arranging objects. It answers questions like: “How many ways can this happen?” If you have ever chosen a team, created a password policy, arranged seating, or estimated odds, you have touched combinatorics.

The key idea is simple: count possible outcomes accurately. The difficult part is choosing the right formula for your scenario. This calculator helps you do exactly that.

Core Formulas This Calculator Uses

1) Factorial

Factorial is the product of all positive integers up to n.

  • n! = n × (n−1) × (n−2) × ... × 1
  • By definition, 0! = 1

2) Combinations (No Repetition)

Use this when order does not matter and each item can be used once.

  • C(n, r) = n! / (r!(n−r)!)
  • Example: choosing 3 committee members from 10 people

3) Permutations (No Repetition)

Use this when order matters and each item can be used once.

  • P(n, r) = n! / (n−r)!
  • Example: awarding gold, silver, bronze from 10 finalists

4) Combinations with Repetition

Use this when order does not matter and selections can repeat.

  • C(n+r−1, r)
  • Example: choosing 4 donuts from 6 flavors where repeats are allowed

5) Permutations with Repetition

Use this when order matters and each draw can repeat from the same pool.

  • nr
  • Example: number of 6-digit PIN codes from digits 0–9

How to Use the Calculator

  • Select a calculation type from the dropdown.
  • Enter n (the size of your set).
  • Enter r (how many picks/positions), unless using factorial.
  • Click Calculate to get the exact result, digit count, and scientific notation for large values.

The calculator uses exact integer arithmetic under the hood, so results are precise even for very large outputs.

Worked Examples

Example A: Committee Selection

You need a committee of 4 people from 12 candidates. Order does not matter, and no one can be picked twice. Use combinations: C(12, 4) = 495.

Example B: Race Podium Outcomes

From 10 runners, how many possible gold-silver-bronze outcomes exist? Order matters, no repeats, so use permutations: P(10, 3) = 720.

Example C: Ice Cream Scoop Choices

You pick 3 scoops from 5 flavors, and repeats are allowed (like vanilla-vanilla-chocolate). Order does not matter, so use combinations with repetition: C(5+3−1, 3) = C(7, 3) = 35.

Where Combinatorics Appears in Real Life

  • Probability & statistics: lotteries, card games, sampling.
  • Computer science: algorithm complexity, hashing, brute-force search spaces.
  • Cybersecurity: password and PIN keyspace calculations.
  • Operations research: scheduling and assignment configurations.
  • Biology: sequence arrangements and genetic combinations.

Common Mistakes to Avoid

  • Using permutations when order does not matter (or vice versa).
  • Forgetting repetition rules in the problem statement.
  • Entering non-integer values for n or r.
  • Trying to use r > n in “without repetition” scenarios.

Quick Rule of Thumb

If swapping two chosen items creates a new outcome, order matters (use permutation). If swapping does not change the outcome, order does not matter (use combination). Then check whether repetition is allowed.

🔗 Related Calculators