Skip to content
UoL CS Notes

Conditional Probability

COMP111 Lectures

Often we are interested in just part of the sample space. Conditional probability gives us a means of handling this situation.

Example

Consider a family chosen at random from a set of families having two children (but not having twins). What is the probability that both children are boys?

A suitable sample space $S=\{BB,GB,BG,GG\}$.

It is reasonable to assume that $P(x)=\frac{1}{4}$ for all $x\in S$.

Thus $P(BB)=\frac{1}{4}$.

Now you learn that the families were selected from those who have one child at a boys’ school. Does this change probabilities.

The new sample space $S’=\{BB,GB,BG\}$ and we re now looking for $P(BB\vert \text{at least one boy})+P(BB\vert S’)$

The vertical line is read given that.

Normalisation

$S’$ is a subset of $S$, so every outcome $x$ in $S’$ is also in $S$. It probability $P(x)\in S$ we can determine.

However, if we just take the sum of these probabilities, they will sum to less than 1.

We therefore normalise by dividing the probability $P(x)$ of the outcome $x$ in $S$ by the probability $P(S’)$ of $S’$ in $S$:

\[\begin{aligned} P(BB\vert \text{at least one boy})&=P(BB\vert S')\\ &=\frac{P(BB)}{P(S')}\\ &=\frac{\frac{1}{4}}{\frac{3}{4}}\\ &=\frac{1}{3} \end{aligned}\]

Conditioning

Assume now that evens $A$ and $B$ are given.

Assume we know that $B$ happens. So we want to condition on $B$. Thus, we want to know:

\[P(A\vert B)\]

This is the probability that $A$ occurs given that $B$ is know to occur.

So we want to know the probability $P(A\cap B)$. (as we know that $B$ occurs) after the conditioning on $B$.

We cant take $P(A\cap B)$ itself but have to normalise by dividing by the probability of the new sample space $P(B)$:

\[P(A\vert B)=\frac{P(A\cap B)}{P(B)}\]

Formalised

Let $A$ and $B$ be events, with $P(B)>0$.

The conditional probability $P(A\vert B)$ of $A$ given $B$ is given by:

\[P(A\vert B)=\frac{P(A\cap B)}{P(B)}\]

View slide 27 for additional example.

Multiplication Rule

We can rewrite the previous equation like so:

\[P(A\cap B)=P(A\vert B)P(B)\]

Or like:

\[P(A\cap B)=P(B\vert A)P(A)\]

This rule can also be extended to more events:

\[\begin{aligned} P(A\cap B\cap C)&=P(C\vert B\cap A)P(A\cap B)\\ &=P(C\vert A\cap B)P(B\vert A)P(A) \end{aligned}\]

Example

Consider a family chosen at random from a set of families with just one pair of twins. What is the probability that both twins are boys?

Twins are either identical $I$ or fraternal $F$. We know that a third of human twins are identical:

\[P(I)=\frac{1}{3},P(F)=\frac{2}{3}\]

and

\[P(BB)=P(I\cap BB) + P(F\cap BB)\]

By the multiplication rule:

\[\begin{aligned} P(I\cap BB)&= P(BB\vert I)P(I)\\ P(F\cap BB)&= P(BB\vert F)P(F) \end{aligned}\]

The probability of being a girl of boy for fraternal twins will be the same as for any other two-child family. For the identical twins, the outcomes $BG$ and $GB$ are no longer possible thus:

\[P(BB\vert I)=\frac{1}{2},\ P(BB\vert F)=\frac{1}{4}\]

From this we obtain:

\[\begin{aligned} P(BB)&=P(I\cap BB) + P(F\cap BB)\\ &=P(BB\vert I)P(I)+ P(BB\vert F)P(F)\\ &=\frac{1}{2}\times\frac{1}{3}+\frac{1}{4}\times\frac{2}{3}\\ &=\frac{1}{3} \end{aligned}\]