Exercises: Conditional probability
In a Spanish deck of 40 cards (4 suits with 10 cards each: jack, knight and king are the face cards of each suit), one card is drawn at random. We consider the events…
In a Spanish deck of 40 cards (4 suits with 10 cards each: jack, knight and king are the face cards of each suit), one card is drawn at random. We consider the events $A$: "drawing a king" and $B$: "drawing a face card" (jack, knight or king).
Calculate the probability that the card is a king given that a face card has come up, that is, determine $P(A|B)$.
A survey was conducted among 100 1st Baccalaureate students regarding their preference between two fields of study. The data is presented in the following contingency…
A survey was conducted among 100 1st Baccalaureate students regarding their preference between two fields of study. The data is presented in the following contingency table:
| Science ($C$) | Arts ($L$) | Total | |
|---|---|---|---|
| Girls ($M$) | 40 | 25 | 65 |
| Boys ($H$) | 15 | 20 | 35 |
| Total | 55 | 45 | 100 |
If we choose a student at random and she turns out to be a girl, what is the probability that she prefers Arts? Calculate $P(L|M)$.
Given two events $A$ and $B$ of a random experiment, it is known that the probability of their intersection is $P(A \cap B) = 0,12$ and that the probability of event $B$…
Given two events $A$ and $B$ of a random experiment, it is known that the probability of their intersection is $P(A \cap B) = 0,12$ and that the probability of event $B$ is $P(B) = 0,4$. Calculate the probability of $A$ occurring given that $B$ has occurred.
An urn contains 5 blue balls and 3 red balls. We draw two balls consecutively with replacement (we put the first ball back into the urn before drawing the second). a)…
An urn contains 5 blue balls and 3 red balls. We draw two balls consecutively with replacement (we put the first ball back into the urn before drawing the second).
- a) Represent the experiment with a tree diagram, indicating the probability on each branch.
- b) Calculate the probability that the second ball is red given that the first one was blue. Are the events dependent or independent? Justify your answer.
In a group of friends, $60\%$ use Spotify ($S$), $40\%$ use Netflix ($N$) and $20\%$ use both platforms. If we choose a person who we know uses Netflix, what is the…
In a group of friends, $60\%$ use Spotify ($S$), $40\%$ use Netflix ($N$) and $20\%$ use both platforms. If we choose a person who we know uses Netflix, what is the probability that they also use Spotify?
A professional dart thrower hits the center of the bullseye $80\%$ of the time. If he makes two independent throws, calculate the probability that: a) He hits the second…
A professional dart thrower hits the center of the bullseye $80\%$ of the time. If he makes two independent throws, calculate the probability that:
- a) He hits the second throw given that he hit the first.
- b) He hits both throws in a row.
You can use a tree diagram of two throws, with the branches «hit» and «miss» for each one.
At a language centre, $30\%$ of the students study French ($F$). Of these, $60\%$ are Baccalaureate students ($B$). If we select a student at random from the centre's…
At a language centre, $30\%$ of the students study French ($F$). Of these, $60\%$ are Baccalaureate students ($B$). If we select a student at random from the centre's list, what is the probability that they study French and are a Baccalaureate student? Use the conditional probability formula: $P(F \cap B) = P(F) \cdot P(B|F)$.
We draw two cards from a Spanish deck without replacement. Calculate the probability that the second card is an ace, given that the first card drawn was the ace of coins.
We draw two cards from a Spanish deck without replacement. Calculate the probability that the second card is an ace, given that the first card drawn was the ace of coins.
In a survey on digital consumption conducted among 200 young people in a town, it is recorded that 120 regularly watch series on streaming platforms ($S$) and 80 play…
In a survey on digital consumption conducted among 200 young people in a town, it is recorded that 120 regularly watch series on streaming platforms ($S$) and 80 play online video games daily ($V$). In addition, 48 young people engage in both activities ($S \cap V$).
To calculate "the probability that a young person plays video games given that they regularly watch series", Lucas writes on his exam:
$$P(V|S) = \frac{P(S \cap V)}{P(V)} = \frac{48/200}{80/200} = \frac{48}{80} = 0,6$$- a) Identify precisely the two conceptual errors made by Lucas in his formula and in the interpretation of the conditioning event.
- b) Explain how the sample space is reduced when imposing the condition "regularly watch series" and what the correct denominator of the conditional probability must be.
- c) Correct the calculation of $P(V|S)$ and also calculate the probability that a randomly chosen young person who does not play video games does not regularly watch series either, that is, $P(S^c|V^c)$.
In a secondary school, $60\,\%$ of 1st-year Bachillerato students take the Humanities and Social Sciences track ($H$) and $40\,\%$ take the Science and Technology track…
In a secondary school, $60\,\%$ of 1st-year Bachillerato students take the Humanities and Social Sciences track ($H$) and $40\,\%$ take the Science and Technology track ($C$). Among the Humanities and Social Sciences students, $70\,\%$ regularly use school transport ($T$), while among the Science students only $35\,\%$ use it.
- a) Two tools are proposed to organize this information before operating: a weighted tree diagram or a contingency table based on a hypothetical total of 100 students. Compare the suitability of both methods and justify which one is more direct based on how the problem data are structured (prior and successive conditional probabilities).
- b) Using the method you have selected, calculate the probability that a randomly chosen student uses school transport, $P(T)$.
- c) If a student who does not use school transport is chosen at random, what is the probability that they belong to the Science and Technology track?
In a school in Madrid, a study was carried out on the leisure habits of $100$ 1st Baccalaureate students. The data were collected in the following contingency table,…
In a school in Madrid, a study was carried out on the leisure habits of $100$ 1st Baccalaureate students. The data were collected in the following contingency table, classifying students by gender and their preferred social network (Instagram or TikTok):
| Instagram ($I$) | TikTok ($T$) | Total | |
|---|---|---|---|
| Girls ($M$) | $35$ | $25$ | $60$ |
| Boys ($H$) | $15$ | $25$ | $40$ |
| Total | $50$ | $50$ | $100$ |
If we choose a student at random, calculate the following probabilities using conditional probability notation:
- a) That they prefer TikTok, given that they are a girl.
- b) That they are a boy, given that their preferred social network is Instagram.
- c) Are the events "being a boy" ($H$) and "preferring Instagram" ($I$) independent? Justify your answer by comparing $P(I/H)$ with $P(I)$.
A toolbox contains $12$ LED light bulbs, of which $4$ are defective. If we draw two light bulbs from the box consecutively and without replacement, calculate the…
A toolbox contains $12$ LED light bulbs, of which $4$ are defective. If we draw two light bulbs from the box consecutively and without replacement, calculate the probability of the following events:
- a) That the second light bulb is defective, given that the first one drawn worked correctly.
- b) That both light bulbs are defective.
- c) That at least one of the two light bulbs works correctly.
In an e-sports league, a team has a probability of winning a match of $70\,\%$ if it plays on its home server ($L$), but this probability drops to $40\,\%$ if it plays…
In an e-sports league, a team has a probability of winning a match of $70\,\%$ if it plays on its home server ($L$), but this probability drops to $40\,\%$ if it plays on an external server ($E$). It is known that $60\,\%$ of the matches are played at home.
- a) Represent the situation using a tree diagram, indicating the probability on each branch.
- b) If the team won the last match, what is the probability that it played on its home server?
- c) What is the total probability that the team wins any given match?
Let $A$ and $B$ be two events in a random experiment such that $P(A) = 0,5$, $P(B) = 0,7$ and $P(A \cup B) = 0,85$. a) Calculate $P(A \cap B)$. b) Find the probability…
Let $A$ and $B$ be two events in a random experiment such that $P(A) = 0,5$, $P(B) = 0,7$ and $P(A \cup B) = 0,85$.
- a) Calculate $P(A \cap B)$.
- b) Find the probability that $A$ occurs given that $B$ has occurred.
- c) Determine whether the events $A$ and $B$ are compatible and whether they are independent.
A medical study indicates that the probability of a person in a given population having a spring allergy is $0,15$. A test has been developed to detect it, but it is not…
A medical study indicates that the probability of a person in a given population having a spring allergy is $0,15$. A test has been developed to detect it, but it is not perfect:
-
If a person has the allergy, the test comes back positive in $95\%$ of cases.
-
If a person does not have the allergy, the test comes back positive (false positive) in $4\%$ of cases.
If a person is chosen at random and the test is positive, what is the probability that they actually have the allergy?
At a language academy, $40\%$ of the students study French ($F$), $30\%$ study German ($G$) and the rest study Italian ($I$). It is known that the percentage of students…
At a language academy, $40\%$ of the students study French ($F$), $30\%$ study German ($G$) and the rest study Italian ($I$). It is known that the percentage of students who pass the final exam is $60\%$ in French, $50\%$ in German and $80\%$ in Italian.
- a) If we choose a student who has passed the exam, what is the probability that they study German?
- b) If we choose a student at random, what is the probability that they have not passed the exam?
Two fair six-sided dice numbered $1$ to $6$ are rolled. We consider the following events: $S$: "The sum of the scores obtained is equal to $7$". $A$: "An even number is…
Two fair six-sided dice numbered $1$ to $6$ are rolled. We consider the following events:
-
$S$: "The sum of the scores obtained is equal to $7$".
-
$A$: "An even number is rolled on the first die".
Calculate:
- a) The sample space of the sum of the scores and the probability of event $S$.
- b) The probability that the sum is $7$ given that an even number was rolled on the first die, $P(S/A)$.
- c) Does the fact that the first die is even affect the probability that the sum is $7$? Justify whether the events are dependent or independent.
On a streaming platform, $20\%$ of users prefer horror movies, $50\%$ prefer comedies and $30\%$ prefer dramas. The data analysis department has observed that the…
On a streaming platform, $20\%$ of users prefer horror movies, $50\%$ prefer comedies and $30\%$ prefer dramas. The data analysis department has observed that the probability of a user finishing a whole movie depends on the genre:
-
Horror: $0,6$
-
Comedy: $0,8$
-
Drama: $0,7$
If we select a user at random and see that they have left a movie halfway through (they have not finished it), what is the probability that the movie was a horror movie?
An online bank in Spain applies a security algorithm to detect unauthorized or fraudulent access ($F$) to its clients' accounts. From cybersecurity historical records,…
An online bank in Spain applies a security algorithm to detect unauthorized or fraudulent access ($F$) to its clients' accounts. From cybersecurity historical records, it is known that only $0,5\,\%$ of logins correspond to fraud attempts ($P(F) = 0,005$). When a fraudulent attempt occurs, the system triggers an alarm with a probability of $96\,\%$ ($P(+|F) = 0,96$). However, when access is legitimate ($F^c$), the system generates a false alarm with a probability of $2\,\%$ ($P(+|F^c) = 0,02$).
- a) Estimate: Before performing any mathematical calculation, if the security alarm sounds for an arbitrary login (event $+$), do you think the probability that it is actually fraud will exceed $50\,\%$ or will be much lower? Write your intuitive estimate reasoning why you think that.
- b) Calculate: Apply the law of total probability to find the overall probability that the alarm goes off, $P(+)$, and Bayes' theorem to determine the exact probability that an access is truly a fraud knowing that the alarm has been triggered, $P(F|+)$.
- c) Check and reflect: Compare the exact result with your initial estimate. Why does the mathematical result clash with the intuition of most people? Explain what decisive impact the very low prevalence of fraud has on the obtained result.
Using microdata from the Economically Active Population Survey (EPA) of the National Statistics Institute (INE), the situation of young people aged 18 to 24 in an…
Using microdata from the Economically Active Population Survey (EPA) of the National Statistics Institute (INE), the situation of young people aged 18 to 24 in an autonomous community is modeled according to two variables: being enrolled in formal education ($E$) and having paid employment ($T$).
It is known that $70\,\%$ of these young people are studying ($P(E) = 0,70$). Among those pursuing studies, the probability of combining them with paid employment is $0,25$. On the other hand, among those not studying, the probability of having a job rises to $60\,\%$.
- a) Model the situation by clearly defining the events and constructing a tree diagram or a table showing all the corresponding marginal, conditional, and intersection probabilities.
- b) Find the probability that an 18-to-24-year-old chosen at random in that community is working.
- c) If a young person who does not have paid employment is selected at random, calculate the probability that they are studying.
- d) Formally determine whether the events "studying" and "having paid employment" are independent. Briefly interpret the meaning of your conclusion in socioeconomic terms.
Let $A$ and $B$ be two events in the same random experiment such that the following probabilities are known: $P(A^C \cup B^C) = 0,8$ $P(A^C | B) = 0,5$…
Let $A$ and $B$ be two events in the same random experiment such that the following probabilities are known:
-
$P(A^C \cup B^C) = 0,8$
-
$P(A^C | B) = 0,5$
-
$P(A \cup B) = 0,75$
Calculate, justifying each step using the properties of probability:
- a) $P(A \cap B)$
- b) $P(B)$
- c) $P(A)$
- d) Determine with reasoning whether the events $A$ and $B$ are independent.
In a cybersecurity laboratory, an artificial intelligence algorithm analyses emails to detect phishing*. It is known that: $5\%$ of the emails received by the company…
In a cybersecurity laboratory, an artificial intelligence algorithm analyses emails to detect phishing. It is known that:
-
$5\%$ of the emails received by the company are scam attempts (phishing).
-
If an email is phishing, the algorithm correctly identifies it as "suspicious" in $98\%$ of cases.
-
If an email is legitimate, the algorithm makes a mistake and marks it as "suspicious" in $3\%$ of cases (false positive).
If an employee receives a "suspicious email" alert in their inbox:
- a) What is the actual probability that the email is indeed a phishing attempt?
- b) If the algorithm indicates that the email is "safe", what is the probability that it is a mistake and actually phishing?
We have two urns with the following composition: Urn A: 4 red balls and 6 blue balls. Urn B: 7 red balls and 3 blue balls. The experiment consists of rolling a fair…
We have two urns with the following composition:
-
Urn A: 4 red balls and 6 blue balls.
-
Urn B: 7 red balls and 3 blue balls.
The experiment consists of rolling a fair six-sided die. If a prime number is rolled, we draw a ball from Urn A and place it into Urn B without looking at its colour; then, we draw a ball from Urn B. If a non-prime number is rolled, we draw a ball directly from Urn B.
Calculate the probability that the final ball drawn from Urn B is red.
A streaming platform uses three servers ($S_1, S_2, S_3$) to distribute its content. $40\%$ of the traffic is managed from $S_1$, $35\%$ from $S_2$ and the rest from…
A streaming platform uses three servers ($S_1, S_2, S_3$) to distribute its content. $40\%$ of the traffic is managed from $S_1$, $35\%$ from $S_2$ and the rest from $S_3$. Due to network load, playback glitches occur with the following probabilities:
-
On server $S_1$, the probability of a glitch is $2\%$.
-
On server $S_2$, the probability of a glitch is $5\%$.
-
On server $S_3$, the probability of a glitch is $8\%$.
- a) If a user is watching a series, what is the probability that they experience a glitch?
- b) If a user calls technical support reporting a glitch, what is the probability that their connection is being served by server $S_3$?
In an Esports competition, a League of Legends* player has a probability of victory of $70\%$ if he chooses his main character (Main*). If he does not choose it, his…
In an Esports competition, a League of Legends player has a probability of victory of $70\%$ if he chooses his main character (Main). If he does not choose it, his probability of victory drops to $45\%$. The matchmaking system allows the player to get his main character $60\%$ of the time.
- a) Calculate the probability that the player wins his next match.
- b) Given that the player lost the match, what is the probability that he was not able to play with his main character?
- c) Are the events "winning the match" and "playing with the main character" independent? Justify your answer by comparing probabilities.
A study is carried out on the activities of students at a school in Madrid. The data show that: $80\%$ of students study a second language ($I$). $60\%$ of students…
A study is carried out on the activities of students at a school in Madrid. The data show that:
-
$80\%$ of students study a second language ($I$).
-
$60\%$ of students participate in a school sports team ($D$).
-
$30\%$ of those studying a second language do not participate in any sports team.
We choose a student at random. Calculate:
- a) The probability that they do both activities.
- b) Given that they participate in a sports team, the probability that they also study a second language.
- c) The probability that they do neither of the two activities.
A logistics company has two routes for delivering orders in the city centre. Route A is used $70\%$ of the time and Route B the remaining $30\%$. Due to traffic, on…
A logistics company has two routes for delivering orders in the city centre. Route A is used $70\%$ of the time and Route B the remaining $30\%$.
-
Due to traffic, on Route A the delivery driver arrives late on $15\%$ of days.
-
On Route B, the delivery driver arrives late on $25\%$ of days.
On a given day, the manager notes that an order arrived late. The delivery driver claims: "If I had taken Route A, the probability of arriving on time would have been greater than the probability of having taken Route A today given that I arrived late". Prove mathematically whether the driver's statement is true or false by calculating both probabilities.
In a multiple-choice exam, a student knows the correct answer to a question with probability $p$ and guesses it at random with probability $1-p$. Each question has $k$…
In a multiple-choice exam, a student knows the correct answer to a question with probability $p$ and guesses it at random with probability $1-p$. Each question has $k$ answer options, only one of which is correct.
- a) Show that the probability that the student answers the question correctly is $\frac{1 + (k-1)p}{k}$.
- b) Given that the student answered correctly, what is the probability that they actually knew the answer and did not guess it at random? Express the result in terms of $p$ and $k$.
- c) If a question has 4 options ($k=4$) and the student has a $50\%$ probability of knowing the answer ($p=0,5$), calculate the numerical value of the previous part and interpret it.
A microcredit institution for entrepreneurs in Spain finances projects from two economic sectors: technology projects ($T$) and traditional services sector projects…
A microcredit institution for entrepreneurs in Spain finances projects from two economic sectors: technology projects ($T$) and traditional services sector projects ($S$). In its current portfolio of granted loans, an unknown proportion $p$ corresponds to the technology sector ($0 < p < 1$) and the rest, $1 - p$, to the services sector.
Due to the volatility of business models, the probability of default or delinquency ($M$) in the technology sector is $15\,\%$ ($P(M|T) = 0,15$), while in the services sector the probability of default is $6\,\%$ ($P(M|S) = 0,06$).
- a) Obtain a simplified algebraic expression in terms of $p$ for the overall probability that a randomly chosen loan defaults, $P(M)$.
- b) The internal audit committee reviews at random a loan that has defaulted. Determine the exact value of the proportion $p$ for which the probability that said defaulted loan comes from the technology sector is exactly $75\,\%$.
- c) Set up and solve an inequality to determine in which interval of values the proportion $p$ must lie if the institution requires that, for any defaulted loan, it is more likely to come from the services sector than from the technology sector.
To plan alerts for extreme weather events (such as DANAs or severe storms) along the Mediterranean coast, the State Meteorological Agency (AEMET) and Civil Protection…
To plan alerts for extreme weather events (such as DANAs or severe storms) along the Mediterranean coast, the State Meteorological Agency (AEMET) and Civil Protection study the occurrence of days with torrential rain ($L$, more than $100\text{ mm}$ in 12 hours).
During the autumn months, the historical probability that torrential rain occurs on any given day in the region is only $3\,\%$ ($P(L) = 0,03$).
The numerical prediction model triggers an orange warning ($A$) on $85\,\%$ of the days when torrential rain actually occurs ($P(A|L) = 0,85$), but generates false alarms by triggering an orange warning on $4\,\%$ of the days when it does not rain torrentially ($P(A|L^c) = 0,04$).
The municipal Emergency Coordination Center is debating between two criteria to decree the suspension of transport and in-person classes when AEMET issues an orange warning:
-
Criterion 1 (Precautionary principle): suspend activity if the posterior probability of torrential rain given a warning exceeds $35\,\%$.
-
Criterion 2 (Avoidance of socioeconomic paralysis): suspend activity only if it is more likely that it rains torrentially than that it does not, given that the warning is active.
- a) Model the experiment by calculating the total probability that an orange warning is triggered on any autumn day, $P(A)$.
- b) If AEMET triggers an orange warning, calculate the probability that torrential rain is actually recorded, $P(L|A)$, and the probability that it is a false alarm, $P(L^c|A)$.
- c) Apply and evaluate both criteria: would activity be suspended under Criterion 1? What about under Criterion 2? Reason why Criterion 2 is inadequate in the practical management of catastrophes with a low base rate, and what ethical-probabilistic dilemma the presence of false positives poses in public decision-making.