Back to homeMathematics · 2nd Bach. Social Sciences · Change subject
Start for free
Notes

Exercises: Bayes' theorem

Practice★☆☆
On a streaming platform, $60\,\%$ of the series are original productions, whereas the rest are from external production companies. It is known that $15\,\%$ of the…

On a streaming platform, $60\,\%$ of the series are original productions, whereas the rest are from external production companies. It is known that $15\,\%$ of the original series are sci-fi, whereas for external series this percentage rises to $25\,\%$. If we choose a series at random and it turns out to be sci-fi, what is the probability that it is an original production of the platform?

0,60 0,40 0,15 0,85 0,25 0,75 Original External Sci-Fi Others Sci-Fi Others
Solve
Practice★☆☆
A trainer brand manufactures its models in two different factories: $70\,\%$ in factory $A$ and $30\,\%$ in factory $B$. Quality control has detected that $2\,\%$ of the…

A trainer brand manufactures its models in two different factories: $70\,\%$ in factory $A$ and $30\,\%$ in factory $B$. Quality control has detected that $2\,\%$ of the trainers from factory $A$ have a stitching defect, whereas in factory $B$ defects appear in $5\,\%$ of production. A customer buys a pair of trainers and discovers that they have a stitching defect. Calculate the probability that they were manufactured in factory $B$.

Solve
Practice★☆☆
In a secondary school, $40\,\%$ of Year 13 students are in the Science stream and $60\,\%$ in Social Sciences. It has been observed that $85\,\%$ of Science students and…

In a secondary school, $40\,\%$ of Year 13 students are in the Science stream and $60\,\%$ in Social Sciences. It has been observed that $85\,\%$ of Science students and $90\,\%$ of Social Sciences students pass English. If we choose a student at random who is known to have passed English, what is the probability that they belong to the Science stream?

Solve
Practice★☆☆
An influencer splits their posts between two social networks: Instagram ($75\,\%$) and TikTok ($25\,\%$). It is known that $40\,\%$ of their photos on Instagram receive…

An influencer splits their posts between two social networks: Instagram ($75\,\%$) and TikTok ($25\,\%$). It is known that $40\,\%$ of their photos on Instagram receive more than 10 000 likes, whereas on TikTok only $20\,\%$ of their videos exceed that figure. If we receive a notification that one of their posts has exceeded 10 000 likes, what is the probability that it is a TikTok video?

Solve
Practice★☆☆
An email filter automatically classifies messages as spam. The filter correctly marks $98\,\%$ of emails that are truly spam as spam. However, it also sends $4\,\%$ of…

An email filter automatically classifies messages as spam. The filter correctly marks $98\,\%$ of emails that are truly spam as spam. However, it also sends $4\,\%$ of legitimate emails to the spam folder. It is estimated that $10\,\%$ of incoming email to an inbox is spam. If a randomly chosen email has been marked as spam, calculate the probability that it is actually spam.

Population True Status Outcome Joint Probability 0,10 0,90 0,98 0,02 0,04 0,96 Spam (S) Normal (N) Flagged (+) Clean (-) Flagged (+) Clean (-) P(S ∩ +) = 0,10 × 0,98 P(S ∩ -) = 0,10 × 0,02 P(N ∩ +) = 0,90 × 0,04 P(N ∩ -) = 0,90 × 0,96 P(Spam | Marcado) = ? Bayes' theorem
Solve
Practice★☆☆
A video game shop sells consoles from two brands: "N-Switch" and "PlayPro". $65\,\%$ of sales are PlayPro and the rest are N-Switch. Technical support reports that…

A video game shop sells consoles from two brands: "N-Switch" and "PlayPro". $65\,\%$ of sales are PlayPro and the rest are N-Switch. Technical support reports that $3\,\%$ of PlayPro consoles are returned due to a manufacturing defect, whereas for N-Switch consoles the return percentage is $2\,\%$. If a customer returns a defective console, what is the probability that it is a PlayPro?

