standarddeviationcalculator.net SD Calculator

Permutation and combination calculator

Share this page

Favorites

    No favorites yet. Press Favorite on any page to keep it here.

    Methodology

    Count selections and arrangements exactly. Pick what you are counting, enter n and r (or a word), and the calculator gives the count, the other three standard counts for the same n and r, and the formula with your numbers substituted.

    For a full circle, set r equal to n.

    10C3 = C(10, 3) 120
    nPr (order matters)720
    nCr (order does not matter)120
    nʳ (order matters, repeats)1,000
    C(n + r − 1, r) (repeats)220
    110¹10²10³120nCr720nPr1,000nʳ (repeats)220C(n+r−1, r)count (log₁₀ scale)

    Bar heights are on a log scale, so equal steps up the axis are equal multiples (powers of ten), not equal amounts.

    Which formula? (the one used is in bold)
    Order matters?Repeats allowed?FormulaName
    YesNon! / (n − r)!Permutation nPr
    NoNon! / (r!(n − r)!)Combination nCr
    YesYesnʳPermutation with repetition
    NoYes(n + r − 1)! / (r!(n − 1)!)Combination with repetition
    All n arranged, some alike–n! / (k₁! k₂! … kₘ!)Multiset permutation
    Around a circleNo(n − 1)!, or ÷ 2 if it can flipCircular permutation
    Show the working, step by step
    1. Combinations count selections where order does not matter.

      C(n, r) = n! / (r! (n − r)!) = 10! / (3! × 7!)

    2. Cancel the larger factorial in the denominator, leaving 3 factors on top and 3! underneath.

      = (10 × 9 × 8) / (3 × 2 × 1)

    3. Work it out.

      = 720 / 6 = 120

    4. Each combination can be ordered in 3! ways, which links the two counts.

      nPr = nCr × r! = 120 × 6 = 720

    Permutation and combination formulas

    nPr = n! / (n − r)! order matters, no repeats nCr = n! / (r! (n − r)!) order does not matter, no repeats nʳ order matters, repeats allowed C(n + r − 1, r) order does not matter, repeats allowed n! / (k₁! k₂! … kₘ!) arrange n items, kᵢ of them alike (n − 1)! arrange n items round a circle

    Two questions pick the formula. Does the order of the chosen items matter? Can the same item be chosen more than once? A PIN is ordered with repeats (10⁴ = 10,000 four-digit PINs). A lottery draw is unordered without repeats (49C6 = 13,983,816). A bag of 3 doughnuts from 10 flavours is unordered with repeats (C(12, 3) = 220).

    Permutation and combination: a worked example

    The calculator opens with n = 10 and r = 3.

    1. Combinations: 10C3 = 10! / (3! × 7!). Cancel 7! from top and bottom to leave (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120.
    2. Permutations: 10P3 = 10 × 9 × 8 = 720. Each of the 120 combinations can be ordered in 3! = 6 ways, and 120 × 6 = 720.
    3. With repetition, ordered: 10³ = 1,000.
    4. With repetition, unordered: C(10 + 3 − 1, 3) = C(12, 3) = 220.

    Cancelling before multiplying is the way to do nCr by hand. Never work out 10! in full. Only r factors survive on top, and r! stays underneath.

    For one kind of count at a time there are separate pages, the combination calculator also lists every selection when n is small, and the permutation calculator covers permutations with repetition and arrangements of a multiset.

    Arrangements of a word

    When some of the items are identical, divide n! by the factorial of each repeat count. For MISSISSIPPI: 11! ÷ (1! × 4! × 4! × 2!) = 39,916,800 ÷ 1,152 = 34,650. The same rule counts arrangements of coloured balls, or of the letters in BANANA (6! ÷ (3! × 2! × 1!) = 60).

    Circular permutations

    Rotations of a circle count as the same arrangement, so divide the number of lines by the number of seats. (n − 1)! for n people round a table, or P(n, r) ÷ r when only r of the n are seated. If the circle can be turned over, as with a necklace or a keyring, a clockwise order and its mirror image are also the same, so halve the answer (for 3 or more items).

    Common mistakes

    • Using nPr when order does not matter. A team of 3 picked from 10 is 120 teams, not 720.
    • Choosing more than there are without repeats. 5 from 3 without repetition is impossible, and nCr is 0. With repetition it is allowed.
    • Forgetting the repeated letters. 11! counts each MISSISSIPPI arrangement 1,152 times.
    • Treating a round table like a row. 8 people in a row can sit in 40,320 ways, but round a table only 5,040.
    Permutation and combination calculator: the worked example on this page, with its result and chart
    Permutation and combination calculator: the worked example above, at a glance.

    Common questions

    What is the difference between a permutation and a combination?

    In a permutation the order matters. In a combination it does not. Choosing a president, secretary and treasurer from 10 people is a permutation, 10P3 = 720, because the same three people in different jobs is a different outcome. Choosing a committee of 3 from 10 is a combination, 10C3 = 120. Each committee can be put in 3! = 6 orders, and 720 ÷ 6 = 120.

    How many ways can the letters of MISSISSIPPI be arranged?

    34,650. The word has 11 letters. One M, four I, four S and two P. If they were all different there would be 11! = 39,916,800 orders, but swapping identical letters changes nothing, so divide by 1! × 4! × 4! × 2! = 1,152. 39,916,800 ÷ 1,152 = 34,650.

    How many ways can 8 people sit around a round table?

    (8 − 1)! = 5,040. In a row it would be 8! = 40,320, but rotating everyone one seat round gives the same seating, and each seating has 8 rotations. If the arrangement can also be turned over, as with beads on a necklace, mirror images count as the same too, giving 5,040 ÷ 2 = 2,520.

    What is nCr when r is 0 or equal to n?

    Both are 1. There is exactly one way to choose nothing and one way to choose everything. That is why 0! is defined as 1. nC0 = n! ÷ (0! × n!) = 1. The formula is also symmetric, nCr = nC(n − r), because choosing r items to take is the same as choosing n − r to leave.

    How many 5-card poker hands are there?

    52C5 = 2,598,960. Order does not matter in a hand, and a card cannot be dealt twice, so it is a combination without repetition. 52 × 51 × 50 × 49 × 48 ÷ (5 × 4 × 3 × 2 × 1).

    Why does the calculator show exact results for huge numbers?

    Factorials grow faster than ordinary floating-point numbers can hold exactly. 23! already has more digits than a double can store without rounding. The calculator uses whole-number (BigInt) arithmetic, so 1000C500 comes out with all 300 of its digits, and the headline shows a rounded scientific form of the same number.