Utilia

Permutation and Combination Calculator

Calculate permutations (nPr), combinations (nCr), factorials, repetitions and anagram counts exactly, with step-by-step formulas and a list of the cases.

Whole numbers from 0 to 10,000.

Result

–

Step by step

List the cases

Separate the items with commas or spaces: n is their number and r is taken from the field above. At most 50 items and r ≤ 20; the first 500 cases are listed.

    How to use the permutation and combination calculator

    1. In What to count, choose the kind of count: Permutations nPr (order matters), Combinations nCr (order doesn’t matter), Permutations with repetition (n^r), Combinations with repetition, Factorial n!, Permutations of a multiset (repeated items) or Pascal’s triangle.
    2. Enter the Total number of items (n) and, when asked, the Items chosen (r). For a multiset, type a word such as MISSISSIPPI or the sizes of the groups of identical items (3 2 1) in Word or group sizes.
    3. The result appears as you type; Calculate does the same, Clear empties the fields and Copy copies the result with its notation, for example C(10, 3) = 120.
    4. Step by step shows the formula, the formula with your numbers, the simplified product and the final value.
    5. Open List the cases, type your Items (for example a, b, c, d) and press List to see the actual arrangements or groups. The first 500 cases are shown.

    Every result is an exact whole number, computed with arbitrary-precision integers. n and r can go up to 10,000: 10,000! has 35,660 digits and is written out in full, together with an approximation in scientific notation and its number of digits.

    Which formula should I use?

    Two questions decide it: does the order matter, and can an item be used more than once?

    Situation Order matters Formula Example
    No repetition yes P(n, r) = n! / (n − r)! podium of 3 among 10 runners: 720
    No repetition no C(n, r) = n! / (r! × (n − r)!) 6 numbers out of 49: 13,983,816
    Repetition allowed yes n^r 4-digit PIN: 10⁴ = 10,000
    Repetition allowed no C(n + r − 1, r) 3 scoops from 5 flavours: 35
    All items, all different yes n! order 5 books: 120
    All items, some identical yes n! / (n₁! × n₂! × … × nₖ!) anagrams of MISSISSIPPI: 34,650

    A permutation is an ordered selection: ABC and CAB are different. A combination is a set: {A, B, C} is the same group whatever the order. That is why C(n, r) = P(n, r) / r!: each group of r items can be ordered in r! ways.

    Pascal’s triangle

    Each number of Pascal’s triangle is the sum of the two numbers above it: C(n, k) = C(n − 1, k − 1) + C(n − 1, k). Row n lists C(n, 0), C(n, 1), …, C(n, n), the coefficients of (a + b)ⁿ, and its sum is 2ⁿ, the number of subsets of a set of n items. The calculator draws the whole triangle up to row 20 and shows a single row up to row 200.

    Tips

    • The calculator uses the symmetry C(n, r) = C(n, n − r) to keep the multiplication short: C(100, 97) is computed as C(100, 3).
    • 0! = 1 by definition, so C(n, 0) = C(n, n) = 1 and P(n, 0) = 1.
    • With repetition, r can be larger than n (a 6-character code from 2 symbols); without repetition, r must not exceed n.

    Frequently asked questions

    What is the difference between nPr and nCr?

    nPr counts ordered arrangements and nCr counts unordered groups. Choosing a president, a secretary and a treasurer from 10 people is P(10, 3) = 720; choosing a committee of 3 is C(10, 3) = 120, six times fewer because each committee can be ordered in 3! = 6 ways.

    How do I count the anagrams of a word?

    Choose Permutations of a multiset (repeated items) and type the word. The letters are counted without regard to capitals, and the result is n! divided by the factorial of each letter’s count. LETTER gives 6! / (2! × 2!) = 180.

    Why is the list limited?

    The number of cases grows extremely fast: 10 items already have 3,628,800 orderings. The list shows at most 500 cases, from up to 50 items with r up to 20, and says how many there are in total.

    How big can the numbers be?

    n and r go up to 10,000. The result is always exact; above 15 digits an approximation such as 9.33262154 × 10¹⁵⁷ (for 100!) and the digit count are shown as well.

    How do I compute lottery odds?

    Use combinations: a 6/49 lottery has C(49, 6) = 13,983,816 possible tickets, so a single ticket has a 1 in 13,983,816 chance of matching all six numbers.