Counting Techniques
Laplace's rule, $P(A) = \frac{\text{favorable outcomes}}{\text{possible outcomes}}$, is easy to state but sometimes hard to apply: in how many ways can you award three medals among eight runners in a marathon in Mexico City? How many different committees can be formed in your class? Counting one by one is impossible as soon as the numbers get big. Here you will learn to count without listing: the multiplication principle and the most common counts, depending on whether order matters or not. Then you will learn to count with restrictions, and we will combine events and probabilities in trees. At the end we will return to the medals.
Tree diagrams and the multiplication principle
A tree diagram draws each stage as a level of branches. Each path from the root to the end is an outcome.
A streaming platform allows users to customize their profile by choosing an avatar from 4 different animals (lion, panda, cat and wolf) and a background color from 3…
A streaming platform allows users to customize their profile by choosing an avatar from 4 different animals (lion, panda, cat and wolf) and a background color from 3 options (blue, green and orange).
- a) Describe the sample space $E$ of the possible profile combinations.
- b) How many elements does the sample space have? Use the multiplication principle to justify your answer.
In your school cafeteria menu you can choose a starter between salad, pasta or rice; a main course between chicken or fish; and a dessert between fruit or yoghurt. a)…
In your school cafeteria menu you can choose a starter between salad, pasta or rice; a main course between chicken or fish; and a dessert between fruit or yoghurt.
- a) Represent all possible complete menu options using a tree diagram.
- b) If you choose a menu at random, what is the probability that it includes "pasta" as a starter?
Arrangements with and without repetition
When you choose and order elements (a podium, a code), the position each one occupies matters. If they cannot be repeated, these are called arrangements (or permutations of $n$ elements taken $k$ at a time). If they can be repeated, they are arrangements with repetition.
The reason: for each position you multiply the options that remain. With repetition there are always $n$; without repetition, each element used is no longer available.
A combination padlock for a locker has a 3-digit code. Each digit can be a number from $1$ to $5$. a) How many different combinations can be created if numbers can be…
A combination padlock for a locker has a 3-digit code. Each digit can be a number from $1$ to $5$.
- a) How many different combinations can be created if numbers can be repeated?
- b) How many combinations are there if the three numbers must be distinct?
In a local chess tournament 8 players participate. Three different trophies will be awarded for first, second and third place. a) In how many different ways can the…
In a local chess tournament 8 players participate. Three different trophies will be awarded for first, second and third place.
- a) In how many different ways can the three prizes be awarded?
- b) If last year's champion participates again and we are certain he will finish in the top three, how many podium finishes are possible now?
A streaming platform uses a security code for parental control. The code consists of 2 letters (from a 26-letter alphabet, without Ñ) followed by 3 digits (from 0 to 9).…
A streaming platform uses a security code for parental control. The code consists of 2 letters (from a 26-letter alphabet, without Ñ) followed by 3 digits (from 0 to 9).
-
a) How many different codes can be created if letters and numbers can be repeated?
-
b) If a user forgets their code but remembers that it begins with the letter "A" and ends with the number "7", how many possible combinations would they have to try?
-
c) If the code were generated at random without allowing any repeated characters (letters or numbers), what would be the probability of the code being "BX123"?
A fashion designer is creating a capsule collection. For the final catwalk show, they have to arrange 6 models in a single line. a) In how many different ways can the 6…
A fashion designer is creating a capsule collection. For the final catwalk show, they have to arrange 6 models in a single line.
-
a) In how many different ways can the 6 models walk down the catwalk?
-
b) If two of the models are sisters and the designer insists that they must walk immediately next to each other, in how many ways can the line be arranged now?
-
c) If the designer decides that the two sisters cannot be together under any circumstances, how many options are there?
Combinations: choosing without ordering
When order does not matter (a committee, songs for an album), you use combinations, with the binomial coefficient $\binom{n}{k}$ ("$n$ choose $k$").
A band has prepared 10 songs for their new album, but the record label tells them they can only include 4 of them. a) How many different selections of 4 songs can they…
A band has prepared 10 songs for their new album, but the record label tells them they can only include 4 of them.
- a) How many different selections of 4 songs can they make if the order does not matter in which they are chosen?
- b) What are these types of groupings called in combinatorics? Justify your answer.
A group of 12 1st Baccalaureate students has been selected to attend a conference on sustainability. The school must choose 4 of them to form a committee of…
A group of 12 1st Baccalaureate students has been selected to attend a conference on sustainability. The school must choose 4 of them to form a committee of spokespersons.
-
a) In how many different ways can the committee be chosen if no distinction is made between roles?
-
b) If there are 7 girls and 5 boys among the 12 students, what is the probability that the committee consists of exactly 2 boys and 2 girls?
In an inter-school debate tournament, $12$ students participate: $7$ girls and $5$ boys. For the final stage, a team of $4$ representatives must be chosen at random.…
In an inter-school debate tournament, $12$ students participate: $7$ girls and $5$ boys. For the final stage, a team of $4$ representatives must be chosen at random. Calculate the probability that the chosen team satisfies both conditions simultaneously:
-
There is representation of both sexes.
-
The number of girls is strictly greater than the number of boys.
Counting with restrictions and by complement
Often the problem sets conditions: "at least two digits," "there cannot be three equal ones in a row," "two people together." There are two strategies.
The reason: all cases split into those that meet the condition and those that do not, so if you count the ones that do not and subtract them from the total, you are left with the ones that do.
With two people together, treat them as a single block and then multiply by the ways to order the block. With "cannot be together" use the complement: the total minus the cases in which they are together.
A logistics company organizes its routes using a barcode of $10$ vertical stripes. Each stripe can be black, gray or white. For scanner readability reasons, codes with…
A logistics company organizes its routes using a barcode of $10$ vertical stripes. Each stripe can be black, gray or white. For scanner readability reasons, codes with three consecutive stripes of the same color are not allowed.
-
How many different codes of $10$ stripes can be formed in total (without restrictions)?
-
If a code is chosen at random from all possible codes (without restrictions), what is the probability that the stripes in the odd positions are all black and those in the even positions are all white or gray?
An IT security system requires passwords to have exactly $8$ characters. These must be chosen from the $26$ letters of the alphabet (case-insensitive) and the $10$…
An IT security system requires passwords to have exactly $8$ characters. These must be chosen from the $26$ letters of the alphabet (case-insensitive) and the $10$ numerical digits ($0-9$). A password is considered "strong" if it contains at least two numerical digits and does not repeat any character. If a program generates a random password that meets the condition of not repeating characters, calculate the probability that it is "strong".
Draws with and without replacement
In a toolbox there are 5 Phillips screwdrivers and 3 flat-head screwdrivers. 2 screwdrivers are chosen at random, one after the other, without putting the first one back…
In a toolbox there are 5 Phillips screwdrivers and 3 flat-head screwdrivers. 2 screwdrivers are chosen at random, one after the other, without putting the first one back into the box.
- a) Calculate the probability that both are of the same type.
- b) Calculate the probability that the second one is flat-head given that the first one was Phillips.
- c) If the experiment were done with replacement, how would the probability in part a) change? Calculate its new value and compare it with the one in part a).
You can use a tree diagram that you draw yourself.
In a toolbox there are $15$ LED light bulbs, $3$ of which are known to be defective. If we take out $4$ light bulbs one by one without replacement: 1. Calculate the…
In a toolbox there are $15$ LED light bulbs, $3$ of which are known to be defective. If we take out $4$ light bulbs one by one without replacement:
-
Calculate the probability that the fourth light bulb taken out is the second defective one to appear in the process.
-
If the selections were made with replacement, would the previous probability change? Justify your answer using counting techniques.
An urn contains $n$ white balls and $4$ red balls. Two balls are drawn simultaneously (or successively without replacement). If it is known that the probability that…
An urn contains $n$ white balls and $4$ red balls. Two balls are drawn simultaneously (or successively without replacement). If it is known that the probability that both balls are white is equal to $1/3$, determine the total number of balls in the urn. (Note: you must set up a combinatorial equation and solve it to find the value of $n$).
Union of events and the complementary event
Sometimes you have to count the favorable outcomes of "A or B." If you add the outcomes of A and those of B, the ones in both are counted twice; you have to subtract them once.
You can also list the elements without repeating any. With a ball numbered from $1$ to $10$: $A=$ "even" $=\{2,4,6,8,10\}$ and $B=$ "multiple of 5" $=\{5,10\}$. Then $A\cup B=\{2,4,5,6,8,10\}$ has $6$ elements and $A\cap B=\{10\}$. Check: $5+2-1=6$.
A ball is drawn from an urn containing 10 balls numbered from $1$ to $10$. We consider the following events: $A = \text{"Getting a prime number"}$…
A ball is drawn from an urn containing 10 balls numbered from $1$ to $10$. We consider the following events:
$A = \text{"Getting a prime number"}$
$B = \text{"Getting a multiple of 3"}$
- a) Write down the elements forming events $A \cup B$ and $A \cap B$.
- b) Calculate the probabilities $P(A)$, $P(B)$ and $P(A \cup B)$ using Laplace's rule.
In a 1st Baccalaureate class there are 30 students. It is known that 18 of them passed the last Mathematics exam and 12 passed the English exam. If there are 5 students…
In a 1st Baccalaureate class there are 30 students. It is known that 18 of them passed the last Mathematics exam and 12 passed the English exam. If there are 5 students who passed both subjects:
- a) Calculate the probability that, choosing a student at random, they passed Mathematics or English.
- b) Calculate the probability that they passed neither of the two subjects.
Let $A$ and $B$ be two events in a sample space such that their probabilities are known: $P(A) = 0.6$, $P(B) = 0.4$ and $P(A \cap B) = 0.2$. Calculate the following…
Let $A$ and $B$ be two events in a sample space such that their probabilities are known: $P(A) = 0.6$, $P(B) = 0.4$ and $P(A \cap B) = 0.2$.
Calculate the following probabilities using the properties of probability:
-
a) $P(A \cup B)$
-
b) $P(\bar{A} \cap \bar{B})$ (Probability that neither A nor B occurs).
-
c) $P(A | \bar{B})$ (Probability of A conditioned on B not occurring).
Trees with probabilities and conditional probability
Outcomes are not always equally likely. In that case each branch of the tree carries its own probability and:
The reason for the conditional: if you know that $B$ occurred, your new universe is only $B$, and from it you are interested in the part where $A$ also occurs.
When the data come in a contingency table, the conditional is read by dividing by the total of the row or column that is known.
Two events are independent if knowing one does not change the probability of the other, that is, if $P(A\cap B) = P(A)\cdot P(B)$. If this does not hold, they are dependent.
To count "exactly $k$ successes" in independent trials: multiply the probabilities of one specific order and multiply by the number of possible orders, $\binom{n}{k}$. For example, with $3$ trials and probability $0.5$ of success, exactly $2$ successes: $\binom{3}{2}\times0.5^2\times0.5 = 0.375$.
A survey was conducted among 200 young people about their reading and television viewing habits. The data are shown in the following contingency table: | | Reads…
A survey was conducted among 200 young people about their reading and television viewing habits. The data are shown in the following contingency table:
| Reads regularly | Does not read regularly | Total | |
|---|---|---|---|
| Watches TV > 2 h/day | 35 | 85 | 120 |
| Watches TV < 2 h/day | 55 | 25 | 80 |
| Total | 90 | 110 | 200 |
If a young person is chosen at random from this survey, calculate:
-
a) The probability that they read regularly and watch television less than 2 hours a day.
-
b) Given that the young person reads regularly, what is the probability that they watch television more than 2 hours a day?
-
c) Are the events "Reads regularly" and "Watches television more than 2 hours a day" independent? Justify your answer mathematically.
In a local basketball league, the effectiveness of a player's three-point shots has been analyzed. It is known that if he scores the first three-pointer, the probability…
In a local basketball league, the effectiveness of a player's three-point shots has been analyzed. It is known that if he scores the first three-pointer, the probability of scoring the second is $0.7$. However, if he misses the first, the probability of scoring the second is only $0.4$. It is known that the probability of scoring the first three-pointer of a game is $0.5$.
- a) Draw the tree diagram associated with the experiment of taking two consecutive three-pointers.
- b) Calculate the probability that the player scores exactly one of the two shots.
- c) If we know that the player missed the second shot, what is the probability that he had scored the first?
You can do it on paper and send a photo with your answer.
A tech company manufactures wireless headphones in two plants, one in Mexico and the other in Vietnam. The plant in Mexico produces $40\%$ of the total and Vietnam the…
A tech company manufactures wireless headphones in two plants, one in Mexico and the other in Vietnam. The plant in Mexico produces $40\%$ of the total and Vietnam the rest. It has been found that $3\%$ of the headphones from Mexico have connection faults, whereas in the Vietnam plant this fault appears in $6\%$ of production.
-
a) If we buy a pair of headphones at random, what is the probability that they work correctly?
-
b) If we buy a pair of headphones and they turn out to have connection faults, what is the probability that they were manufactured in the plant in Mexico?
A data analyst studies user behavior on a streaming platform. They have the following information about a sample of $500$ users: $65\%$ are under $25$ years old. $40\%$…
A data analyst studies user behavior on a streaming platform. They have the following information about a sample of $500$ users:
-
$65\%$ are under $25$ years old.
-
$40\%$ of the users use the platform mainly to watch documentaries.
-
Among those who do not watch documentaries, $70\%$ are under $25$ years old.
If a user is selected at random and turns out to be under $25$ years old, calculate the probability that their main preference is documentaries. Use a contingency table to organize the information.
It is known that in a certain city it rains on $20\%$ of days ($LL$), it is very windy on $10\%$ ($V$) and both conditions occur simultaneously on $5\%$. 1. Calculate…
It is known that in a certain city it rains on $20\%$ of days ($LL$), it is very windy on $10\%$ ($V$) and both conditions occur simultaneously on $5\%$.
-
Calculate the probability that on a randomly chosen day it does not rain and is not windy.
-
Given that it did not rain on a certain day, what is the probability that it was very windy?
-
Are the events "raining" and "being very windy" independent? Prove it mathematically.
A multiple-choice exam consists of $5$ questions with $4$ answer options each, of which only one is correct. A student who has not studied at all decides to answer at…
A multiple-choice exam consists of $5$ questions with $4$ answer options each, of which only one is correct. A student who has not studied at all decides to answer at random. However, they have a strategy: for each question, they discard one of the options that they know for sure is false (as it is absurd) and choose at random from the remaining three.
-
Calculate the probability that they get exactly $3$ correct answers.
-
What is the probability that they get at least one question right?
Summary
Back to the beginning: awarding 3 medals among 8 runners, where order matters and no one repeats, gives $8 \cdot 7 \cdot 6 = 336$ ways.