Solve
Practice★☆☆
To get to the centre, a student can go by bus ($80\,\%$ of the time) or by bicycle ($20\,\%$). When travelling by bus, they arrive late $10\,\%$ of the time due to…

To get to the centre, a student can go by bus ($80\,\%$ of the time) or by bicycle ($20\,\%$). When travelling by bus, they arrive late $10\,\%$ of the time due to traffic. When travelling by bicycle, they only arrive late $5\,\%$ of the time. If on a given day the student arrives late for class, calculate the probability that they travelled by bus.

Solve
Practice★☆☆
In a software development company, $70\,\%$ of the programmers use the Python language and $30\,\%$ use Java. It is estimated that $10\,\%$ of the code written in Python…

In a software development company, $70\,\%$ of the programmers use the Python language and $30\,\%$ use Java. It is estimated that $10\,\%$ of the code written in Python contains critical syntax errors, while in Java this percentage is $15\,\%$. If a critical syntax error is detected in a piece of code, what is the probability that it was written in Python?

Solve
Practice★☆☆
In a large Spanish city, $70\,\%$ of the people who commute to work daily use the metro and $30\,\%$ use the city bus. Mobility records show that the metro experiences…

In a large Spanish city, $70\,\%$ of the people who commute to work daily use the metro and $30\,\%$ use the city bus. Mobility records show that the metro experiences significant delays on $10\,\%$ of its trips, whereas the bus is delayed on $40\,\%$ of occasions due to traffic. A person arrives late to their workplace today.

  1. a) Before performing any numerical calculation, make a qualitative and reasoned estimate: knowing that the metro carries more than twice as many passengers as the bus, but the bus fails four times more often than the metro, do you think the probability that the delayed person traveled by bus will be less than, equal to, or greater than $0{,}5$? Justify your conjecture.
  2. b) Apply Bayes' theorem to calculate the exact probability that this person traveled by bus.
  3. c) Compare the numerical result obtained with your initial estimate and assess whether it confirms or contradicts your intuition.
Solve
Practice★☆☆
In a high school, $40\,\%$ of the 2nd year Bachillerato students are in the Humanities and Social Sciences track and $60\,\%$ are in the Science and Technology track. In…

In a high school, $40\,\%$ of the 2nd year Bachillerato students are in the Humanities and Social Sciences track and $60\,\%$ are in the Science and Technology track. In the ordinary session of the EBAU, $85\,\%$ of the Social Sciences students and $90\,\%$ of the Science students pass. When choosing at random a person who has passed this exam, we want to calculate the probability that they come from Humanities and Social Sciences.

Mateo writes on his exam:

$$P(\text{Social Sciences} \mid \text{Pass}) = \frac{0{,}40 \cdot 0{,}85}{0{,}85 + 0{,}90} = \frac{0{,}34}{1{,}75} \approx 0{,}1943$$
  1. a) Identify and explain in detail the conceptual error made by Mateo in the denominator. Why is directly adding $0{,}85 + 0{,}90$ incorrect from the point of view of the law of total probability?
  2. b) State the correct expression according to Bayes' theorem and calculate the exact value of the probability as an irreducible fraction and rounded to four decimal places.
Solve
Practice★★☆
At a health centre, a study is being conducted on the efficacy of a diagnostic test for a food allergy that affects $8\,\%$ of the youth population. Clinical data…

At a health centre, a study is being conducted on the efficacy of a diagnostic test for a food allergy that affects $8\,\%$ of the youth population. Clinical data indicate that if a person suffers from the allergy, the test gives a positive result in $95\,\%$ of cases. On the other hand, if the person does not suffer from the allergy, the test gives a "false positive" (positive result without being ill) in $4\,\%$ of instances. If a young person is chosen at random and their test result is positive, calculate the probability that they actually suffer from that allergy.

