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
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?
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.
a) How many different meals can be configured?
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?
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.
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?
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?
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.
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?
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?
$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.
a) In how many different ways can the podium of the competition be formed?
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?
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.
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?
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.
a) In how many different ways can they sit around the table?
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?
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:
There are no gender restrictions.
The boys and girls must sit alternately (no boy next to another boy and no girl next to another girl).
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).
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.
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).
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?
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.
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?
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?
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.
a) How many different committees can be formed?
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?
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:
The capital letters cannot be repeated.
The numerical digits must all be different and arranged in strictly increasing order.
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.
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:
There must be more seniors than juniors on the committee.
There must be at least one student from each grade in the selected group.
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.
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.
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.
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:
a) How many different routes can they follow?
b) How many of those routes pass through a checkpoint $C$ located $3$ blocks to the right and $2$ upward from point $A$?
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.
The numbers $\binom{n}{r}$ are also called binomial coefficients. They line up in Pascal's triangle.
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:
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:
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$:
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."
Collect the power of $x$ in terms of $k$.
Set that exponent equal to what the problem asks (a given power, or $0$ for the constant term) and solve for $k$.
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.