Exercises: Conditional probability
At a convention for gaming* fans, a latest-generation console is raffled among the attendees. 120 people from Madrid, 80 from Barcelona and 50 from Valencia take part.…
At a convention for gaming fans, a latest-generation console is raffled among the attendees. 120 people from Madrid, 80 from Barcelona and 50 from Valencia take part. In addition, it is known that 60 % of all participants are under 18 years old. If a winner is chosen at random, calculate:
- a) The sample space associated with the participants' origin.
- b) The probability that the winner is from Madrid.
- c) The probability that the winner is of legal age.
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.
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?
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})$
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?
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 colour.
In a health centre, it is estimated that the probability of a patient having flu is $P(G) = 0,15$. It is known that if a patient has flu, the probability of them having…
In a health centre, it is estimated that the probability of a patient having flu is $P(G) = 0,15$. It is known that if a patient has flu, the probability of them having a fever is $0,90$, whereas if they do not have 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).
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)$.
In a secondary school, data have been collected from 200 2nd year Bachillerato students regarding two events: $A$ (passing the Mathematics exam) and $B$ (regularly…
In a secondary school, data have been collected from 200 2nd year Bachillerato students regarding two events: $A$ (passing the Mathematics exam) and $B$ (regularly attending the school library). The records show that 120 attend the library, 90 pass the exam, and 60 do both.
Marcos wants to calculate the probability that a student passes Mathematics given that they attend the library, and writes on his exam:
$$P(A|B) = \frac{60}{200} = 0,30$$- a) Identify precisely which probability Marcos has actually calculated and explain the conceptual error in his approach with respect to the definition of conditional probability and the change of sample space.
- b) Correct the calculation by determining the correct value of $P(A|B)$.
- c) Formally justify whether, for this group of students, attending the library and passing Mathematics are statistically independent events.
According to data from the Directorate-General for Traffic (DGT) on obtaining a category B driving licence in a province, $40\%$ of applicants pass the practical driving…
According to data from the Directorate-General for Traffic (DGT) on obtaining a category B driving licence in a province, $40\%$ of applicants pass the practical driving test on their first attempt (event $A$). On the other hand, $30\%$ of applicants take an intensive simulator course beforehand (event $S$), and it is known that $20\%$ of all applicants take the simulator course and also pass on their first attempt.
- a) Model the situation by defining the events with their corresponding probability notation and state the values of $P(A)$, $P(S)$, and $P(A \cap S)$.
- b) If an applicant who took the simulator course is chosen at random, calculate the probability that they pass the practical test on their first attempt.
- c) In light of the results, does taking the simulator course alter the probability of passing on the first attempt, or are they independent events? Justify your answer by comparing $P(A|S)$ with $P(A)$.
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.
A sports performance centre analyses 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 centre analyses 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.
-
Organise 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?
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$?
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 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.
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 picture 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?
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?
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.
In a livestock-farming region, a diagnostic test is applied to detect a bacterial infection whose prevalence is very low: only $2\%$ of the livestock is infected (event…
In a livestock-farming region, a diagnostic test is applied to detect a bacterial infection whose prevalence is very low: only $2\%$ of the livestock is infected (event $E$). The veterinary test has a sensitivity of $95\%$ (probability of testing positive when infected, $P(+|E) = 0,95$) and a false positive rate of $5\%$ (probability of testing positive in a healthy animal, $P(+|\overline{E}) = 0,05$).
- a) Before calculating anything, estimate intuitively: if an animal is chosen at random and its test is positive, do you think the probability that it is truly infected will be above $80\%$, close to $50\%$, or below $30\%$? Write your estimate down, justifying your first impression in one or two lines.
- b) Model the problem using the law of total probability and rigorously calculate the conditional probability $P(E|+)$.
- c) Compare the obtained mathematical result with your prior estimate. Justify why the result is counter-intuitive for many people and explain how the overall prevalence of the infection conditions the final reliability of a positive result.
In the university entrance examinations (PAU) of a university district, enrolments in two modality subjects are analysed: Technical Drawing ($D$) and Physics ($F$). From…
In the university entrance examinations (PAU) of a university district, enrolments in two modality subjects are analysed: Technical Drawing ($D$) and Physics ($F$). From the official records, it is confirmed that the probability of a student choosing Technical Drawing is $P(D) = 0,35$ and the probability of choosing at least one of the two subjects is $P(D \cup F) = 0,74$.
- a) Set up an equation and determine the exact value that the prior probability of enrolling in Physics, $P(F)$, should have in order for the choice of both subjects to be completely independent.
- b) The reality of the district shows that they are not independent and that the conditional probability of choosing Drawing given that Physics has been chosen is $P(D|F) = 0,40$. Calculate the actual probability of enrolling in Physics, $P(F)$, and the inverse conditional probability $P(F|D)$.
- c) Using the data from section b), construct the complete contingency table of probabilities for events $D$, $\overline{D}$, $F$, and $\overline{F}$.
In a biotechnology laboratory, the resistance of a bacterium to two types of antibiotics, $A$ and $B$, is investigated. It is known that the probability of the bacterium…
In a biotechnology laboratory, the resistance of a bacterium to two types of antibiotics, $A$ and $B$, is investigated. It is known that the probability of the bacterium being resistant to antibiotic $A$ is $P(A) = 0,65$, and the probability of it being resistant to antibiotic $B$ is $P(B) = 0,48$. Furthermore, it has been determined that the probability of it being resistant to neither antibiotic is $12\%$.
Calculate, giving reasons:
- a) The probability that the bacterium is resistant to $A$ given that it is resistant to $B$.
- b) The probability that it is resistant to only one of the two antibiotics.
- c) Are the events "being resistant to $A$" and "being resistant to $B$" independent? Justify your answer with calculations.
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$?
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?
In an esports tournament, a player must pass two stages. The probability of passing the first stage is $0,7$. If they pass the first stage, the probability of passing…
In an esports tournament, a player must pass two stages. The probability of passing the first stage is $0,7$. If they pass the first stage, the probability of passing the second stage is $0,5$. However, if they fail the first stage, they have a second-chance playoff where the probability of advancing directly to the final (skipping the second stage) is only $0,2$.
- a) Calculate the probability that the player reaches the final (either by passing both stages or via the second-chance playoff).
- b) Given that the player reached the final, what is the probability that they achieved this through the second-chance playoff?
We have two urns containing coloured 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 coloured 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 colour, 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?
A diagnostic test was carried out to detect a vulnerability in management software. $5\%$ of the analysed applications contain this vulnerability. The test gives a…
A diagnostic test was carried out to detect a vulnerability in management software. $5\%$ of the analysed applications contain this vulnerability. The test gives a positive result in $98\%$ of the cases where the vulnerability is present, but it also gives $2\%$ false positives (returns positive when the application is secure).
- a) If the test gives a positive result, what is the probability that the application actually has the vulnerability?
- b) If the test gives a negative result, what is the probability that the application is actually secure?
- c) Interpret the results: is the test more reliable for confirming the vulnerability or for ruling it out?
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)$.
At a high-performance sports centre, $40\%$ of the athletes train in swimming ($N$), $30\%$ train in cycling ($C$), and the rest train in running ($R$). The probability…
At a high-performance sports centre, $40\%$ of the athletes train in swimming ($N$), $30\%$ train in cycling ($C$), and the rest train in running ($R$). The probability of suffering a muscle injury during the season is $0,15$ for swimmers, $0,20$ for cyclists, and $0,35$ for runners.
- a) Determine the probability that a randomly chosen athlete suffers a muscle injury.
- b) Given that an athlete has not suffered any injury, what is the probability that their specialism is swimming?
- c) Are the events "training in cycling" and "suffering an injury" independent? Prove it.
A cybersecurity report on Spanish small and medium-sized enterprises evaluates the effectiveness of a firewall against external intrusions. Three facts are known: $8\%$…
A cybersecurity report on Spanish small and medium-sized enterprises evaluates the effectiveness of a firewall against external intrusions. Three facts are known:
-
$8\%$ of enterprises experience a serious intrusion attempt per month (event $I$).
-
If an enterprise experiences an intrusion attempt, the firewall triggers an alert with probability $P(A|I) = 0,90$.
-
If the enterprise does not experience any intrusion, there is a $3\%$ probability of a false alarm due to system glitches, that is, $P(A|\overline{I}) = 0,03$.
The management team needs to know the probability that, an alert having sounded, it is actually a false alarm ($P(\overline{I}|A)$), as well as the probability that the system remains silent and there is no intrusion ($P(\overline{A} \cap \overline{I})$).
- a) Solve the problem using two different methods:
-
Method 1: Tree diagram and calculation with formal conditional probability formulas and the law of total probability.
-
Method 2: Contingency table with absolute frequencies projected onto a hypothetical population of $10.000$ enterprises.
- b) Analyse and compare both methods: which of the two more effectively reduces the risk of confusing $P(A|\overline{I})$ with $P(\overline{I}|A)$ when interpreting the results? Justify your answer by arguing how each technique represents the new reduced sample space.
From the microdata of the Economically Active Population Survey (EPA) in an autonomous community, two employment events in the 18 to 24 age bracket are studied: pursuing…
From the microdata of the Economically Active Population Survey (EPA) in an autonomous community, two employment events in the 18 to 24 age bracket are studied: pursuing formal education ($E$) and having paid employment ($T$). The estimated rates are $P(E) = 0,55$ and $P(T) = 0,30$.
A student states: "Since studying full-time and working are hardly compatible situations, the events are mutually exclusive, and therefore they are also independent because one does not depend on the other."
- a) Formally prove that two events $A$ and $B$ with non-zero probabilities ($P(A) > 0$ and $P(B) > 0$) can never be both mutually exclusive and independent at the same time. Explain the student's conceptual error in words.
- b) If the survey data indicate that $40\%$ of young people neither study nor work ($P(\overline{E} \cap \overline{T}) = 0,40$), calculate the probability that a young person is employed given that they are pursuing studies, $P(T|E)$, by applying De Morgan's laws and the properties of conditional probability.
- c) In light of the value of $P(T|E)$ compared to $P(T)$, determine with reasoning whether pursuing studies favours, hinders, or is independent of the probability of being employed in that population.