Allergy (A) Healthy (A') Test + Test - Test + Test - 0,08 0,92 0,95 0,05 0,04 0,96 0,08 × 0,95 = 0,076 0,92 × 0,04 = 0,0368
Solve
Practice★★☆
A social network uses an artificial intelligence algorithm to detect hate speech comments. It is known that $5\,\%$ of published comments are actually inappropriate. The…

A social network uses an artificial intelligence algorithm to detect hate speech comments. It is known that $5\,\%$ of published comments are actually inappropriate. The algorithm correctly identifies $98\,\%$ of comments that are truly inappropriate as "inappropriate". However, it wrongly labels $3\,\%$ of respectful comments as "inappropriate". If the system has just blocked a comment for marking it as "inappropriate", what is the probability that the comment was actually respectful?

Solve
Practice★★☆
A last-mile logistics company delivers packages in a city using three types of vehicles: electric vans ($60\,\%$), motorbikes ($30\,\%$), and cargo bicycles ($10\,\%$).…

A last-mile logistics company delivers packages in a city using three types of vehicles: electric vans ($60\,\%$), motorbikes ($30\,\%$), and cargo bicycles ($10\,\%$). The probability that a package arrives late is $2\,\%$ if delivered by van, $5\,\%$ if by motorbike, and $8\,\%$ if by bicycle. If a customer calls to complain because their package has arrived late, what is the probability that the courier was on a cargo bicycle?

Solve
Practice★★☆
At a college preparing students for university entrance exams, $40\,\%$ of the students are enrolled in the Science stream, $35\,\%$ in Social Sciences, and $25\,\%$ in…

At a college preparing students for university entrance exams, $40\,\%$ of the students are enrolled in the Science stream, $35\,\%$ in Social Sciences, and $25\,\%$ in Humanities. At the end of the course, $92\,\%$ of Science students, $88\,\%$ of Social Sciences students, and $80\,\%$ of Humanities students pass the entrance exam. Choosing a student at random from the college who is known to have passed the university entrance exam, calculate the probability that they belong to the Social Sciences stream.

0,40 0,35 0,25 0,92 0,88 0,80 0,08 0,12 0,20 Science Social Sciences Humanities Pass Pass Pass Fail Fail Fail
Solve
Practice★★☆
A manufacturer of electronic components for smartphones has three production lines: A, B, and C. Line A produces $45\,\%$ of the components, line B produces $30\,\%$,…

A manufacturer of electronic components for smartphones has three production lines: A, B, and C. Line A produces $45\,\%$ of the components, line B produces $30\,\%$, and line C produces $25\,\%$. It is known that the probability of a component being defective is $1\,\%$ on line A, $2\,\%$ on line B, and $3\,\%$ on line C. If a component is selected at random and turns out to be defective, determine with justification which production line is most likely to have manufactured it.

Solve
Practice★★☆
In a city, $70\,\%$ of citizens use a mobile app to pay for public transport, whereas the rest use a physical card. It is observed that $15\,\%$ of those using the app…

In a city, $70\,\%$ of citizens use a mobile app to pay for public transport, whereas the rest use a physical card. It is observed that $15\,\%$ of those using the app have reading issues at the ticket validator, compared to $5\,\%$ of those using a physical card. If a validator emits a reading error signal, what is the probability that the user is trying to pay with the mobile app?

Solve
Practice★★☆
A recycling centre processes containers coming from two districts of the city, North and South. $60\,\%$ of the containers come from the North district. At the…

A recycling centre processes containers coming from two districts of the city, North and South. $60\,\%$ of the containers come from the North district. At the processing plant it is detected that $10\,\%$ of containers from the North are misclassified by citizens, whereas in the South district this percentage rises to $15\,\%$. If the conveyor belt operator selects a container at random and finds that it is correctly classified, what is the probability that it comes from the North district?

Solve
Practice★★☆
An e-sports team plays its tournament matches under two network latency conditions: "Low Latency" ($P=0,75$) and "High Latency" ($P=0,25$). When latency is low, the team…

An e-sports team plays its tournament matches under two network latency conditions: "Low Latency" ($P=0,75$) and "High Latency" ($P=0,25$). When latency is low, the team wins $80\,\%$ of its matches. However, if latency is high, their probability of victory drops to $40\,\%$. Given that the team has just won a match, what is the probability that they were playing with high latency?

B A G G̅ G G̅ Low Lat. High Lat. Wins Loses Wins Loses P(B) = 0,75 P(A) = 0,25 P(G|B) = 0,80 P(G̅|B) = 0,20 P(G|A) = 0,40 P(G̅|A) = 0,60 Knowing they won... P(A|G) = ? ...prob. of High Lat.?
Solve
Practice★★☆
According to survey-based data from the National Statistics Institute (INE) on e-commerce in Spain, common payment methods are distributed as follows: bank card…

According to survey-based data from the National Statistics Institute (INE) on e-commerce in Spain, common payment methods are distributed as follows: bank card ($65\,\%$), digital platforms or wallets ($25\,\%$), and bank transfer or cash on delivery ($10\,\%$). Bank security departments estimate that some anomaly or fraud is detected in $1{,}2\,\%$ of card payments, in $0{,}8\,\%$ of purchases using digital wallets, and in $3\,\%$ of transactions via bank transfer or cash on delivery.

  1. a) Model the situation using a probability tree diagram, clearly defining the events and assigning each branch its corresponding probability.
  2. b) If the alert system intercepts a fraudulent transaction, calculate the probability that it was made using a bank card.
  3. c) The anti-fraud team has limited resources and can only thoroughly audit the channel that accumulates the largest absolute volume of detected frauds. Which payment method should they prioritize? Justify your answer by explaining why you do not need to recalculate the full denominator to compare the causes.
