Conditional probability

Conditional probability

The conditional probability of event given another event occurs is $$ P(a\vert b) = \frac{p(a \land b)}{p(b)} \text{ if } p(b) > 0$$

Link to original

title: Example 1
Flip a coin $3$ times. We already know how to find the probabiltiy of event $E$ that at least $2$ heads come up in a row.
 
$$
	\begin{aligned}
		S \text{ contains } 2^3 &= 8 \text{ outcomes} \\
		p(E) &= \frac{3}{8}
	\end{aligned}
$$
 
But what if the first flip comes up heads and we are asked about the probability of $E$ given $F$ has already occurred?
 
Our sample space is now $HHT, HTH, HTT, HHH$.
For an outcome in $E$ to occur, it must belong to $E \cap F$, so either $HHT$ or $HHH$.
 
So we have $p(F) = \frac{4}{8} = \frac{1}{2}$ and $p(E \cap F) = \frac{2}{8} = \frac{1}{4}$.
 
$$
	\begin{aligned}
		p(E | F) &= \frac{\frac{1}{4}}{\frac{1}{2}} \\
		&= \boxed{\frac{1}{2}}
	\end{aligned}
$$
title: Example 2
Throwing a pair of fair dice, what is the probability at least one dice is a $3$ given the sum of the two dice is $5$?
 
- Let $A$ be the event that at least one dice is a $3$. ($11$ outcomes)
- Let $B$ be the event that the sum of two dice is $5$.
  $B$ consists of the outcomes $(1,4), (2,3), (3,2), (4,1)$
- The sample space consists of $6^2 = 36$ equally probable outcomes.
  $p(B) = \frac{4}{36} = \frac{1}{9}$
- The event $A \cap B$ consists of two outcomes: $(2,3)$ and $(3,2)$.
  Hence $p(A \cap B) = \frac{2}{36} = \frac{1}{18}$
  
$$
	\begin{aligned}
		\therefore p(A|B) &= \frac{p(A \cap B)}{p(B)} \\
		&= \frac{\frac{1}{18}}{\frac{1}{9}} \\
		&= \frac{1}{2}
	\end{aligned}
$$

Independence

Independence

Two events and are said to be independent if the occurrence of one of the events gives no information about the probability of the other event. $$ \boxed{p(E | F) = p(E)} \text{ or } \boxed{p(F | E) = p(F)} $$

Using conditional probability, we can obtain that and are independent events whenever $p(E) \cdot p(F)$.

Link to original

title: Example 3
We flip a fair coin $3$ times. What is the probability an odd number of tails appear given that the first flip comes up tails?
 
- Let $X$ be the event that an odd number of tails appear.
- Let $Y$ be the event that the first flip comes up tails.
- The sample space consists of $2^3 = 8$ outcomes so:
  $p(Y) = \frac{4}{8} = \frac{1}{2}$
- The event $X \cap Y$ consists of two outcomes: $THH$ and $TTT$.
  $p(X \cap Y) = \frac{2}{8} = \frac{1}{4}$
 
$$
	\begin{aligned}
		p(X | Y) &= \frac{p(X \cap Y)}{p(Y)} \\
		&= \frac{\frac{1}{4}}{\frac{1}{2}} \\
		&= \frac{1}{2}
	\end{aligned}
$$
 
We can also find the unconditional probability of $X$, giving $p(X) = \frac{4}{8} = \frac{1}{2}$.
As $p(X | Y) = p(X)$, then the two events are **independent**.