Skip to content
CornerTools

Permutation and Combination Calculator

nCr and nPr, with or without repetition, word arrangements and circular orders, exact for big numbers, and every outcome listed.

Calculate
Repetition
Permutations, nPr (order matters)

720

Combinations, nCr (order does not matter)

120

Count how many ways there are to choose or arrange things: nPr when order matters, nCr when it does not, each with or without repetition. Further modes count the distinct arrangements of a word with repeated letters, orders around a circle, and list every outcome for a small set of items.

Every result is exact, however large: n and r go up to 10,000, and 10,000! has 35,660 digits.

How to use it

nPr and nCr takes n, the items to choose from, and r, the items chosen, from 0 to 10,000. With repetition allowed, an item can be chosen more than once; results are capped at 40,000 digits. Results longer than 30 digits show in scientific form with the digit count, and the copy button copies every digit.

Word arrangements counts the letters of a word or phrase, ignoring spaces and punctuation and naming what it ignored. Upper and lower case count as the same letter. Letters are counted as written units, so an accented é, or a Devanagari consonant with its vowel sign, is one letter.

Circular counts orders around a round table, and with Necklace on, treats an order and its mirror image as one. List them takes up to 100 items and lists every combination or permutation of the size chosen, in the order the items were typed, up to 10,000 rows. Repeated items are listed as typed, so their outcomes repeat too.

The formulas

A permutation is an ordered selection: ABC and CBA are different. There are n choices for the first place, n − 1 for the second, and so on for r places. A combination ignores order, and each selection of r items can be ordered in r! ways, so nCr is nPr divided by r!.

With repetition, each of the r places can take any of n items, so there are nʳ ordered selections. Unordered selections with repetition, such as scoops of ice cream from n flavours, are counted as C(n + r − 1, r): line up the r choices and n − 1 dividers between flavours, and choose where the dividers go.

A word with repeated letters has fewer distinct orders, because swapping two copies of one letter changes nothing: divide n! by the factorial of each letter's count. Around a circle, one item can be fixed in place, since turning the table changes no one's neighbours, leaving (n − 1)! orders.

nPr = n! ÷ (n − r)!
nCr = n! ÷ (r! × (n − r)!)
With repetition: nʳ ordered, C(n + r − 1, r) unordered
Word: n! ÷ (k₁! × k₂! × …)
Circle: (n − 1)!; necklace: (n − 1)! ÷ 2

Examples

A lottery: 6 numbers from 49

Order does not matter in a draw, so the count is 49C6: 13,983,816 possible tickets.

  1. nCr = nPr ÷ r!: each selection of r was counted once for every order. 49C6 = 10,068,347,520 ÷ 6! = 10,068,347,520 ÷ 720 = 13,983,816

A 4-digit PIN

Each of 4 places takes any of 10 digits, repeats allowed and order mattering: n = 10, r = 4, repetition Allowed gives 10,000 PINs.

MISSISSIPPI

Under Word arrangements, MISSISSIPPI has 34,650 distinct orders of its letters:

  1. 11 letters can be ordered in 11! ways. 11! = 39,916,800
  2. Swapping copies of the same letter gives the same word, so divide by the factorial of each letter's count. 39,916,800 ÷ (4! × 4! × 2!) = 39,916,800 ÷ 1,152 = 34,650

Six people at a round table

Under Circular with 6 items, there are 120 seatings, counting only who sits next to whom.

Frequently asked questions

Ask whether swapping two chosen items gives a different outcome. Picking a president and a secretary: yes, so count permutations. Picking two people for a committee: no, so count combinations. A "combination lock" is, strictly, a permutation lock, since 1-2-3 and 3-2-1 differ.
Choosing the r items to take is the same as choosing the n − r items to leave: 10C3 and 10C7 are both 120.

See also