NOTACAL logo

Permutation and Combination Calculator

Permutation & Combination Calculator

Introduction

The Permutation and Combination Calculator is an essential tool for solving problems in probability, statistics, and combinatorics. These mathematical concepts are fundamental to understanding how to count and arrange items in different ways, which has applications ranging from lottery probability analysis to computer algorithm optimization.

Understanding the difference between permutations and combinations is crucial for anyone working with counting problems. The key distinction lies in whether order matters. When selecting a committee from a group of people, the order in which we select members does not matter—it is a combination. However, when creating a password or ranking contestants in a race, the specific order is important—it is a permutation.

These concepts have been studied since ancient times, with early work in combinatorics appearing in Hindu and Chinese mathematical texts. The development of probability theory in the 17th century, particularly through the work of mathematicians like Pascal and Fermat, brought renewed attention to these counting methods. Today, permutations and combinations are foundational concepts in computer science, particularly in algorithm design and analysis, where they appear in sorting algorithms, combinatorial optimization, and cryptographic applications.

The notation nPr (n permutation r) and nCr (n combination r) provides a compact way to express these calculations. Modern calculators and computers can handle large values easily, though understanding the underlying mathematics remains important for proper application and interpretation of results. This calculator provides not just the numerical answers but also detailed explanations of how the calculations work and when to apply each type of counting.

How to Use

Using the Permutation and Combination Calculator requires understanding your problem type and entering the correct values.

Step 1: Select Calculation Type

Choose between Permutation (nPr) and Combination (nCr) based on whether order matters in your specific problem. If the order of selection or arrangement is important, use permutations. If only the final set matters regardless of order, use combinations. Many common problems can be identified by key phrases: permutations appear in problems about arrangements, rankings, passwords, and schedules, while combinations appear in problems about selections, committees, and groups where order is irrelevant.

Step 2: Enter Total Items (n)

Input the total number of items available for selection or arrangement. This represents the pool from which you are choosing. For example, if you have 10 contestants in a race, n equals 10. If you are selecting 3 people for a committee from 10 total members, n equals 10.

Step 3: Enter Items to Select/Arrange (r)

Input how many items you want to arrange or select. This represents the subset size. In the race example, if you want to know how many ways to award gold, silver, and bronze among 10 runners, r equals 3. In the committee example, if you are selecting a 3-person committee from 10 people, r equals 3.

Step 4: Calculate

Click the calculate button to get your result. The calculator will display both the final answer and the formula used, helping you verify the calculation.

Interpreting Results

The result can be a very large number for even modest inputs. For example, 20P10 equals 670,442,572,800. Most calculators use scientific notation for very large results. If your result shows as infinity, this indicates the number exceeds the calculator's maximum representable value, though the mathematical concept remains valid.

Formulas and Calculations

Permutation Formula

The number of permutations (arrangements where order matters) is calculated using:

nPr=n!(nr)!nPr = \frac{n!}{(n-r)!}

Where n is the total number of items and r is the number of items to arrange. The factorial (!) represents the product of all positive integers up to that number.

Example: Arranging Letters

How many ways can you arrange 3 letters from the word COMPUTER (8 letters)?

8P3 = 8! / (8-3)! = 8! / 5! = 40320 / 120 = 336

This makes sense because for the first position you have 8 choices, for the second 7 choices, and for the third 6 choices: 8 x 7 x 6 = 336.

Combination Formula

The number of combinations (selections where order does not matter) is calculated using:

nCr=n!r!×(nr)!nCr = \frac{n!}{r! \times (n-r)!}

Alternatively, combinations can be expressed using the binomial coefficient notation:

(nr)=n!r!(nr)!\binom{n}{r} = \frac{n!}{r!(n-r)!}

Example: Selecting Committee Members

How many ways can you select a 3-person committee from 10 people?

10C3 = 10! / (3! x 7!) = 3628800 / (6 x 5040) = 3628800 / 30240 = 120

