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

Conditional probability

"What is the probability that it will rain?" is not the same question as "what is the probability that it will rain, given that the sky is cloudy?". Knowing something about the experiment changes the space of possibilities: you no longer count all the cases, only those that are compatible with what you know. That is the idea of this section, and it is the basis of everything that follows (tree diagrams, tables, Bayes).

Before you start, make sure you know: Events (1st Bachillerato)
Before you start, make sure you know: Contingency tables (1st Bachillerato)

What P(A|B) means

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

  1. a) The sample space associated with the participants' origin.
  1. b) The probability that the winner is from Madrid.
  1. c) The probability that the winner is of legal age.
Three circles with the participants from Madrid, Barcelona and Valencia, and a bar with 60 % under 18 years old and the rest undetermined 120 MADRID 80 BARCELONA 50 VALENCIA 60 % Under 18 years old ¿? Of legal age
Solve

Compound probability: P(A∩B) = P(A)·P(B|A)

Rearranging the definition above gives the formula that is actually used to calculate intersections step by step, especially in successive draws.

Tree diagram showing the probabilities of consecutive events calculated using the product rule and conditional probability. B: P(B) A|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 colour.
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

Independent events

Comparison between independent events with a non-empty intersection and mutually exclusive events shown as disjoint sets. AB they overlap: they can happen together, but do not influence 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

Reading conditional probability from a contingency table

Contingency table showing the calculation of conditional probability as the intersection cell divided by the total of the row or column of the condition. Dog (D) Total Cat (G) 15 40 60 ? P(G|D) = 15 / (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

Combined operations and the hard exam case

Exam questions rarely give $P(A|B)$ directly: they usually give $P(A)$, $P(B)$ and $P(\overline A \cap \overline B)$ (or $P(A\cup B)$) and ask you to deduce the rest, as well as to decide whether there is independence.

Venn diagram representing De Morgan's laws by shading the complement of the union as the intersection of the complements. AB outside both circles: Ā∩B̄ = 1 − P(A∪B)
Practice★★★Not started
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:

  1. a) The probability that the bacterium is resistant to $A$ given that it is resistant to $B$.
  2. b) The probability that it is resistant to only one of the two antibiotics.
  3. c) Are the events "being resistant to $A$" and "being resistant to $B$" independent? Justify your answer with calculations.
E P(Neither) = 12% A B ? P(A) = 0,65 P(B) = 0,48
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

Back to the beginning: Knowing that the sky is cloudy ($N$) restricts the sample space to those days: the probability of rain ($L$) is updated to $P(L|N) = \dfrac{P(L \cap N)}{P(N)}$, a value that is usually much greater than the overall prior probability $P(L)$.

Summary

See all the exercises in this section