Conditional Probability
"What is the probability that it rains today in Mexico City?" is not the same question as "what is the probability that it rains, given that the sky is cloudy this morning?" Knowing something changes the space of possibilities: you no longer count all the cases, only the ones compatible with what you know. That is the idea of this section and the basis of what follows (tree diagrams, tables, Bayes).
What P(A|B) means
At a gaming convention, a next-generation console is raffled among the attendees. 120 people from Mexico City, 80 from Guadalajara, and 50 from Monterrey participate.…
At a gaming convention, a next-generation console is raffled among the attendees. 120 people from Mexico City, 80 from Guadalajara, and 50 from Monterrey participate. Furthermore, it is known that 60% of all participants are under 18 years old. If a winner is selected at random, calculate:
- a) The sample space associated with the origin of the participants.
- b) The probability that the winner is from Mexico City.
- c) The probability that the winner is an adult (18 or older).
In a language academy, 40% of the students are enrolled in the German course ($A$). Of the students enrolled in German, 30% also attend conversation classes ($C$). If a…
In a language academy, 40% of the students are enrolled in the German course ($A$). Of the students enrolled in German, 30% also attend conversation classes ($C$). If a student from the academy is selected at random, determine:
- a) The probability that a student is enrolled in German and attends conversation classes.
- b) Given that a student is enrolled in German, what is the probability that they do not attend conversation classes?
On a streaming platform, $60\%$ of users watch sci-fi series (event $S$) and $45\%$ watch documentaries (event $D$). It is known that $20\%$ of users enjoy both genres.…
On a streaming platform, $60\%$ of users watch sci-fi series (event $S$) and $45\%$ watch documentaries (event $D$). It is known that $20\%$ of users enjoy both genres. If we select a user at random who is known to watch sci-fi series, calculate the probability that they also watch documentaries. Are the events "watching sci-fi series" and "watching documentaries" independent? Reason your answer.
The multiplication rule
If you solve the definition for $P(A\cap B)$, you get the formula used to calculate intersections, especially in successive draws.
An urn contains 5 white balls and 3 black balls. Two balls are drawn successively with replacement (the first ball is returned before taking out the second). Represent…
An urn contains 5 white balls and 3 black balls. Two balls are drawn successively with replacement (the first ball is returned before taking out the second). Represent the situation using a tree diagram and calculate:
- a) The probability that both balls are white.
- b) The probability that the first is black and the second is white.
- c) The probability that both balls are the same color.
Two cards are drawn successively without replacement from a standard Spanish 40-card deck. Calculate the following probabilities: 1. That the second card is a King,…
Two cards are drawn successively without replacement from a standard Spanish 40-card deck. Calculate the following probabilities:
-
That the second card is a King, given that the first card was an Ace.
-
That the second card is a King, given that the first card was also a King.
-
That both cards are face cards (Jack, Knight, or King).
-
Given that the second card was a Coin (Gold), what is the probability that the first card was also a Coin?
Two fair six-sided dice are rolled simultaneously. Calculate the probability of the following events: a) Getting a sum equal to 7. b) Given that an even number was…
Two fair six-sided dice are rolled simultaneously. Calculate the probability of the following events:
- a) Getting a sum equal to 7.
- b) Given that an even number was rolled on the first die, what is the probability that the sum is 7?
- c) Are the events "sum equal to 7" and "first die even" independent? Justify your answer by comparing $P(S=7|Par)$ with $P(S=7)$.
Independent events
Let $A$ and $B$ be two independent events associated with a random experiment, such that $P(A) = 0.4$ and $P(B) = 0.5$. Find the following probabilities: a)…
Let $A$ and $B$ be two independent events associated with a random experiment, such that $P(A) = 0.4$ and $P(B) = 0.5$. Find the following probabilities:
- a) $P(A \cap B)$
- b) $P(A \cup B)$
- c) $P(A|B)$
- d) $P(\bar{A} \cap \bar{B})$
In a quality control check at an electronic component factory, it is known that event $F$ (the component has a soldering defect) has probability $P(F) = 0.08$, and event…
In a quality control check at an electronic component factory, it is known that event $F$ (the component has a soldering defect) has probability $P(F) = 0.08$, and event $C$ (the component has a casing defect) has probability $P(C) = 0.12$. If both events are independent, calculate:
-
The probability that a component has both defects.
-
The probability that it has at least one defect.
-
The probability that it has no defects.
-
Given that the component has a casing defect, what is the probability that it does not have a soldering defect?
A security system for a critical server consists of two components, $C_1$ and $C_2$, connected in parallel, meaning that the system functions if at least one of the…
A security system for a critical server consists of two components, $C_1$ and $C_2$, connected in parallel, meaning that the system functions if at least one of the components functions. The probability of component $C_1$ failing within a year is $0.05$ and for $C_2$ failing is $0.08$. Component failures are independent events.
Calculate:
- a) The probability that the system functions correctly for a year.
- b) Given that the system functioned correctly, what is the probability that component $C_1$ failed?
Reading the conditional probability in a contingency table
A study is carried out on pet ownership in a group of 100 people. The results are shown in the following contingency table: | | Has a dog ($D$) | Does not have a dog…
A study is carried out on pet ownership in a group of 100 people. The results are shown in the following contingency table:
| Has a dog ($D$) | Does not have a dog ($\bar{D}$) | Total | |
|---|---|---|---|
| Has a cat ($G$) | 15 | 25 | |
| Does not have a cat ($\bar{G}$) | 35 | ||
| Total | 100 |
- a) Complete the contingency table.
- b) If a person is chosen at random, what is the probability that they have both a dog and a cat?
- c) Given that the chosen person has a dog, what is the probability that they also have a cat?
A sports performance center analyzes the performance of its 120 athletes. It is observed that 65 of them follow a specific diet, 70 undertake high-intensity training,…
A sports performance center analyzes the performance of its 120 athletes. It is observed that 65 of them follow a specific diet, 70 undertake high-intensity training, and 40 do both.
-
Organize the data in a contingency table.
-
If an athlete is selected at random and does not undertake high-intensity training, what is the probability that they do follow the specific diet?
-
If the selected athlete does not follow the diet, what is the probability that they do not undertake high-intensity training either?
Combined operations
Problems rarely give you $P(A\mid B)$ directly: they usually give $P(A)$, $P(B)$, and $P(\bar A\cap\bar B)$ (or the union) and ask for the rest, as well as to decide whether there is independence.
A social media analyst studies the behavior of teenagers on two platforms: TikTok ($T$) and Instagram ($I$). After surveying a group of upper-secondary students, they…
A social media analyst studies the behavior of teenagers on two platforms: TikTok ($T$) and Instagram ($I$). After surveying a group of upper-secondary students, they find that the probability that a student uses TikTok is $P(T) = 0.75$, the probability that they use Instagram is $P(I) = 0.60$, and the probability that they use both platforms is $P(T \cap I) = 0.45$.
The Venn diagram shows these data; the regions marked with "?" are probabilities that are not yet known.
Calculate the probability that a randomly chosen student:
- a) Uses TikTok or Instagram.
- b) Uses TikTok but not Instagram ($T - I$).
- c) Uses neither of the two platforms.
Let $A$ and $B$ be two events such that $P(A) = 0.4$, $P(B|A) = 0.25$, and $P(A' \cap B') = 0.45$. 1. Calculate $P(A \cap B)$. 2. Calculate $P(B)$. 3. Calculate…
Let $A$ and $B$ be two events such that $P(A) = 0.4$, $P(B|A) = 0.25$, and $P(A' \cap B') = 0.45$.
-
Calculate $P(A \cap B)$.
-
Calculate $P(B)$.
-
Calculate $P(A|B)$.
-
Determine whether events $A$ and $B$ are compatible and whether they are independent. Reason your conclusions.
Let $A$ and $B$ be two events of a random experiment such that the conditional probabilities satisfy $P(A|B) = 0.25$ and $P(B|A) = 0.4$. If it is known that the…
Let $A$ and $B$ be two events of a random experiment such that the conditional probabilities satisfy $P(A|B) = 0.25$ and $P(B|A) = 0.4$. If it is known that the probability of their union is $P(A \cup B) = 0.55$, calculate the values of $P(A)$ and $P(B)$.
Extension: total probability with a tree diagram
Sometimes you know what happens inside each group and you want to know the overall probability. Imagine a delivery company with three zones: North ($40\%$ of shipments), Central ($35\%$), and South ($25\%$). The share of packages arriving late is $5\%$, $8\%$, and $12\%$ in each zone, respectively.
To see what happens, simulate with $1{,}000$ packages: $400$ go to the North, $350$ to the Central zone, and $250$ to the South. The late ones are $400(0.05)=20$, $350(0.08)=28$, and $250(0.12)=30$. In total, $78$ out of $1{,}000$.
A music app has two playlists. Playlist $A$ contains 8 pop songs and 4 rock songs. Playlist $B$ contains 5 pop songs and 7 rock songs. We roll a fair die: if a number…
A music app has two playlists. Playlist $A$ contains 8 pop songs and 4 rock songs. Playlist $B$ contains 5 pop songs and 7 rock songs. We roll a fair die: if a number less than 3 is rolled, the app plays a song at random from playlist $A$; otherwise, it plays one from playlist $B$.
-
Calculate the probability that the played song is a rock song.
-
Given that the played song turned out to be pop, what is the probability that it came from playlist $A$?
A logistics company delivers parcels in three districts: North ($40\%$), Central ($35\%$), and South ($25\%$). The percentage of delayed deliveries is $5\%$ in North,…
A logistics company delivers parcels in three districts: North ($40\%$), Central ($35\%$), and South ($25\%$). The percentage of delayed deliveries is $5\%$ in North, $8\%$ in Central, and $12\%$ in South.
-
If we select a parcel at random, what is the probability that it was delivered on time?
-
If a parcel was delivered late, what is the probability that it was destined for the South district?
We have two urns containing colored balls. Urn $U_1$ contains 4 white balls and 6 black balls. Urn $U_2$ contains 5 white balls and 3 black balls. A ball is drawn at…
We have two urns containing colored balls. Urn $U_1$ contains 4 white balls and 6 black balls. Urn $U_2$ contains 5 white balls and 3 black balls. A ball is drawn at random from urn $U_1$ and, without looking at its color, transferred to urn $U_2$. A ball is then drawn from urn $U_2$.
Calculate:
- a) The probability that the ball drawn from the second urn is white.
- b) Given that the ball drawn from the second urn is white, what is the probability that the ball transferred from the first to the second urn was black?
Extension: from effect to cause (Bayes' rule)
Now the other way around: a package arrived late. Which zone did it come from? This is a conditional probability using the usual definition, with total probability in the denominator.
In a health center, it is estimated that the probability of a patient having the flu is $P(G) = 0.15$. It is known that if a patient has the flu, the probability of them…
In a health center, it is estimated that the probability of a patient having the flu is $P(G) = 0.15$. It is known that if a patient has the flu, the probability of them having a fever is $0.90$, whereas if they do not have the flu, the probability of having a fever drops to $0.10$.
If a patient is chosen at random and has a fever, what name is given to the conditional probability $P(G|F)$ and which theorem is usually used to calculate it? (It is not necessary to carry out the final numerical calculation, only to identify the concepts).
A test to detect a security vulnerability in IT servers tests positive in $98\%$ of servers that are actually infected. However, it gives a "false positive" (positive in…
A test to detect a security vulnerability in IT servers tests positive in $98\%$ of servers that are actually infected. However, it gives a "false positive" (positive in healthy servers) in $2\%$ of cases. It is estimated that in a corporate network, $1\%$ of servers are infected.
-
If a server tests positive, what is the probability that it is actually infected?
-
Based on the previous result, interpret whether the test is reliable for widespread use in this network.
A courier company uses three different routes ($R_1, R_2, R_3$) to deliver parcels in a large city. $30\%$ of deliveries are assigned to route $R_1$, $45\%$ to route…
A courier company uses three different routes ($R_1, R_2, R_3$) to deliver parcels in a large city. $30\%$ of deliveries are assigned to route $R_1$, $45\%$ to route $R_2$, and the rest to route $R_3$. Past experience shows that the probabilities of a parcel arriving late on each route are $4\%$, $6\%$, and $2\%$, respectively.
If a parcel is selected at random and found to be delayed, what is the probability that it did NOT follow route $R_2$?
Back to the beginning: knowing that the sky is cloudy ($N$) restricts the sample space to those days, and the probability of rain ($L$) is updated to $P(L\mid N)=\dfrac{P(L\cap N)}{P(N)}$, normally greater than $P(L)$.