Unlike permutations, we divide by r! because the order of selection does not matter—the committee with members Alice, Bob and Charlie is the same as one with Charlie, Alice and Bob.

Factorial Fundamentals

The factorial is the foundation of both permutation and combination calculations:

n!=n×(n1)×(n2)××2×1n! = n \times (n-1) \times (n-2) \times \dots \times 2 \times 1

By definition, 0! = 1.

Factorials grow extremely quickly: 5! = 120, 10! = 3,628,800, 20! = 2,432,902,008,176,640,000. This rapid growth explains why permutation and combination results become large so quickly.

Relationship Between Permutations and Combinations

Permutations and combinations are related through the factorial formula:

nPr = nCr x r!

This relationship makes sense: every combination of r items from n can be arranged in r! different orders, giving the permutation count. This provides a useful check: nCr always equals nPr divided by r!.

Reference Table: Common Values - Permutations (nPr)

n\rr=1r=2r=3r=4r=5
11----
222---
3366--
44122424-
552060120120
6630120360720

Reference Table: Common Values - Combinations (nCr)

n\rr=1r=2r=3r=4r=5
11----
221---
3331--
44641-
55101051
661520156

Real-World Examples

Example 1: Password Creation

A website requires a 4-character password using lowercase letters (26 options per position). How many possible passwords exist?

Since order matters and repetition is allowed: 26 x 26 x 26 x 26 = 456,976 passwords. However, if we consider selecting 4 distinct letters and arranging them, we use 26P4 = 26! / (26-4)! = 358,800.

Example 2: Race Results

In a race with 8 runners, how many ways can gold, silver, and bronze be awarded?

This is a permutation because the medal matters: 8P3 = 8! / (8-3)! = 336 ways. The gold medal winner could be any of 8 runners, silver any of the remaining 7, and bronze any of the remaining 6.

Example 3: Committee Formation

A club has 15 members and needs to form a 3-person committee. How many different committees are possible?

This is a combination because the committee is an unordered set: 15C3 = 15! / (3! x 12!) = 455 committees. Unlike the race, the order in which we select committee members does not create a different committee.

Example 4: Poker Hands

In a standard 52-card deck, how many different 5-card poker hands are possible?

52C5 = 52! / (5! x 47!) = 2,598,960 possible hands. This is why poker has so many possible combinations—the enormous number of hands contributes to the game's strategic depth.

Example 5: Lottery Numbers

A lottery draws 6 numbers from 1-49. How many possible ticket combinations exist?

49C6 = 49! / (6! x 43!) = 13,983,816 possible combinations. This is why the odds of winning are approximately 1 in 14 million—a truly astronomical number of possible selections.

When to Use Permutations vs Combinations

Understanding when to use each type is essential for correct calculations.

Use Permutations When:

  • Arranging items in a specific order (rankings, sequences)
  • The problem explicitly states order matters
  • Words like arrangement, order, sequence, ranking, or schedule appear
  • Creating passwords, codes, or combinations where position matters
  • Determining finishes in a race (1st, 2nd, 3rd specifically)
  • Arranging books on a shelf or people in a line
  • Selecting officers (president, vice-president, secretary) where positions differ

Use Combinations When:

  • Selecting items without regard to order
  • The problem explicitly states order does not matter
  • Words like selection, group, committee, team, or subset appear
  • Forming groups or teams where members are equal
  • Selecting menu items, ingredients, or colors
  • Selecting items from a larger pool without regard to arrangement
  • Drawing cards from a deck where the order of drawing does not matter

A helpful test: If you can shuffle your selection and it remains the same answer, it is a combination. If shuffling changes the answer, it is a permutation. Selecting A, B, C as a committee is the same as C, A, B (combination), but finishing a race in positions A, B, C is different from C, B, A (permutation).

Limitations

Large Numbers

Permutation and combination values grow extremely quickly. Even for modest inputs like n=100, r=50, the numbers become astronomically large. While the mathematical answer is well-defined, calculators and computers may overflow or display infinity. In such cases, scientific notation is used for representation.

