free tool, no sign-up

Combination and Permutation Calculator

Calculate nCr and nPr with the canceled factorial formula. 6 choose 3 is 20, 5 choose 2 is 10, and P(5, 2) is 20 because order matters.

Order does not matter. C(n, r) = n! / (r! (n−r)!), written as a canceled product.

How many distinct items are in the set

How many are chosen. A whole number from 0 through n.

Enter n and r to see the combination.

Enter n and r to see the combination.

Examples

This combination and permutation calculator is for classwork on the combination formula and the permutation formula. Enter how many items are in the set (n) and how many are chosen (r). Combinations use C(n, r) = n! / (r!(n−r)!) and cancel before multiplying, so 6 choose 3 = (6×5×4)/(3×2×1) = 20, 5 choose 2 = 10, 4 choose 2 = 6, and 3 choose 2 = 3. Permutations keep the order, so P(5, 2) = 5×4 = 20. Repetition is not allowed, and the count is an exact whole number.

The combination formula, n choose k

A combination counts groups. Order does not matter, and the same item is not used twice. The combination formula is C(n, r) = n! / (r!(n−r)!), also written nCr or n choose r. The n choose k formula is that same statement with k in place of r. You do not need to build the full factorials. Cancel first, and multiply the shorter product. 6 choose 3 keeps the three factors counting down from 6 and divides by 3!: C(6, 3) = (6×5×4)/(3×2×1) = 20. A committee of 3 students from a group of 6 is one of those 20 groups. Writing the same three names in another order does not make a new committee.

The same canceled product gives the other small cases. 5 choose 2 = (5×4)/(2×1) = 10. 4 choose 2 = (4×3)/(2×1) = 6. 3 choose 2 = (3×2)/(2×1) = 3. Two shortcuts are worth keeping. Choosing nothing can be done in 1 way, so C(n, 0) = 1, and that includes C(0, 0) = 1. Choosing r items to keep is the same count as choosing the n−r items to leave out, so C(n, r) = C(n, n−r). That is why 3 choose 2 equals 3 choose 1, and why 6 choose 4 equals 6 choose 2, which is 15. The calculator takes this shortcut whenever n−r is smaller than r, so for 3 choose 2 it shows C(3, 2) = C(3, 1) = 3 instead of (3×2)/(2×1).

The permutation formula, and why P(5, 2) is also 20

A permutation counts arrangements. Order matters, and this calculator still does not repeat an item. The permutation formula is P(n, r) = n! / (n−r)!, which shortens to the product n×(n−1)×…×(n−r+1). P(5, 2) = 5×4 = 20. First and second place out of 5 runners is that count: 5 choices for first, then 4 left for second. Runner A then runner B is a different result from runner B then runner A. Arranging nothing can be done in 1 way, so P(n, 0) = 1. Arranging every item is n!.

6 choose 3 and P(5, 2) both equal 20 for different reasons. 6 choose 3 starts from 6×5×4 = 120, then divides by 3×2×1 because the order inside each group does not count. 120/6 = 20 unordered groups. P(5, 2) never divides by r!. It stops after two ordered choices, and 5×4 = 20 ordered pairs. The matching number is a coincidence of these two counts. For the same n and r, the permutation is the combination multiplied by r!, so P(6, 3) = 6×5×4 = 120, which is 3! times 6 choose 3.

How to tell nCr from nPr

Use combinations when swapping two chosen items does not create a new outcome. A committee, a hand of cards, or a set of toppings is nCr. 6 choose 3 = 20. Use permutations when that swap does create a new outcome. A finish order, assigned seats, or a ranking is nPr. P(5, 2) = 20 is first and second place, not an unordered pair. Words such as arrange, order, rank, and line up point to permutations. Words such as choose, select, and group point to combinations. r has to be a whole number from 0 through n, because this page does not allow the same item twice. A code that may reuse digits is a different problem, and it is not nCr or nPr.

Frequently Asked Questions

What is the n choose k formula?

The n choose k formula is C(n, k) = n! / (k!(n−k)!). It is the combination formula, also written nCr. Order does not matter, items are not repeated, and k cannot be greater than n. The practical form cancels before multiplying. 6 choose 3 = (6×5×4)/(3×2×1) = 20.

What is 6 choose 3?

6 choose 3 is 20. Multiply the three whole numbers counting down from 6, then divide by 3!: (6×5×4)/(3×2×1) = 120/6 = 20. ABC and CAB are the same group, so they are counted once.

What is 5 choose 2?

5 choose 2 is 10. C(5, 2) = (5×4)/(2×1) = 10. The same pattern gives 4 choose 2 = (4×3)/(2×1) = 6 and 3 choose 2 = (3×2)/(2×1) = 3. 3 choose 2 also equals 3 choose 1, because C(n, r) = C(n, n−r). The calculator uses that shortcut and shows C(3, 2) = C(3, 1) = 3.

What is P(5, 2)?

P(5, 2) is 20. The permutation formula keeps the falling product and does not divide by r!, so P(5, 2) = 5×4 = 20. Order matters: choosing A then B is different from choosing B then A. P(n, 0) = 1.

Why do 6 choose 3 and P(5, 2) both equal 20?

They are different counts that happen to land on 20. 6 choose 3 divides 6×5×4 by 3!, and 120/6 = 20 unordered groups. P(5, 2) is only the ordered product 5×4 = 20. One answer ignores order. The other is built from order. For the same n and r, P(n, r) = r! × C(n, r), so P(6, 3) = 120, not 20.

Related Tools