Combination Calculator (nCr and nPr)

Combinations and permutations of n items taken r at a time, with or without repetition, exact for large numbers.

C(n, r) = n! ÷ (r!(n − r)!) and P(n, r) = n! ÷ (n − r)!. Choosing 3 of 10 people: C(10, 3) = 120 groups, or P(10, 3) = 720 ordered line-ups.

Free, runs in your browser. Nothing you enter is uploaded.

How to use it

  1. Enter the total number of items n.
  2. Enter how many are chosen, r.
  3. Read nCr (order doesn't matter) and nPr (order matters), with and without repetition.

What you enter

What you get

Formula

C(n,r) = n!/(r!(n−r)!) | P(n,r) = n!/(n−r)! | with repetition: C(n+r−1, r) and nʳ

Worked example: pizza toppings

Input: Choose 3 toppings from 10

Result: 120 combinations; 220 if a topping can be doubled

Order of toppings doesn't matter, so this is a combination.

Questions

What is the difference between a combination and a permutation?

In a combination the order doesn't matter (a committee); in a permutation it does (a president, secretary and treasurer). P(n, r) = C(n, r) × r!.

How many combinations of 4 numbers are there?

A 4-digit code with digits 0–9 and repeats allowed has 10⁴ = 10,000 permutations. Choosing 4 different digits regardless of order gives C(10, 4) = 210.

What is a combination with repetition?

Choosing r items from n types where you can pick the same type more than once, like scoops of ice cream: C(n + r − 1, r).

What are the odds of winning a 6/49 lottery?

C(49, 6) = 13,983,816, so one ticket has a 1 in 13,983,816 chance.

Related reading

More Statistics

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.