Back to homeMathematics · AP Statistics · Change subject
Start for free
AP Stats · Mathematics
Chance and Probability · Combinatorics

Counting Techniques: Permutations and Combinations

Before you start, make sure you know: Counting techniques (Algebra 2)

Your phone asks you to pick a passcode: 4 digits or 6 digits. Someone who finds your phone tries codes at random. How many codes would they have to choose from? Before you can find any probability, you need to know how many outcomes there are, and listing them one by one is not an option when there are thousands or millions. This page gives you the tools to count quickly and the questions to ask to pick the right one: Does order matter? Can things repeat?

The Fundamental Counting Principle

Counting principle diagram multiplying 4 shoe styles by 6 colors by 3 lace colors to get 72 sneaker designs. 4 styles × 6 colors × 3 laces 4 · 6 · 3 = 72 different sneakers
Practice★☆☆Not started
In a school cafeteria, the menu of the day allows choosing between 3 appetizers, 4 main courses, and 2 desserts. In how many different ways can a student configure their…

In a school cafeteria, the menu of the day allows choosing between 3 appetizers, 4 main courses, and 2 desserts. In how many different ways can a student configure their complete lunch consisting of an appetizer, a main course, and a dessert?

3 Appetizer × 4 Main course × 2 Dessert
Solve
Practice★★☆Not started
In a cafeteria they offer a "Student Combo" which consists of choosing a type of sandwich, a side dish, and a drink. They have $5$ types of sandwiches, $3$ types of side…

In a cafeteria they offer a "Student Combo" which consists of choosing a type of sandwich, a side dish, and a drink. They have $5$ types of sandwiches, $3$ types of side dishes, and $4$ types of drinks.

  1. a) How many different meals can be configured?
  2. b) If a student decides that they do not want a veggie sandwich (there is one type) nor do they want to drink water (there is one type), how many options do they have now for their meal?
Solve

When Repetition Is Allowed: $n^k$

A phone passcode lets you reuse digits: after using a 7, the 7 is still available for the next position. So every stage has the same number of options, and the counting principle becomes a power.

Four boxes each with 10 options multiply to 10,000 possible 4-digit passcodes. 10 × 10 × 10 × 10 10⁴ = 10,000 passcodes

Go back to the opening question: a 4-digit passcode has $10{,}000$ possibilities, and a 6-digit one has $10^6 = 1{,}000{,}000$. Two more digits make it 100 times harder to guess.

Practice★☆☆Not started
To log into a mobile app, a user must create a 4-digit security code. If the system allows numbers to be repeated and uses the digits from $0$ to $9$, how many different…

To log into a mobile app, a user must create a 4-digit security code. If the system allows numbers to be repeated and uses the digits from $0$ to $9$, how many different security codes can be generated?

Digits: {0,1,2,3,4,5,6,7,8,9} 10 10 10 10 × × × Total possible codes
Solve
Practice★☆☆Not started
A social network requires usernames to always start with a lowercase letter (from the 26 in the English alphabet) followed by 2 digits (from $0$ to $9$). How many…

A social network requires usernames to always start with a lowercase letter (from the 26 in the English alphabet) followed by 2 digits (from $0$ to $9$). How many different usernames under this format can be created?

@ u 9 5 26 options × 10 options × 10 options Letter [a-z] Digit [0-9] Digit [0-9]
Solve

Permutations: Order Matters, No Repeats

A podium (1st, 2nd, 3rd) has three different finishers. Once a runner takes 1st place, that runner is no longer available for 2nd. The number of options shrinks at each step.

Three boxes with 8, 7 and 6 options multiply to 336 possible podiums for 8 runners. 8 × 7 × 6 8 · 7 · 6 = 336 podiums
Practice★☆☆Not started
A group of 10 friends decides to organize a video game tournament. Prizes will be awarded to the first, second, and third place finishers. Knowing that there can be no…

A group of 10 friends decides to organize a video game tournament. Prizes will be awarded to the first, second, and third place finishers. Knowing that there can be no ties, in how many different ways can these three trophies be distributed?

n = 10 friends −1 −1 10 options 9 options 8 options 2º 3º 1º Total de maneras = ?
Solve
Practice★★☆Not started
To improve the security of the smart lockers in a school, the system requires an access code of $4$ digits. However, to avoid obvious combinations, the system imposes…

To improve the security of the smart lockers in a school, the system requires an access code of $4$ digits. However, to avoid obvious combinations, the system imposes the following conditions: the first digit must be odd, the last must be even (considering $0$ as even), and no digit can be repeated in the code. How many different codes can be generated following these rules?

ODD {1,3,5,7,9} EVEN {0,2,4,6,8} d₁ d₂ d₃ d₄ Different digits (no repetition) d₁ ≠ d₂ ≠ d₃ ≠ d₄
Solve
Practice★★☆Not started
$12$ teams participate in a regional esports competition. The organizers must award a gold, a silver, and a bronze medal to the top three finishers. a) In how many…

