Back to homeMathematics · 2nd Bach. Science · Change subject
Start for free
BAC2 tech · Mathematics
Randomness and probability · Probability

Total probability and Bayes' theorem

Everything so far let you move forward along the tree: from cause to effect. Bayes' theorem does the opposite — and it is the star question of the EvAU in probability: knowing that the effect has already happened, what is the probability that the cause was one or another? "The test came back positive: what is the probability that the person really is ill?" cannot be answered by looking at the tree forwards, but by reversing it.

Before you start, make sure you know: Conditional probability (1st Bachillerato)
Before you start, make sure you know: Tree diagrams (4th ESO)

Partition of the sample space

Area diagram showing the whole sample space divided into three disjoint, exhaustive events B1, B2 and B3. sample space E B₁ B₂ B₃ they neither overlap nor leave gaps: they cover all of E
Practice★☆☆Not started
In an esports tournament, a player reaches the final. They can choose between two strategies: Offensive (chosen $70\%$ of the time) or Defensive ($30\%$). If they play…

In an esports tournament, a player reaches the final. They can choose between two strategies: Offensive (chosen $70\%$ of the time) or Defensive ($30\%$). If they play offensively, they win the game with a probability of $0,6$, whereas if they play defensively, their probability of victory is $0,4$.

Given that the player won the game, calculate the probability that they used a defensive strategy.

0,7 0,3 0,6 0,4 0,4 0,6 Offensive Defensive Wins Loses Wins Loses P(O∩G) = 0,42 P(D∩G) = 0,12
Solve

Law of total probability

Venn diagram in which an event A intersects the partitions B1, B2 and B3 of the sample space, illustrating total probability as the sum of those intersections. P(B₁)P(B₂)P(B₃) P(A|B₁)P(A|B₂)P(A|B₃) P(A) = sum of the three branches that reach A
Practice★☆☆Not started
In a school, Year 13 students can choose between two platforms to carry out their work in the cloud: $65\%$ use Google Workspace and the rest use Microsoft 365. It is…

In a school, Year 13 students can choose between two platforms to carry out their work in the cloud: $65\%$ use Google Workspace and the rest use Microsoft 365. It is known that $20\%$ of Google users use Artificial Intelligence tools to write drafts, whereas in Microsoft $15\%$ do so.

Calculate the probability that a student chosen at random uses Artificial Intelligence for their drafts.

0,65 0,35 0,20 0,80 0,15 0,85 Google Microsoft AI Not AI AI Not AI
Solve
Practice★★☆Not started
In an esports high-performance centre, players train on three different platforms: PC, console and mobile devices. $50\ \%$ of players use PC, $30\ \%$ use console and…

In an esports high-performance centre, players train on three different platforms: PC, console and mobile devices. $50\ \%$ of players use PC, $30\ \%$ use console and the rest mobile devices. It has been observed that performance decreases due to eye strain in $8\ \%$ of PC players, $5\ \%$ of console players and $12\ \%$ of mobile users.

  1. a) Calculate the probability that a player chosen at random suffers from eye strain.
  1. b) If we select a player and see that they suffer from eye strain, what is the probability that they usually train with a mobile device?
0,50 0,30 0,20 0,08 0,05 0,12 0,92 0,95 0,88 PC Console Mobile Eye strain Eye strain Eye strain No eye strain No eye strain No eye strain
Solve

Bayes' theorem: reversing the tree

Tree diagram from causes to effects in which a dotted arrow in the opposite direction shows the reversal of the probability by Bayes. P(B₁)P(B₂) P(A|B₁)P(A|B₂) Bayes question: ← from A, which branch is most likely to have happened?
Practice★★☆Not started
A music streaming service classifies its users into three categories: "Free" (with ads), "Premium" and "Family". $60\ \%$ are Free users, $30\ \%$ Premium and $10\ \%$…

A music streaming service classifies its users into three categories: "Free" (with ads), "Premium" and "Family". $60\ \%$ are Free users, $30\ \%$ Premium and $10\ \%$ Family. It is known that $80\ \%$ of Free users listen for more than 2 hours daily, whereas this percentage is $90\ \%$ for Premium users and $95\ \%$ for Family users.

  1. a) If a user is chosen at random, what is the probability that they listen to music for 2 hours or less per day?
  1. b) If we select a user who listens to more than 2 hours of music daily, what is the probability that they belong to the "Premium" category?
Solve
Practice★★★Not started
A cybersecurity company uses three artificial intelligence systems ($S_1$, $S_2$ and $S_3$) to detect unauthorized access attempts on a corporate network. System $S_1$…

A cybersecurity company uses three artificial intelligence systems ($S_1$, $S_2$ and $S_3$) to detect unauthorized access attempts on a corporate network. System $S_1$ handles $45 \%$ of the alerts, $S_2$ handles $35 \%$ and $S_3$ handles the rest.