Repetition Constraints

The basic formulas assume no repetition—if an item is selected, it cannot be selected again. For problems allowing repetition (with replacement), modified formulas are needed: permutations with repetition equal n^r, and combinations with repetition equal (n+r-1)C(r).

Zero and Negative Values

The standard formulas require n and r to be non-negative integers with r less than or equal to n. Negative values, fractions, or non-integers do not have standard interpretations in elementary combinatorics.

Order vs Selection Context

The distinction between permutations and combinations is not always clear-cut in complex real-world problems. Determining whether a problem involves order requires careful analysis of the specific scenario. For example, selecting players for a sports team may be treated as a combination if all positions are equal, but if specific positions need to be filled, it becomes more complex.

Practical Applications

In many real-world scenarios, particularly in computer science and large-scale data analysis, we often work with approximations or logarithms of large factorial-based numbers rather than the exact values. The exact numbers may be too large to store in computer memory.

Pascal's Triangle and Combinations

Pascal's Triangle provides a visual representation of combination values. Each row corresponds to the combinations for a specific n value. The triangle starts with 1 at the top, and each number below is the sum of the two numbers above it.

The triangle reveals elegant patterns: each row is symmetric, the sum of row n equals 2^n, and the diagonals produce famous sequences like the triangular numbers and Fibonacci numbers. This geometric representation helps visualize why combinations have their specific values and provides an alternative calculation method for smaller values.

Binomial Theorem Connections

Combinations appear prominently in the binomial theorem, which expands expressions like (a + b)^n:

(a+b)n=k=0n(nk)ankbk(a + b)^n = \sum_{k=0}^{n} \binom{n}{k} a^{n-k} b^k

This connection explains why combinations are also called binomial coefficients. The coefficients in the expansion directly correspond to combination values. This theorem has applications in probability (binomial distribution), algebra, and many areas of mathematics.

Practical Tips

Estimation Without Calculator

For quick estimates, use the approximation that for large n, n! approximately equals n^n e^(-n) sqrt(2 pi n). This Stirling's approximation can help verify calculator results when working with very large factorials.

Using Symmetry

Combinations have a useful symmetry property: nCk equals nC(n-k). This means selecting 3 items from 10 has the same count as selecting 7 items from 10. Use this to simplify calculations by always choosing the smaller r value.

Breaking Down Complex Problems

Complex counting problems can often be broken into simpler cases. For example, count permutations and combinations for each distinct type of item separately, then multiply the results if the selections are independent.

Checking Answers

Always verify your answer makes sense. If counting committee members, your answer should be less than the total number of people. If counting permutations, the result should be less than n! and greater than or equal to the corresponding combination value.

Applications in Computer Science

Permutations and combinations are fundamental to many computer science applications. Sorting algorithms efficiency is often analyzed using permutation concepts. Cryptography relies on the enormous number of possible keys (often calculated using permutations). Combinatorial optimization problems, including the famous traveling salesman problem, use these concepts extensively.

Random sampling and Monte Carlo methods use combinations to determine sample sizes and probabilities. Algorithm complexity analysis frequently involves counting possible inputs or execution paths, where these formulas become essential tools.

Frequently Asked Questions

What is the difference between nPr and nCr?
Permutations (nPr) = order matters (ABC vs ACB are different). Combinations (nCr) = order does not matter (ABC and ACB are the same set).
When should I use nPr instead of nCr?
Use nPr for arrangements like rankings or passwords. Use nCr for selections like committees or lottery numbers.
What if n and r are equal?
nPr = n! (arrange all items). nCr = 1 (choosing all items is the same as picking the entire set).
What if r > n?
Both nPr and nCr equal 0 by convention. You cannot arrange or select more items than are available.
Can permutations involve repeated items?
This calculator computes nPr and nCr without repetition. For repetition, use the formula n multichoose r = C(n+r-1, r).

Last updated: May 12, 2026