Solve
Practice★★☆
A fruit and vegetable packaging facility in the Valencian Community processes oranges coming exclusively from two agricultural cooperatives, $A$ and $B$. Cooperative $A$…

A fruit and vegetable packaging facility in the Valencian Community processes oranges coming exclusively from two agricultural cooperatives, $A$ and $B$. Cooperative $A$ supplies a proportion $p$ of the received batches ($0 < p < 1$), while cooperative $B$ supplies the remainder ($1-p$). Quality control phytosanitary inspections determine that $2\,\%$ of the batches from $A$ and $5\,\%$ of the batches from $B$ do not meet the required standard for export to the European Union.

  1. a) Knowing that, when randomly selecting a batch that has turned out to be unfit for export, the posterior probability that it comes from cooperative $A$ is exactly equal to $\frac{4}{9}$, set up an equation and calculate the value of the proportion $p$ of the total supply provided by that cooperative.
  2. b) Reason and interpret the result: how is it possible that, with cooperative $A$ having a significantly lower failure rate than $B$ ($2\,\%$ compared to $5\,\%$), the probability that a defective batch comes from $A$ reaches such a high fraction as $\frac{4}{9}$?
Solve
Practice★★★
A tech multinational uses three different suppliers for the microchips in its new gaming laptops. Supplier $A$ supplies $45\%$ of the chips, supplier $B$ supplies…

A tech multinational uses three different suppliers for the microchips in its new gaming laptops. Supplier $A$ supplies $45\%$ of the chips, supplier $B$ supplies $35\%$, and the remainder come from supplier $C$. It is known from previous quality checks that $1\%$ of the chips from $A$ are defective, whereas for $B$ and $C$ these percentages are $2\%$ and $3\%$, respectively. A user buys a laptop and, after a month of use, suffers a critical failure due to the microchip. Calculate the probability that the defective chip was supplied by supplier $B$.

A B C Defective Non-defective Defective Non-defective Defective Non-defective 0,45 0,35 0,20 0,01 0,99 0,02 0,98 0,03 0,97
Solve
Practice★★★
A social media algorithm classifies content into three categories: "Viral" ($15\%$), "Trending" ($35\%$), and "Standard" ($50\%$). The probability that a user stops…

