Skip to Content
Permutation and Combination Calculator — Fast, Accurate & Free

Calculator

Non-negative integer. Represents the size of the set.

Non-negative integer. Represents how many items you choose.

Permutations (nPr)

Formula: —

Combinations (nCr)

Formula: —

Notes

Enter n and r, then choose repetition options if needed.
Tip: Without repetition, r must be ≤ n. With repetition, r can exceed n. All computations use exact BigInt arithmetic for accuracy.

Permutations and combinations: A complete guide

Permutations and combinations are the backbone of counting and probability. They help you answer “How many ways?” in contexts like passwords, schedules, teams, lottery picks, and sampling. This guide explains both concepts clearly and shows when to use each, with and without repetition.

What are permutations?

Permutations count arrangements where order matters. Choosing positions for items or ranking contestants are classic permutation problems. For selections without repetition, the formula is \(nP_r=\frac{n!}{(n-r)!}\). With repetition allowed, each position can be any of the \(n\) items, so permutations become \(n^r\).

What are combinations?

Combinations count selections where order does not matter. Forming a committee or selecting a set of products are combination scenarios. Without repetition, the formula is \(nC_r=\frac{n!}{r!\,(n-r)!}\). With repetition, combinations become \(C(n+r-1,r)\), also written as \(\binom{n+r-1}{r}\).

Choosing the right model

  • Order matters: Use permutations (rankings, seatings, codes with position significance).
  • Order doesn’t matter: Use combinations (teams, sets, sample selections).
  • Repetition allowed: Items can be reused (e.g., digits in a PIN, sampling with replacement).
  • No repetition: Items cannot repeat (e.g., unique badges, sampling without replacement).

Common pitfalls and best practices

  • Validate constraints: Without repetition, ensure \(r \le n\).
  • Avoid decimal inputs: \(n\) and \(r\) must be non-negative integers.
  • Match context: Decide if order and repetition apply before choosing a formula.
  • Show working: Document formulas in reports for transparency.

Real-world applications

Use permutations for arranging shifts, route planning with distinct stops, and designing unique IDs. Use combinations for sample sizes, lottery odds, choosing features, and committee selection. In data science, these counts inform model complexity, feature selection, and probability calculations.

Worked examples

Example 1 (Permutation without repetition): Arrange 3 out of 5 books on a shelf: \(5P_3=\frac{5!}{2!}=60\).
Example 2 (Combination without repetition): Choose 3 committee members from 10: \(10C_3=\frac{10!}{3!\,7!}=120\).
Example 3 (Permutation with repetition): 4-letter code from 26 letters with repetition: \(26^4=456{,}976\).
Example 4 (Combination with repetition): Choose 4 scoops from 6 flavors with repetition: \(C(6+4-1,4)=C(9,4)=126\).

Frequently asked questions

HOW TO decide if order matters?

If changing the order changes the outcome’s identity (e.g., ABC ≠ BAC), order matters → use permutations. Otherwise, use combinations.

HOW TO enable repetition correctly?

Turn on permutation repetition for codes/passwords where items can repeat. Turn on combination repetition for selections with replacement (e.g., scoops, samples).

HOW TO compute nCr efficiently?

This tool uses exact integer cancellation with BigInt to avoid overflow and floating-point rounding, ensuring precise results even for large values.

HOW TO interpret large outputs?

Large counts indicate many possibilities. Use scientific notation or copy the exact integer for documentation and analysis.

HOW TO fix invalid inputs?

Ensure n and r are non-negative integers. If repetition is off, set r ≤ n. Adjust options and re-calculate.

```