Back to homeMathematics · High School Year 3 · Physics-Math · Change subject
Start for free
Prep 3 Tech · Mathematics
Randomness and probability · Probability

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

Venn diagram showing how the sample space shrinks to the circle of event B when calculating the probability of A given B. entire sample space A B A∩B when conditioning on B, the world shrinks to circle B
Practice★☆☆Not started
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:

  1. a) The sample space associated with the origin of the participants.
  2. b) The probability that the winner is from Mexico City.
  3. c) The probability that the winner is an adult (18 or older).
120 MEXICO CITY 80 GUADALAJARA 50 MONTERREY Total: 250 60% < 18 years old 40% ≥ 18 years old
Solve
Practice★☆☆Not started
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:

  1. a) The probability that a student is enrolled in German and attends conversation classes.
  2. b) Given that a student is enrolled in German, what is the probability that they do not attend conversation classes?
Solve
Practice★★☆Not started
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.

E S (60%) D (45%) 40% 20% 25% 15%
Solve

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.

Two-stage tree diagram: first B with probability P(B), then A given B, and the intersection as the product. B: P(B) A given B: P(A|B) P(A∩B) = P(B)·P(A|B)
Practice★☆☆Not started
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:

  1. a) The probability that both balls are white.
  2. b) The probability that the first is black and the second is white.
  3. c) The probability that both balls are the same color.
1st Ball 2nd Ball Final Probability 5W, 3B W B W B W B 5/8 3/8 5/8 3/8 5/8 3/8 P(B,B) = ? ← a) P(B,N) = ? P(N,B) = ? ← b) P(N,N) = ? c) c) White Ball (W) Black Ball (B) Extracción with replacement
Solve
Practice★★☆Not started
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:

  1. That the second card is a King, given that the first card was an Ace.

  2. That the second card is a King, given that the first card was also a King.

  3. That both cards are face cards (Jack, Knight, or King).

  4. Given that the second card was a Coin (Gold), what is the probability that the first card was also a Coin?

Solve
Practice★☆☆Not started
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:

  1. a) Getting a sum equal to 7.
  2. b) Given that an even number was rolled on the first die, what is the probability that the sum is 7?
  3. 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)$.
Solve

Independent events

Comparison between independent events, whose circles overlap, and mutually exclusive events, shown as separate sets. A B they overlap: can happen together, but without influencing each other no overlap: mutually exclusive, P(A∩B)=0
Practice★☆☆Not started
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:

  1. a) $P(A \cap B)$
  2. b) $P(A \cup B)$
  3. c) $P(A|B)$
  4. d) $P(\bar{A} \cap \bar{B})$
Solve
Practice★★☆Not started
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:

  1. The probability that a component has both defects.

  2. The probability that it has at least one defect.

  3. The probability that it has no defects.

  4. Given that the component has a casing defect, what is the probability that it does not have a soldering defect?

Solve
Practice★★★Not started
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:

  1. a) The probability that the system functions correctly for a year.
  2. b) Given that the system functioned correctly, what is the probability that component $C_1$ failed?
Parallel system The system functions if C₁ or C₂ functions C₁ P(Failure C₁) = 0.05 C₂ P(Failure C₂) = 0.08 Input Output
Solve

Reading the conditional probability in a contingency table

Complete contingency table of 100 people with a dog and a cat: the conditional probability is the intersection cell divided by the total of the condition's column. Dog (D) No dog Total Cat (G) No cat Total 15 25 40 35 25 60 50 50 100 P(G|D) = 15 / 50 (total of D), not 15 / 100
Practice★☆☆Not started
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
  1. a) Complete the contingency table.
  2. b) If a person is chosen at random, what is the probability that they have both a dog and a cat?
  3. c) Given that the chosen person has a dog, what is the probability that they also have a cat?
Solve
Practice★★☆Not started
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.

  1. Organize the data in a contingency table.

  2. 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?

  3. If the selected athlete does not follow the diet, what is the probability that they do not undertake high-intensity training either?

Solve

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.

Venn diagram of De Morgan's laws: what lies outside both circles is the complement of the union. A B outside both circles: 1 − P(A∪B)
Practice★☆☆Not started
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:

  1. a) Uses TikTok or Instagram.
  2. b) Uses TikTok but not Instagram ($T - I$).
  3. c) Uses neither of the two platforms.
Venn diagram with sets T and I inside the sample space E; the intersection is 0,45 and the other regions are yet to be calculated E P(T) = 0.75 T P(I) = 0.60 I ? 0.45 ? ?
Solve
Practice★★☆Not started
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$.

  1. Calculate $P(A \cap B)$.

  2. Calculate $P(B)$.

  3. Calculate $P(A|B)$.

  4. Determine whether events $A$ and $B$ are compatible and whether they are independent. Reason your conclusions.

Solve
Practice★★★Not started
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)$.

Solve

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$.

Tree with three delivery zones and, in each one, the late branch with its probability. North 0.40 Central 0.35 South 0.25 late 0.05 late 0.08 late 0.12
Practice★★☆Not started
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$.

  1. Calculate the probability that the played song is a rock song.

  2. Given that the played song turned out to be pop, what is the probability that it came from playlist $A$?

Die Die < 3 1/3 Die ≥ 3 2/3 Playlist A 8F | 4C Playlist B 5F | 7C 8/12 4/12 5/12 7/12 Pop Rock Pop Rock
Solve
Practice★★☆Not started
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.

  1. If we select a parcel at random, what is the probability that it was delivered on time?

  2. If a parcel was delivered late, what is the probability that it was destined for the South district?

Parcel North Central South Late On time Late On time Late On time 0.40 0.35 0.25 0.05 0.95 0.08 0.92 0.12 0.88 P(T) = P(D₁)·P(T|D₁) + P(D₂)·P(T|D₂) + P(D₃)·P(T|D₃)
Solve
Practice★★★Not started
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:

  1. a) The probability that the ball drawn from the second urn is white.
  2. 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?
Urn U₁ 4 White, 6 Black Urn U₂ 5 White, 3 Black ? 1 ball transferred ? Draw
Solve

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.

Practice★☆☆Not started
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).

Solve
Practice★★☆Not started
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.

  1. If a server tests positive, what is the probability that it is actually infected?

  2. Based on the previous result, interpret whether the test is reliable for widespread use in this network.

Solve
Practice★★★Not started
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$?

Solve

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)$.

Summary

See all the exercises in this section