How to Calculate Permutations and Combinations - Complete Guide
Learn how to calculate permutations and combinations with clear formulas and examples. Understand when order matters, factorials, and real-world counting problems.
Counting Principles
Before diving into permutations and combinations, it helps to understand two fundamental counting principles. The multiplication principle states that if one task can be done in m ways and a second independent task can be done in n ways, then the two tasks together can be done in m x n ways. For example, if you have 5 shirts and 3 pants, you can create 5 x 3 = 15 outfits. The addition principle says that if one event can occur in m ways and a mutually exclusive event can occur in n ways, the total is m + n. These principles form the foundation for all counting formulas, including permutations and combinations.
What Is a Factorial?
The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 to n. So 5! = 5 x 4 x 3 x 2 x 1 = 120. By convention, 0! = 1. Factorials grow extremely fast: 10! = 3,628,800 and 20! = approximately 2.43 x 10¹⁸. Factorials appear in the formulas for both permutations and combinations because they represent the total number of ways to arrange n distinct objects. Understanding factorials is essential for combinatorics, as they simplify the notation and calculation of counting problems. Many calculators have a dedicated factorial button, and programming languages provide factorial functions.
Permutations: When Order Matters
A permutation is an arrangement of objects where the order matters. The number of ways to arrange r objects chosen from n distinct objects is given by P(n, r) = n! / (n - r)!. For example, the number of ways to award gold, silver, and bronze medals to 3 of 10 athletes is P(10, 3) = 10! / 7! = 10 x 9 x 8 = 720. Each arrangement is counted separately: giving gold to Alice and silver to Bob is different from giving gold to Bob and silver to Alice. When r = n (arranging all objects), the formula simplifies to n!. For instance, the number of ways to arrange 6 books on a shelf is 6! = 720.
Combinations: When Order Does Not Matter
A combination is a selection of objects where the order does not matter. The number of ways to choose r objects from n distinct objects is C(n, r) = n! / (r! x (n - r)!), also written as "n choose r." For example, the number of ways to choose a committee of 3 people from a group of 10 is C(10, 3) = 10! / (3! x 7!) = 720 / 6 = 120. The difference from permutations is the division by r!, which accounts for the fact that each group of r objects can be internally rearranged in r! ways, all of which count as the same combination. Choosing {Alice, Bob, Carol} is the same committee regardless of the order listed.
Permutations vs. Combinations: How to Tell the Difference
The key question is: does the order of selection matter? If rearranging the chosen items produces a different outcome, use permutations. If rearranging produces the same outcome, use combinations. Rankings, sequences, passwords, and arrangements are permutation problems. Committees, teams, groups, and collections are combination problems. A helpful test: if you would describe the result as a "group" or "set," it is a combination; if you would describe it as a "sequence" or "arrangement," it is a permutation. For example, selecting 5 lottery numbers from 49 is a combination (the order they are drawn does not matter for the jackpot), but assigning 5 tasks to 5 employees in a specific order is a permutation.
Permutations with Repetition
When repetition is allowed, the formulas change. If you are creating an arrangement of r items chosen from n types where each type can be used multiple times, the number of arrangements is n^r. For example, a 4-digit PIN where each digit can be 0-9 has 10⁴ = 10,000 possibilities. Another type of permutation with repetition arises when arranging objects where some are identical. The number of distinct arrangements of n objects where there are n₁ of one type, n₂ of another, and so on is n! / (n₁! x n₂! x ... x nₖ!). For instance, the number of distinct arrangements of the letters in "MISSISSIPPI" is 11! / (1! x 4! x 4! x 2!) = 34,650.
Combinations with Repetition
Combinations with repetition (also called multisets) count the number of ways to choose r items from n types when repetition is allowed and order does not matter. The formula is C(n + r - 1, r) = (n + r - 1)! / (r! x (n - 1)!). For example, the number of ways to choose 3 scoops of ice cream from 5 flavors (where you can repeat flavors) is C(5 + 3 - 1, 3) = C(7, 3) = 35. This scenario is often modeled with the "stars and bars" technique, where you distribute r identical items into n distinct categories. This type of problem appears in distributing resources, counting polynomial terms, and many optimization contexts.
Applications and Problem-Solving Tips
Permutations and combinations are used extensively in probability, statistics, computer science, and everyday decision-making. In probability, the number of favorable outcomes and total outcomes are often computed using these formulas. In genetics, combinations determine how alleles can pair during reproduction. In computer science, combinations arise in algorithm analysis and optimization. When solving problems, start by identifying the total number of objects (n), the number being selected (r), whether order matters, and whether repetition is allowed. Draw a decision tree or list small cases to verify your formula. Many complex problems can be broken into simpler sub-problems using the multiplication principle combined with permutations and combinations.
Try These Calculators
Put what you learned into practice with these free calculators.
Related Guides
How to Calculate Probability - Complete Guide
Learn the fundamentals of probability including basic probability, compound events, conditional probability, Bayes' theorem, and expected value with worked examples.
Understanding Prime Numbers - Complete Guide
Learn what prime numbers are, how to identify them, prime factorization, the Sieve of Eratosthenes, and why primes matter in cryptography and mathematics.
Understanding Logarithms - Complete Guide
Learn what logarithms are, how they work, and how to use them. Covers log rules, common and natural logarithms, change of base, and real-world applications.