Ways of Counting
Your cell phone asks you for a 4-digit PIN. How many different PINs are there? And what if the system doesn't allow repeated digits? Counting them one by one would be absurd. Before you can calculate any probability you need to know how many cases there are, and that is what counting techniques are for. On this page you will learn what they are and, above all, how to decide which one to use in each problem.
The multiplication principle
In a school cafeteria, the set menu allows a choice between 3 starters, 4 main courses and 2 desserts. In how many different ways can a student create a complete lunch…
In a school cafeteria, the set menu allows a choice between 3 starters, 4 main courses and 2 desserts. In how many different ways can a student create a complete lunch consisting of a starter, a main course and a dessert?
A social network requires usernames to always start with a lowercase letter (from the 26 in the English alphabet) followed obligatorily by 2 digits (from $0$ to $9$).…
A social network requires usernames to always start with a lowercase letter (from the 26 in the English alphabet) followed obligatorily by 2 digits (from $0$ to $9$). How many different usernames can be created under this format?
A café offers a "Student Deal" that consists of choosing one type of sandwich, one side dish and one drink. They have $5$ types of sandwiches, $3$ types of sides and $4$…
A café offers a "Student Deal" that consists of choosing one type of sandwich, one side dish and one drink. They have $5$ types of sandwiches, $3$ types of sides and $4$ types of drinks.
- a) How many different meals can be created?
- b) If a student decides that they do not want a vegetable sandwich (there is 1 type) and do not want to drink water (there is 1 type), how many options do they have now for their meal?
Arrangements with repetition
When repetition is allowed, each position always has the same options, so the multiplication principle reduces to a power.
To log in to 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…
To log in to 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?
Arrangements without repetition
If in a race of 10 people a gold, silver, and bronze medal are awarded, one person can't win two medals: when choosing, the options keep decreasing.
A group of 10 friends decides to organise a video game tournament. Prizes will be awarded to the first, second and third place finishers. Given that there can be no…
A group of 10 friends decides to organise a video game tournament. Prizes will be awarded to the first, second and third place finishers. Given that there can be no ties, in how many different ways can these three trophies be awarded?
To improve the security of smart lockers at a school, the system requires a $4$-digit access code. However, to avoid obvious combinations, the system imposes the…
To improve the security of smart lockers at a school, the system requires a $4$-digit access code. However, to avoid obvious combinations, the system imposes the following conditions: the first digit must be odd, the last digit must be even (considering $0$ as even), and no digit may be repeated in the code. How many different codes can be generated following these rules?
In a regional E-sports competition (competitive video games), $12$ teams are participating. The organisers must award a gold, silver and bronze medal to the top three…
In a regional E-sports competition (competitive video games), $12$ teams are participating. The organisers must award a gold, silver and bronze medal to the top three teams.
- a) In how many different ways can the competition podium be formed?
- b) If we know that the local team "Los Gamers" always finishes in the top three, in how many ways can the podium be completed now?
Permutations: ordering all of them
If you order all the elements, it is the case $r = n$ of the previous section.
A bookshelf has space to fit exactly 6 textbooks from different Year 2 Bachillerato subjects. In how many different ways can these 6 books be arranged on the shelf if…
A bookshelf has space to fit exactly 6 textbooks from different Year 2 Bachillerato subjects. In how many different ways can these 6 books be arranged on the shelf if they must all be aligned next to each other?
Permutations with repeated elements
If two letters of a word are the same, swapping them doesn't change the word, so $n!$ overcounts.
How many 4-letter words, with or without meaning, can be formed using the letters of the word BALA? (Note that the letter 'A' is repeated).
How many 4-letter words, with or without meaning, can be formed using the letters of the word BALA? (Note that the letter 'A' is repeated).
A streetwear 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…
A streetwear 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 photoshoot, 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?
Circular permutations
At a round table there is no "first seat": if everyone moves one seat to the right, the arrangement is the same. Only the relative position matters.
Seven friends go out for dinner at a pizzeria and sit around a circular table. a) In how many different ways can they sit around the table? b) Two of the friends, Ana…
Seven friends go out for dinner at a pizzeria and sit around a circular table.
- a) In how many different ways can they sit around the table?
- b) Two of the friends, Ana and Javi, have had an argument and do not want to sit together. In how many ways can the seven friends sit now, satisfying 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 seating arrangements if: 1.…
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 seating arrangements 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, Elena and Marcos, insist on sitting together.
(Note: Consider that in circular permutations, only the relative position of one person to another matters).
Combinations: when order doesn't matter
If you choose 3 representatives from a class, the order in which you name them doesn't matter: the team {Ana, Luis, Itzel} is the same as {Luis, Itzel, Ana}.
In a class of 12 students, the homeroom teacher must select 3 of them to be on the student council committee. Given that the three selected students will have the same…
In a class of 12 students, the homeroom teacher must select 3 of them to be on the student council committee. Given that the three selected students will have the same responsibility, how many different student council committees can be formed?
An ice cream parlour offers 8 different ice cream flavors. If a customer wants to buy a tub with 2 scoops of ice cream of different flavors, how many different…
An ice cream parlour offers 8 different ice cream flavors. If a customer wants to buy a tub with 2 scoops of ice cream of different flavors, how many different combinations can they choose?
A group of $15$ students in $2º$ Baccalaureate is organising the graduation party. They must choose a committee formed of $4$ people to be in charge of the music and…
A group of $15$ students in $2º$ Baccalaureate is organising the graduation party. They must choose a committee formed 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 formed of $2$ girls and $2$ boys?
Paths on a grid
Diego goes from his house to school along streets laid out in a grid, moving only to the right (R) or up (U). If it is 4 blocks to the right and 3 up, each route is a sequence of 7 steps with 4 R and 3 U.
A courier needs to deliver a package in a city whose street layout is a perfect grid. They must travel from point $A$ (bottom left corner) to point $B$ (top right…
A courier needs to deliver a package in a city whose street layout is a perfect grid. They must travel from point $A$ (bottom left corner) to point $B$ (top right corner), moving only right or up. If the distance is $6$ blocks to the right and $4$ blocks up:
- a) How many different routes can they take?
- b) How many of those routes pass through a checkpoint $C$ located $3$ blocks to the right and $2$ up 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.
Problems with conditions: which technique do I use?
Hard problems combine several techniques. Always follow this plan:
-
Are the elements ordered or only chosen? (arrangement/permutation or combination)
-
Can they be repeated?
-
Are there conditions? If they say "at least one," use cases or the complement. If they ask for "together," form a block. If they ask for "not together" or "not adjacent," subtract or use gaps.
-
Split the problem into stages and multiply; if there are separate cases, add.
| Question | Technique |
|---|---|
| Does order matter and can they be repeated? | $n^k$ |
| Does order matter and there is no repetition? | $\frac{n!}{(n-r)!}$ |
| Are all of them ordered? | $n!$ |
| Are some identical to each other? | $\frac{n!}{n_1!\,n_2!\cdots}$ |
| Doesn't order matter? | $\binom{n}{r}$ |
A cybersecurity company wants to generate unique access codes for its employees. Each code must be 9 characters long, distributed as follows: 3 initial uppercase letters…
A cybersecurity company wants to generate unique access codes for its employees. Each code must be 9 characters long, distributed as follows:
-
3 initial uppercase letters (chosen from the 26 letters of the alphabet, excluding Ñ).
-
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:
-
Uppercase letters cannot be repeated.
-
Numerical digits must all be distinct and arranged in strictly increasing order.
-
Special symbols may be repeated.
An architecture firm is designing a housing estate with 7 identical plots in a row. They must plant trees of three different species: oak, pine and holm oak. For…
An architecture firm is designing a housing estate with 7 identical plots in a row. They must plant trees of three different species: oak, pine and holm oak. For aesthetic and biological reasons, the following requirements must be met:
-
Only one tree is planted in each plot.
-
There must be at least one tree of each species.
-
No two pine trees can be in adjacent plots.
Calculate the total number of different ways in which the trees can be distributed among the 7 plots.
A debate committee of 6 students is to be formed for a Model United Nations (MUN). The available candidates are 8 students from 2nd year Baccalaureate and 6 students…
A debate committee of 6 students is to be formed for a Model United Nations (MUN). The available candidates are 8 students from 2nd year Baccalaureate and 6 students from 1st year Baccalaureate.
Calculate how many ways the committee can be chosen if these two conditions must be met simultaneously:
-
The committee must contain more 2nd year than 1st year Baccalaureate students.
-
There must be at least one student from each year in the selected group.
A streaming platform uses an algorithm to recommend playlists. If they have 10 Rock songs, 8 Pop songs, and 6 Indie songs, how many 5-song playlists can be created such…
A streaming platform uses an algorithm to recommend playlists. If they have 10 Rock songs, 8 Pop songs, and 6 Indie songs, how many 5-song playlists can be created such that each playlist contains at least one song from each of the three musical genres? Note that the order of the songs in the playlist does matter.
Binomial coefficients and the binomial theorem
Some problems ask you to solve equations with binomial coefficients. These properties help:
Find the value of $n$ (an integer with $n \ge 3$) in the following equation with binomial coefficients, explaining the steps you take: $$\binom{n}{2} + \binom{n-1}{n-3}…
Find the value of $n$ (an integer with $n \ge 3$) in the following equation with binomial coefficients, explaining the steps you take:
$$\binom{n}{2} + \binom{n-1}{n-3} = 25$$Determine all values of $n \in \mathbb{N}$ that satisfy the following algebraic equality based on combination numbers: $$\binom{n+1}{3} + \binom{n}{2} = 2 \times…
Determine all values of $n \in \mathbb{N}$ that satisfy the following algebraic equality based on combination numbers:
$$\binom{n+1}{3} + \binom{n}{2} = 2 \times \binom{n+1}{2}$$Justify the process by expanding the factorials and solving the resulting equation.
In the binomial expansion of 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 of 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, giving reasons, the value of the positive real number $k$ and, once found, calculate the value of the independent term of this expansion, if it exists.
Back to the beginning: with repetition, a 4-digit PIN has $10^4 = 10{,}000$ possibilities. Without repeating digits there would be ${}_{10}P_4 = 10 \cdot 9 \cdot 8 \cdot 7 = 5{,}040$.