$12$ teams participate in a regional esports competition. The organizers must award a gold, a silver, and a bronze medal to the top three finishers.

  1. a) In how many different ways can the podium of the competition be formed?
  2. b) If we know that the local team "The Gamers" always finishes in the top three, in how many ways can the podium be completed now?
Solve

Arranging Everyone: $n!$ and Circular Tables

If you arrange all $n$ items, you use every item, so $r = n$:

$$_nP_n = n!$$

Six books on a shelf can be ordered in $6! = 720$ ways.

Keeping two items together

Treat the pair as one block, arrange the blocks, then multiply by the ways to order inside the block.

Circular arrangements

Around a round table, rotating everyone one seat gives the same seating, because each person still has the same neighbors. Only relative positions count.

Five people A to E seated around a round table; rotating everyone gives the same arrangement. A B C D E Rotate everyone one seat: same arrangement.
Practice★☆☆Not started
A bookshelf has space to place exactly 6 textbooks from different senior year subjects. In how many different ways can these 6 books be arranged on the shelf if we want…

A bookshelf has space to place exactly 6 textbooks from different senior year subjects. In how many different ways can these 6 books be arranged on the shelf if we want them all to be aligned next to each other?

A B C D E F P₁ P₂ P₃ P₄ P₅ P₆ n = 6 books
Solve
Practice★★☆Not started
Seven friends go to dinner at a pizzeria and sit at a circular table. a) In how many different ways can they sit around the table? b) Two of the friends, Ashley and…

Seven friends go to dinner at a pizzeria and sit at a circular table.

  1. a) In how many different ways can they sit around the table?
  2. b) Two of the friends, Ashley and Ethan, have argued and do not want to sit together. In how many ways can the seven friends sit now fulfilling this condition?
Table Ashley F₁ F₂ Ethan F₃ F₄ F₅
Solve
Practice★★★Not started
Six friends (3 boys and 3 girls) sit down to dinner at a circular table to celebrate the end of their exams. Determine the number of possible arrangements in which they…

Six friends (3 boys and 3 girls) sit down to dinner at a circular table to celebrate the end of their exams. Determine the number of possible arrangements in which they can sit if:

  1. There are no gender restrictions.

  2. The boys and girls must sit alternately (no boy next to another boy and no girl next to another girl).

  3. A specific pair of friends, Emma and Michael, insist on sitting together.

(Note: Consider that in circular permutations, only the relative position of one person to another matters).

Together E M ♀ ♂ ♀ ♂ Girls Boys Rotation
Solve

Arrangements with Identical Items

What if some items are indistinguishable, like the repeated letters in a word? Swapping two identical items doesn't change the arrangement, so $n!$ counts each arrangement too many times. Divide to fix that.

The word ALABAMA drawn as seven tiles, with the four A tiles highlighted. A L A B A M A 7! / 4! = 210 arrangements
Practice★☆☆Not started
How many 4-letter words, whether they make sense or not, can be formed using the letters of the word BALA? (Keep in mind that the letter 'A' is repeated).

How many 4-letter words, whether they make sense or not, can be formed using the letters of the word BALA? (Keep in mind that the letter 'A' is repeated).

Repeated letter B A₁ L A₂ Example of permutation A₂ L B A₁ Note: A₁ and A₂ are indistinguishable in the final result.
Solve
Practice★★☆Not started
An urban clothing brand wants to launch a limited edition of hoodies. They have $3$ identical red hoodies, $2$ identical blue hoodies, and $4$ identical black hoodies.…

An urban clothing brand wants to launch a limited edition of hoodies. They have $3$ identical red hoodies, $2$ identical blue hoodies, and $4$ identical black hoodies. For a photo shoot, they must place all these hoodies in a row on a counter. In how many different ways can the hoodies be arranged based solely on their color?

3 Red 2 Blue 4 Black Order 1 2 3 4 5 6 7 8 9 n = 9 total positions
Solve

Combinations: Order Doesn't Matter

A student council of 3 students is different from a podium of 3: nobody is "first". Picking Ana, Ben, and Chen is the same group as picking Chen, Ana, and Ben.

Choosing 2 letters from A, B, C gives 3 groups, while ordered pairs give 6. A, B A, C B, C 6 ordered pairs ÷ 2! = 3 groups C(3, 2) = 3

A useful shortcut is symmetry: choosing $r$ items to take is the same as choosing $n-r$ items to leave behind, so

$$\binom{n}{r} = \binom{n}{n-r}.$$

For example, $\binom{50}{48} = \binom{50}{2} = 1225$.

