Permutation & Combination Calculator

Enter n and r to compute nPr (permutations) and nCr (combinations) with formulas and step-by-step working.

nPr  ·  nCr
Enter values for n and r above to calculate nPr and nCr.

Permutation vs Combination

Permutations and combinations both count ways to select r items from a set of n distinct items. The key difference is whether order matters. In a permutation, the arrangement counts (ABC ≠ BCA). In a combination, only the group matters (ABC = BCA).

nPr = n! / (n − r)!   ·   nCr = n! / (r!·(n − r)!)
Permutation (nPr)

Order matters. Use for arrangements, rankings, passwords, seating, and positions like president/secretary. nPr is always ≥ nCr.

Combination (nCr)

Order does not matter. Use for selecting a team, a committee, a hand of cards, or a subset where position is irrelevant.

Relationship

nPr = nCr × r!. Each combination of r items can be arranged in r! different orders, giving that many permutations.

Worked Example

Suppose a club has n = 5 members and you want to choose r = 2 of them.

5P2 (order matters)

5P2 = 5! / 3! = 5 × 4 = 20. There are 20 ways to pick a president and a vice-president from 5 people.

5C2 (order ignored)

5C2 = 5! / (2!·3!) = (5 × 4) / (2 × 1) = 10. There are 10 ways to pick a 2-person committee from 5 people.

Check

5P2 = 5C2 × 2! = 10 × 2 = 20. The permutation count is the combination count times r!.

Frequently asked questions

What is the difference between nPr and nCr?

nPr (permutations) counts ordered arrangements — the order of selection matters, so ABC and CBA are different. nCr (combinations) counts unordered selections — only which items are chosen matters, so ABC and CBA are the same group. nPr = nCr × r!, which means permutations are always greater than or equal to combinations.

Why must r be less than or equal to n?

You cannot choose more items than are available. If r > n, the term (n − r)! involves the factorial of a negative number, which is undefined, and both nPr and nCr equal 0 because no valid selection exists. This calculator requires r ≤ n with both being non-negative whole numbers.

What is nCr when r = 0 or r = n?

nC0 = 1 (there is exactly one way to choose nothing — the empty set) and nCn = 1 (one way to choose everything). Similarly nP0 = 1 and nPn = n! (all arrangements of all items). These boundary cases follow from the convention that 0! = 1.

How do you avoid overflow when n is large?

Instead of computing the full factorial n!, this tool computes nPr iteratively as n × (n−1) × ... × (n−r+1), which has only r terms. nCr uses the multiplicative formula, dividing as it multiplies to keep intermediate values small. This handles moderate n without overflowing for the common range of exam problems.

Where are permutations and combinations used?

They appear in probability, statistics, lottery odds, password strength, card games, scheduling, and combinatorics problems on exams like JEE, NEET, GMAT, and CAT. Combinations are used for selecting teams or lottery numbers; permutations for arrangements, rankings, and ordered sequences.