A social media algorithm classifies content into three categories: "Viral" ($15\%$), "Trending" ($35\%$), and "Standard" ($50\%$). The probability that a user stops scrolling and watches a video in full is $80\%$ if it is Viral, $40\%$ if it is Trending, and only $10\%$ if it is Standard. If we observe that a user has just finished watching a video in full, what is the probability that the algorithm had not originally classified it as Viral?

Solve
Practice★★★
A precision parts factory uses a computer vision machine to inspect production quality. It is known that only $0,5\%$ of the manufactured parts have a defect. The…

A precision parts factory uses a computer vision machine to inspect production quality. It is known that only $0,5\%$ of the manufactured parts have a defect. The machine correctly detects $96\%$ of defective parts, but also erroneously marks $2\%$ of non-defective parts as defective. If the machine has just marked a part as defective, calculate the probability that the part is actually in perfect condition.

Solve
Practice★★★
A courier company uses electric vans ($60\%$) and combustion vans ($40\%$). It has been observed that $5\%$ of journeys made by electric vans suffer delays due to the…

A courier company uses electric vans ($60\%$) and combustion vans ($40\%$). It has been observed that $5\%$ of journeys made by electric vans suffer delays due to the need for intermediate charging, whereas delays in combustion vans occur in $8\%$ of cases due to traffic problems. Given that a package has arrived late, determine the probability that it was transported by an electric van.

Favourable outcome 0,60 0,40 0,05 0,95 0,08 0,92 Fleet Electric Combustion Late On time Late On time 0,60 × 0,05 = 0,030 0,40 × 0,08 = 0,032 Total Late = 0,062
Solve
Practice★★★
Three streaming channels ($N$, $H$, and $D$) share the subscriber market in a city in proportions of $40\%$, $30\%$, and $30\%$, respectively. The probability that a…

Three streaming channels ($N$, $H$, and $D$) share the subscriber market in a city in proportions of $40\%$, $30\%$, and $30\%$, respectively. The probability that a subscriber of $N$ cancels their subscription this month is $0,05$; for $H$ it is $0,08$, and for $D$ it is $0,12$. If we choose at random a citizen who has just cancelled their subscription to one of these channels, what is the probability that they were a customer of $D$?

Solve
Practice★★★
A biometric security system uses facial recognition or fingerprint. $70\%$ of the time facial recognition is used and $30\%$ fingerprint is used. The system fails to…

A biometric security system uses facial recognition or fingerprint. $70\%$ of the time facial recognition is used and $30\%$ fingerprint is used. The system fails to identify an authorised user $2\%$ of the time with facial recognition and $1\%$ with fingerprint. On the other hand, it allows access to an intruder $0,5\%$ of the time with facial recognition and $0,1\%$ with fingerprint. Given that the system has denied access to an authorised user, calculate the probability that they were trying to enter using facial recognition.

Solve
Practice★★★
In a study on teenage reading habits, the sample was divided into three groups according to daily screen time: Low ($20\%$), Medium ($50\%$), and High ($30\%$). The…

In a study on teenage reading habits, the sample was divided into three groups according to daily screen time: Low ($20\%$), Medium ($50\%$), and High ($30\%$). The probability that a young person in the Low group reads at least one book a month is $0,7$; for the Medium group it is $0,4$, and for the High group it is $0,15$. If we select a teenager at random and they state that they have not read any books in the last month, calculate the probability that they belong to the "High" screen time group.

Solve
Practice★★★
A factory has two machines, $M_1$ and $M_2$, that produce the same part. $M_1$ produces three times as many parts as $M_2$. The percentage of defective parts from $M_1$…

A factory has two machines, $M_1$ and $M_2$, that produce the same part. $M_1$ produces three times as many parts as $M_2$. The percentage of defective parts from $M_1$ is $k\%$ and from $M_2$ is $4\%$. It is known that if a part is chosen at random and turns out to be defective, the probability that it comes from machine $M_2$ is $4/13$. Calculate the value of $k$ and then the probability that a randomly chosen part is defective.