It is known from previous audits that, among the alerts issued by each system, the following are false alarms (a legitimate access is reported as an attack): $2 \%$ of those from $S_1$, $5 \%$ of those from $S_2$ and $8 \%$ of those from $S_3$. The remaining alerts from each system correspond to real attacks. Moreover, the probability that a system ignores a real attack (false negative) is $1 \%$ in all cases; this is information you will not need for this problem.

At a given moment, an alert goes off on the control panel indicating an attack.

  1. a) Represent the situation with a tree diagram, detailing the probabilities of each branch.
  1. b) Calculate the probability that the alert issued is actually a false alarm.
  1. c) If it is confirmed that the alert was a false alarm, what is the probability that it was generated by system $S_3$?
Solve

Bayes step by step: the exam strategy

Decision tree diagram highlighting the favourable branch in the numerator against the sum of all the valid paths that make up the denominator of Bayes' theorem. 1. causes 2. effect A 3. tree → P(A) 4. Bayes
Practice★★★Not started
In a high-performance sports centre, athletes undergo doping control. $1 \%$ of the athletes consume a banned substance. The test used has a reliability of $98 \%$…

In a high-performance sports centre, athletes undergo doping control. $1 \%$ of the athletes consume a banned substance. The test used has a reliability of $98 \%$ (probability of testing positive if the substance has been consumed). However, the test also produces $3 \%$ "false positives" (testing positive in athletes who have not consumed anything).

  1. a) If an athlete tests positive in the control, what is the probability that they have actually consumed the substance?
  2. b) The committee decides to perform a second independent test on the same athlete if the first one comes back positive. If this second test (with the same reliability) also turns out positive, what is the probability now that the athlete is guilty? Justify whether the confidence in the verdict has increased significantly.
POPULATION REAL STATE TEST PROBABILITY 0,01 0,99 0,98 0,02 0,03 0,97 C C' + - + - P(C ∩ +) = 0,0098 P(C ∩ -) = 0,0002 P(C' ∩ +) = 0,0297 P(C' ∩ -) = 0,9603 C Consumes (1%) C' Does not consume (99%) + Positive Test - Negative Test
Solve
Practice★★☆Not started
A study on sustainable mobility in a city indicates that $45\ \%$ of journeys are made by public transport, $35\ \%$ by bicycle or e-scooter, and $20\ \%$ by private…

A study on sustainable mobility in a city indicates that $45\ \%$ of journeys are made by public transport, $35\ \%$ by bicycle or e-scooter, and $20\ \%$ by private car. The probability of arriving late for work is estimated to be 0.15 if using public transport, 0.05 if using bicycle/e-scooter, and 0.30 if using private car (due to traffic jams).

  1. a) Calculate the probability that a citizen chosen at random arrives on time for work.
  1. b) Given that a worker arrived late, what is the probability that they travelled in their private car?
Solve

Diagnostic tests: the case that confuses most people

Visual comparison between the tiny bar of true positives and the much larger bar of false positives in a healthy population. population: 0,1% ill, 99,9% healthy positives of the test: almost all are false positives from the huge healthy majority ← here are the few true positives
Practice★★★Not started
In a biotechnology laboratory, three types of bacteria are handled: $T_1$, $T_2$ and $T_3$. There is a container with 100 samples: 20 of $T_1$, 30 of $T_2$ and 50 of…

In a biotechnology laboratory, three types of bacteria are handled: $T_1$, $T_2$ and $T_3$. There is a container with 100 samples: 20 of $T_1$, 30 of $T_2$ and 50 of $T_3$. The probability of a sample developing antibiotic resistance within 24 hours is $0,2$ for $T_1$, $0,4$ for $T_2$ and an unknown value $p$ for $T_3$.

A sample is drawn at random and observed to have developed resistance after 24 hours. Given that the probability of this sample being of type $T_2$ is $0,375$:

  1. a) Determine the value of the probability $p$ associated with type $T_3$ bacteria.
  2. b) Using the value of $p$ obtained, calculate the probability that, when choosing a sample at random, it does not develop resistance.
Solve
Practice★★★Not started
Three machines, $M_1$, $M_2$ and $M_3$, manufacture precision parts. $M_1$ produces twice as many parts as $M_2$, and $M_3$ produces the same number as $M_1$ and $M_2$…

Three machines, $M_1$, $M_2$ and $M_3$, manufacture precision parts. $M_1$ produces twice as many parts as $M_2$, and $M_3$ produces the same number as $M_1$ and $M_2$ combined. The percentage of defective parts is $2 \%$ for $M_1$ and $4 \%$ for $M_2$.

It is known that, when taking a part at random from the total production, the probability of it being defective is $2,5 \%$.

  1. a) Calculate the percentage of defective parts produced by machine $M_3$.
  2. b) If we take a part and find that it is defective, which machine is most likely to have manufactured it?
Solve

Summary

See all the exercises in this section