Combinatorics is the mathematics of counting arrangements and selections without listing them one by one. The two questions that decide almost every basic problem are: does order matter? and can items repeat? If order matters, you are counting permutations; if it does not, you are counting combinations.

The engine behind both is the fundamental counting principle: if one choice can be made in mm ways and a second independent choice in nn ways, the pair can be made in m×nm \times n ways.

The Fundamental Counting Principle

Multiply the number of options at each independent stage. A cafe with 44 sandwiches and 33 drinks offers

4×3=124 \times 3 = 12

different meals. The principle extends to any number of stages: a 44-digit PIN where each digit can be 0099 has 10×10×10×10=104=10,00010 \times 10 \times 10 \times 10 = 10^4 = 10{,}000 possibilities, because repetition is allowed and each position is an independent choice.

When the question joins separate cases with "or" instead of stages with "and," you add instead of multiply.

Factorials: The Building Block

The factorial n!n! counts the ways to arrange nn distinct items in a row:

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

For example, 5!=1205! = 120, so five books can be ordered on a shelf in 120120 ways. By definition 0!=10! = 1, which keeps the formulas below consistent.

Permutations: When Order Matters

A permutation is an ordered arrangement. The number of ways to arrange rr items chosen from nn distinct items is:

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

Each position is filled by the counting principle: nn options for the first slot, n1n-1 for the second, and so on for rr slots. Rankings, race finishes, passwords without repeated characters, and seating orders are all permutation problems.

Combinations: When Order Does Not Matter

A combination is a selection where only membership counts. The number of ways to choose rr items from nn is:

nCr=(nr)=n!r!(nr)!{}_{n}C_{r} = \binom{n}{r} = \frac{n!}{r!\,(n-r)!}

It is the permutation count divided by r!r!, because each unordered group of rr items was counted r!r! times — once per internal ordering. Committees, pizza toppings, lottery draws, and hands of cards are combination problems.

Permutation vs Combination at a Glance

Question to ask Permutation Combination
Does order matter? Yes No
Typical wording arrange, rank, schedule, line up choose, select, pick, group
Formula n!(nr)!\dfrac{n!}{(n-r)!} n!r!(nr)!\dfrac{n!}{r!\,(n-r)!}
Example Gold, silver, bronze from 88 runners Any 33 qualifiers from 88 runners
Count for n=8n=8, r=3r=3 336336 5656

The same nn and rr give a much larger permutation count — order multiplies the possibilities by r!=6r! = 6 here.

Worked Example: Electing Club Officers (Permutation)

A club with 1010 members elects a president, a vice president, and a treasurer. No one can hold two offices. How many outcomes are there?

Order matters because the three positions are different. Using the permutation formula with n=10n = 10 and r=3r = 3:

10P3=10!7!=10×9×8=720{}_{10}P_{3} = \frac{10!}{7!} = 10 \times 9 \times 8 = 720

There are 720720 possible officer slates. Notice you never need the full value of 10!10! — the 7!7! cancels, leaving just three factors.

Worked Example: Choosing a Committee (Combination)

The same club instead forms a 33-person committee with equal roles. Now order does not matter, so divide out the 3!=63! = 6 internal orderings:

10C3=10!3!7!=10×9×86=120{}_{10}C_{3} = \frac{10!}{3!\,7!} = \frac{10 \times 9 \times 8}{6} = 120

There are 120120 possible committees. Comparing the two examples makes the core idea concrete: the only difference between 720720 and 120120 is whether the three selected people are distinguishable by role.

Common Combinatorics Mistakes

The most frequent error is using a permutation when the problem is a combination, or the reverse. Test yourself with the wording: "arrange" and "rank" signal order; "choose" and "select" usually do not.

A second mistake is forgetting repetition. Choosing rr items from nn with repetition allowed and order mattering gives nrn^r, not nPr\,{}_{n}P_{r}. A 4-character code over 2626 letters has 26426^4 options, far more than 26!22!\frac{26!}{22!}.

Students also double count when cases overlap. If you count "hands with at least one ace" by picking an ace first and then any four cards, hands with two aces get counted twice; the complement method avoids this.

Finally, adding when you should multiply: stages connected by "and then" multiply, while mutually exclusive cases connected by "or" add.

Where Combinatorics Is Used

Counting is the backbone of probability: the chance of an event with equally likely outcomes is favorable count over total count, and both counts usually come from permutations or combinations. The values (nr)\binom{n}{r} are exactly the coefficients in the binomial theorem, they fill Pascal's triangle, and they appear in statistics through the binomial distribution. Beyond math class, combinatorics drives password security estimates, tournament scheduling, network design, and algorithm analysis.

Check Your Understanding

Decide before computing: a librarian picks 44 of 1212 novels to display in a row in the front window. Is that a permutation, a combination, or both stages combined? Work it out, then verify your reasoning step by step with a math solver if the two-stage answer — choose, then arrange — does not land at 12!8!=11,880\frac{12!}{8!} = 11{,}880.

Frequently Asked Questions

What is the difference between a permutation and a combination?
A permutation is an ordered arrangement, while a combination is a selection where order does not matter. Electing a president and vice president from a group is a permutation because the roles differ. Choosing two equal committee members is a combination. With the same group sizes, the permutation count is always larger, by a factor of r factorial.
What does the exclamation mark mean in combinatorics?
The exclamation mark denotes a factorial. The expression n factorial means the product of all whole numbers from n down to 1, so 5 factorial equals 120. It counts the ways to arrange n distinct items in a row. By convention, 0 factorial equals 1, which keeps the permutation and combination formulas consistent in edge cases.
When do you multiply and when do you add in counting problems?
Multiply when choices happen in stages connected by the idea of and then, such as picking a sandwich and then a drink. Add when the problem splits into separate cases connected by or that cannot happen together, such as choosing either a 2-topping or a 3-topping pizza. Most errors come from adding stages or multiplying overlapping cases.
How do you know if repetition is allowed in a counting problem?
Check whether the same item can be used twice. PIN codes and passwords usually allow repeated symbols, giving n to the power r outcomes. Seating people, ranking runners, or dealing cards cannot repeat items, so you use permutation or combination formulas instead. If the problem is silent, physical objects typically cannot repeat while symbols typically can.
What is combinatorics used for in real life?
Combinatorics underlies probability calculations, since most chances are a favorable count divided by a total count. It also estimates password strength, counts lottery odds, schedules tournaments, designs experiments in statistics, and analyzes how long algorithms take. The binomial coefficients from combinations also appear in Pascal's triangle and the binomial theorem.

Need help with a problem?

Upload your question and get a verified, step-by-step solution in seconds.

Open GPAI Solver →