3/4 1/4 k% 100-k% 4% 96% M₁ M₂ D D' D D' PATHS TO DEFECTIVE (D) P(M₁∩D) = 3/4 · k% P(M₂∩D) = 1/4 · 4% P(M₂|D) = 4/13
Solve
Practice★★★
In an occupational health screening campaign, a screening test is used for the early detection of an asymptomatic metabolic disorder whose prevalence in the working…

In an occupational health screening campaign, a screening test is used for the early detection of an asymptomatic metabolic disorder whose prevalence in the working population is only $0{,}5\,\%$. The sensitivity of the test (probability of testing positive when affected) is $98\,\%$, while the false positive rate (probability of testing positive when not affected) is $2\,\%$. A worker tests positive on the routine test.

  1. a) Calculate the probability that the worker actually has the condition by solving the problem through two independent approaches:
  • Approach 1: Tree diagram and analytical formulation of Bayes' theorem using conditional probabilities.

  • Approach 2: Contingency table based on natural frequencies, constructed from a hypothetical population of $10\,000$ representative workers.

  1. b) Compare both methods and argue which one is clearer for explaining to a non-mathematician patient why a test with a $98\,\%$ accuracy rate yields a surprisingly low real probability of being sick. Relate your reasoning to the concept of the 'base rate fallacy'.
Solve
Practice★★★
The Directorate-General for Traffic (DGT) uses presumptive oral fluid (saliva) screening devices to detect recent use of substances incompatible with driving. Suppose a…

The Directorate-General for Traffic (DGT) uses presumptive oral fluid (saliva) screening devices to detect recent use of substances incompatible with driving. Suppose a test has a sensitivity of $96\,\%$ (it detects $96\,\%$ of drivers who have consumed) and a false positive rate of $3\,\%$ (it tests positive in $3\,\%$ of drivers who have not consumed).

Consider two very different operational scenarios:

  • Scenario 1 (General preventive roadside check): the true prevalence of consumption among drivers subjected to this random check is $1\,\%$.

  • Scenario 2 (Targeted check following a serious traffic offense or reckless driving): the true prevalence of consumption in this group rises to $20\,\%$.

  1. a) Calculate, for each of the two scenarios, the probability that a driver who has tested positive on the saliva test has actually consumed the substance.
  2. b) Based on the results obtained, reflect and critically argue: why does the Spanish legal framework mandatorily require confirming the presumptive test with a second toxicological laboratory test before imposing criminal penalties or deprivation of rights, instead of acting on the result of the first test? How does the type of check (random versus targeted) affect the probability of wrongfully convicting an innocent person?
Solve
Practice★★★
Unit Challenge. Imagine you are advising an employment observatory. Your mission is to investigate the relationship between educational level and youth unemployment…

Unit Challenge. Imagine you are advising an employment observatory. Your mission is to investigate the relationship between educational level and youth unemployment ($16$–$24$ years old) in your autonomous community using real data from the INE (EPA).

  1. Data collection and table: Download the latest quarterly data from the INE cross-referencing education (higher education or not) and employment status (employed or unemployed). In a spreadsheet, create the contingency table with absolute and relative frequencies.

  2. Events and approaches: Define the sample space and elementary events. Assign probabilities using the frequentist interpretation and reflect on how it would differ from Laplace's rule or subjective probability. Using the properties of probability, calculate unions and intersections, and test analytically whether employment and higher education are dependent or independent events ($P(A \cap B) = P(A) \cdot P(B)$).

  3. Tree diagram and Bayes: Construct the associated tree diagram. Using conditional probability, determine the total probability of employment and apply Bayes' theorem to find the probability that a randomly chosen employed young person holds a higher education degree.

  4. Final product: Submit a spreadsheet with your calculations and an executive report (1 page) with your conclusions.

Evaluation criteria:

  • Accuracy in the contingency table and tree diagram using INE data.

  • Rigour in calculating probabilities, total probability, and Bayes' theorem.

  • Conceptual justification of independence and the types of probability.

  • Analytical quality and clarity in the report's conclusions.

Solve