Permutation & Combination Calculator

Enter n (total items) and r (items chosen) to calculate P(n,r) and C(n,r) — with complete step-by-step workings, formulas, and explanations.

FBISE CBSE IGCSE O Levels A Levels IB

Enter Your Values

Must be a non-negative integer (0 – 170).
Must be a non-negative integer ≤ n.

Understanding Permutations & Combinations

Permutation — Order Matters

A permutation is an arrangement of items where the order matters. Choosing A then B is different from choosing B then A.

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

Example: How many ways can 3 students be chosen as President, Vice-President, and Secretary from a class of 10?

P(10, 3) = 10! / (10−3)! = 10! / 7! = 10 × 9 × 8 = 720

Each arrangement is a different outcome because the roles (positions) are distinct.

Combination — Order Doesn't Matter

A combination is a selection of items where order does not matter. Choosing {A, B, C} is the same as {C, B, A}.

C(n, r) = n! / [r! × (n − r)!]

Example: How many ways can a committee of 3 be chosen from 10 students?

C(10, 3) = 10! / (3! × 7!) = 720 / 6 = 120

Notice C(n,r) = P(n,r) / r! — combinations are always fewer than or equal to permutations because we divide out the r! repeated orderings.

Factorials

The factorial of a non-negative integer n (written n!) is the product of all positive integers up to n.

n! = n × (n−1) × (n−2) × … × 2 × 1

Key values:

n n!
0 1 (by definition)
1 1
2 2
3 6
4 24
5 120
6 720
10 3,628,800

Factorials grow very rapidly. This calculator supports up to n = 170 (the largest value JavaScript can represent precisely as a floating-point number).

When to Use Permutation vs Combination?

Situation Use Reason
Arranging books on a shelf Permutation Position/order matters
Electing President, VP, Secretary Permutation Roles are distinct
PIN / password digits Permutation 1234 ≠ 4321
Choosing a committee Combination Members are interchangeable
Selecting lottery numbers Combination Order of draw doesn't matter
Picking toppings on a pizza Combination Set of toppings, not sequence

Frequently Asked Questions

P(n,r) counts arrangements where order matters (e.g. 1st, 2nd, 3rd place). C(n,r) counts selections where order does not matter (e.g. a committee). C(n,r) = P(n,r) ÷ r!, because each combination of r items can be arranged in r! ways.
By convention and mathematical consistency. There is exactly one way to arrange zero objects (doing nothing). Also, defining 0! = 1 makes the factorial formula work for edge cases like P(n, 0) = 1 and C(n, 0) = 1.
Up to n = 170. Beyond that, n! exceeds JavaScript's maximum safe floating-point number (≈ 1.8 × 10³⁰⁸) and results become Infinity. For larger values you would need arbitrary-precision arithmetic.
No. You cannot choose more items than exist. If r > n, both P(n,r) and C(n,r) are 0 (or undefined), because (n − r)! would involve a negative factorial.