Question Order matters? Repeats allowed? Use
PIN, password yes yes $n^k$
Podium, officers yes no $_nP_r$
Committee, hand of cards, toppings no no $\binom{n}{r}$
Practice★☆☆Not started
In a class of 12 students, the homeroom teacher must choose 3 of them to be part of the school's student council. Given that the three chosen will have the same…

In a class of 12 students, the homeroom teacher must choose 3 of them to be part of the school's student council. Given that the three chosen will have the same responsibility, how many different groups of representatives can be formed?

Whole class n = 12 Choose 3 Student council k = 3 Same responsibility ➔ No order (C₁₂,₃)
Solve
Practice★☆☆Not started
An ice cream parlor offers 8 different flavors of ice cream. If a customer wants to buy a cup with 2 scoops of ice cream of different flavors, how many different…

An ice cream parlor offers 8 different flavors of ice cream. If a customer wants to buy a cup with 2 scoops of ice cream of different flavors, how many different combinations can they choose?

8 available flavors (n = 8) 1 2 3 4 5 6 7 8 2 chosen scoops (k = 2) No repetition Order does not matter
Solve

Choose, Then Multiply

Many problems have several independent parts. Count each part with the right tool, then multiply (counting principle).

Practice★★☆Not started
A group of $15$ students from $2º$ grade is organizing the graduation party. They must choose a committee made up of $4$ people to be in charge of the music and food. a)…

A group of $15$ students from $2º$ grade is organizing the graduation party. They must choose a committee made up of $4$ people to be in charge of the music and food.

  1. a) How many different committees can be formed?
  2. b) If there are $8$ girls and $7$ boys in the group, how many of those committees would be made up of $2$ girls and $2$ boys?
Solve
Practice★★★Not started
A cybersecurity company wants to generate unique access codes for its employees. Each code must have a length of 9 characters distributed as follows: 3 initial capital…

A cybersecurity company wants to generate unique access codes for its employees. Each code must have a length of 9 characters distributed as follows:

  • 3 initial capital letters (chosen from the 26 in the alphabet).

  • 4 central numerical digits (0-9).

  • 2 final special symbols (chosen from a set of 5 symbols: @, #, $\$$, &, *).

Calculate how many different codes can be generated if the following restrictions are imposed:

  1. The capital letters cannot be repeated.

  2. The numerical digits must all be different and arranged in strictly increasing order.

  3. The special symbols can be repeated.

Solve

"At Least One," Cases, and Gaps

Conditions like "at least one," "more than," or "not next to each other" are best handled in one of three ways: split into cases, use the complement (total minus bad), or use gaps.

Splitting into cases

The complement

"At least one" is "total minus none." Count everything, then subtract the outcomes that break the condition.

When you need at least one from each of several groups, subtract the teams missing one group, then add back the teams that were subtracted twice (those missing two groups).

The gap method: "no two are adjacent"

To keep some items apart, place the other items first. They create gaps, and the items to separate go into different gaps, at most one per gap.

Four blue flags in a row create five gaps where red flags may be placed. 12345 4 blue flags create 5 gaps for red flags.

For a row of 7 lots where no two pines can be adjacent, count by the number of pines $k$: the other $7 - k$ lots create $8 - k$ gaps, so there are $\binom{8-k}{k}$ ways to place the pines. Then fill the remaining lots as the problem requires.

Practice★★★Not started
A debate committee for a Model United Nations (MUN) consisting of 6 students is to be formed. The available candidates are 8 seniors and 6 juniors. Calculate in how many…

A debate committee for a Model United Nations (MUN) consisting of 6 students is to be formed. The available candidates are 8 seniors and 6 juniors.

Calculate in how many ways the committee can be chosen if these two conditions must be met simultaneously:

  1. There must be more seniors than juniors on the committee.

  2. There must be at least one student from each grade in the selected group.

Solve
Practice★★★Not started
A streaming platform uses an algorithm to recommend playlists. If they have 10 rock, 8 pop, and 6 indie songs available, how many 5-song playlists can be created so that…

A streaming platform uses an algorithm to recommend playlists. If they have 10 rock, 8 pop, and 6 indie songs available, how many 5-song playlists can be created so that each list contains at least one song from each of the three musical genres? Keep in mind that the order of the songs in the list matters.

Solve
Practice★★★Not started
An architecture studio is designing a housing development with 7 identical lots in a row. They must plant trees of three different species: oaks, pines, and holm oaks.…

An architecture studio is designing a housing development with 7 identical lots in a row. They must plant trees of three different species: oaks, pines, and holm oaks. For aesthetic and biological reasons, the following requirements must be met:

  • Only one tree is planted in each lot.

  • There must be at least one tree of each species.

  • There cannot be two pines in adjacent lots.

Calculate the total number of different ways in which the trees can be distributed in the 7 lots.

Solve

Counting Paths on a Grid

A delivery driver moves only right or up on a street grid. Every shortest route from $A$ to $B$ is a sequence of steps, and the only thing that changes between routes is the order of the steps. That is an arrangement of identical items.

A grid from A at the bottom left to B at the top right, 4 blocks right and 3 up, with one route and a checkpoint C highlighted. A B C 4 steps right (R) and 3 steps up (U)

To force a route through a checkpoint $C$, count $A \to C$ and $C \to B$ separately and multiply. To avoid a checkpoint, subtract the routes through it from the total.

Practice★★☆Not started
A courier must deliver a package in a city whose street structure is a perfect grid. They must go from point $A$ (bottom-left corner) to point $B$ (top-right corner),…

A courier must deliver a package in a city whose street structure is a perfect grid. They must go from point $A$ (bottom-left corner) to point $B$ (top-right corner), moving only to the right or upward. If the distance is $6$ blocks to the right and $4$ blocks upward:

  1. a) How many different routes can they follow?
  2. b) How many of those routes pass through a checkpoint $C$ located $3$ blocks to the right and $2$ upward from point $A$?
6 blocks 4 blocks 3 2 3 2 Permitted movements A B C
Solve
Practice★★★Not started
A programmer is developing an algorithm to find the shortest route in a sensor network represented by a grid of $6 \times 5$ nodes. The algorithm must calculate how many…

A programmer is developing an algorithm to find the shortest route in a sensor network represented by a grid of $6 \times 5$ nodes. The algorithm must calculate how many paths of minimum length exist from node $A(0,0)$ to node $B(6,5)$, taking into account that due to a fault, the central node $C(3,3)$ is inaccessible and cannot be part of any route.

x y 1 2 3 4 5 6 1 2 3 4 5 Example route C(3,3) A(0,0) B(6,5)
Solve

Binomial Coefficients and Equations

The numbers $\binom{n}{r}$ are also called binomial coefficients. They line up in Pascal's triangle.

Pascal's triangle rows 0 through 5, where each entry is the sum of the two entries above it. n = 0n = 1n = 2n = 3n = 4n = 5 1 11 121 1331 14641 15101051

Row $n$ lists $\binom{n}{0}, \binom{n}{1}, \dots, \binom{n}{n}$. Useful facts, each with a reason:

To solve an equation with binomial coefficients, expand the factorials (cancel what you can), turn it into a polynomial equation, solve, and then check the answer against the domain ($n \ge r$).

Practice★★☆Not started
Find the value of $n$ in the following equation with binomial coefficients, reasoning the steps taken: $$\binom{n}{2} + \binom{n-1}{n-3} = (n-1)^2$$

Find the value of $n$ in the following equation with binomial coefficients, reasoning the steps taken:

$$\binom{n}{2} + \binom{n-1}{n-3} = (n-1)^2$$
Solve
Practice★★★Not started
Determine all the values of $n \in \mathbb{N}$ that satisfy the following algebraic equality based on binomial coefficients: $$\binom{n+1}{3} + \binom{n}{2} = 2 \cdot…

Determine all the values of $n \in \mathbb{N}$ that satisfy the following algebraic equality based on binomial coefficients:

$$\binom{n+1}{3} + \binom{n}{2} = 2 \cdot \binom{n+1}{2}$$

Justify the process by expanding the factorials and solving the resulting equation.

Solve

The Binomial Theorem

Expanding $(a + b)^n$ means choosing, from each of the $n$ factors, either $a$ or $b$. The term $a^{n-k}b^k$ appears once for every way to pick $b$ from $k$ of the $n$ factors, and that is $\binom{n}{k}$ ways.

Strategy for finding a particular term of $(\text{stuff})^n$:

  1. Write the general term $\binom{n}{k}(\text{first})^{n-k}(\text{second})^{k}$. Treat the sign and any coefficients inside the parentheses as part of "first" and "second."

  2. Collect the power of $x$ in terms of $k$.

  3. Set that exponent equal to what the problem asks (a given power, or $0$ for the constant term) and solve for $k$.

  4. Compute the coefficient for that $k$.

Practice★★★Not started
In the binomial expansion for the expression $(\frac{x^2}{2} - \frac{k}{x^3})^{15}$, it is known that the coefficient of the term containing $x^{10}$ is equal to $3003$.…

In the binomial expansion for the expression $(\frac{x^2}{2} - \frac{k}{x^3})^{15}$, it is known that the coefficient of the term containing $x^{10}$ is equal to $3003$. Determine with reasoning the value of the positive real number $k$ and, once found, calculate the value of the constant term of this expansion if it exists.

r Degree 30 10 −40 3 6 9 12 15 Degree = 30 - 5r x³⁰ (T₁) x¹⁰ (T₅) x⁰ (T₇) x⁻⁴⁵ (T₁₆)
Solve

Summary

See all the exercises in this section