# Introductory Probability: Conditional Probability

A conditional probability is the probability that an event will occur on the condition that some other event occurs. For example, the odds of rolling two 1s with two dice are $\frac{1}{36}$. Rolls of two dice are independent events, but if we know the roll of at least one of the dice is an odd number, then the likelihood of two 1s increases.

Definition. Let $A$ and $B$ be events. Suppose $P_r(B)>0$. Then the conditional probability of $A$ given $B$ is \begin{equation}\label{eq:condprob}P_r(A|B)=\frac{P_r(A\cap B)}{P_r(B)}\end{equation} If $P_r(B)=1$, then knowing the event $B$ occurs gives no information on event $A$ and $P_r(A|B)=P_r(A)$. If $P_r(B)<1$, then knowing event $B$ happened increases the probability of event $A$ happened by $\frac{1}{P_r(B)}$.

As a special case, if all outcomes are equally likely, then \begin{align*}P_r(A|B)&=\frac{P_r(A\cap B)}{P_r(B)}\\&=\frac{\frac{|A\cap B|}{|S|}}{\frac{B|}{|S|}}\\&=\frac{|A\cap B|}{|B|}\end{align*}

Example. (Rolling two 1s with two dice) The sample space is $\{1,2,3,4,5,6\}\times\{1,2,3,4,5,6\}$ and $A=\{(1,1)\}$. Let $B$ be the event that one of the dice has come up with an odd number. Then $$B=\{1,3,5\}\times\{1,2,3,4,5,6\}\cup\{1,2,3,4,5,6\}\times\{1,3,5\}$$ $|B|=27$ and $A\cap B=A$, so we obtain $$P_r(A|B)=\frac{1}{27}>\frac{1}{36}$$

Example. If a die is rolled twice, what is the probability that the sum of rolls is at least 9? If the first roll is a 4, does the probability increase, decrease, or stay the same?

Solution. Let $A$ be the event that the rolls total at least 9. Then $$A=\{(3,6),(4,5),(4,6),(5,4),(5,5),(5,6),(6,3),(6,4),(6,5),(6,6)\}$$ and $P_r(A)=\frac{|A|}{|S|}=\frac{10}{36}=\frac{5}{18}$. Let $B$ be the event that the first roll is 4. Then $$B=\{(4,1),(4,2),(4,3),(4,4),(4,5),(4,6)\}$$ and $A\cap B=\{(4,5),(4,6)\}$. Thus, $$P_r(A|B)=\frac{|A\cap B|}{|B|}=\frac{2}{6}=\frac{1}{3}>\frac{5}{18}=P_r(A)$$

Example. A coin is flipped twice. What is the conditional probability that both flips result in heads, given that the first flip does?

Solution. Let $A$ be the event that both flips land head and $B$ the event that the first flip lands head. Then $$A=\{(H,H)\},\ B=\{(H,H),(H,T)\}$$ and so $P_r(A|B)=\frac{1}{2}$.

Example. An urn contains 10 white, 5 yellow, and 10 black marbles. A marble is chosen at random from the urn and it is noted it is not one of the black marbles. What is the probability that it is yellow?

Solution. Let $A$ be the event that the marble selected is yellow and $B$ the event that the marble selected is not black. $A\cap B=A$ so $P_r(A\cap B)=\frac{5}{25}$. Since $P_r(B)=\frac{15}{25}$, \begin{align*}P_r(A|B)&=\frac{P_r(A\cap B)}{P_r(B)}\\&=\frac{5}{15}\\&=\frac{1}{3}\end{align*}

Remark. In the above example, since we know that the chosen marble is not black, we can reduced our sample space by including only white and yellow marbles. Then the probability that a marble chosen at random is yellow is simply $P_r(A)=\frac{5}{15}=\frac{1}{3}$. When all outcomes are assumed to be equally likely, it is often easier to compute a conditional probability by reducing sample space instead of directly applying the formula \eqref{eq:condprob}.

Remark. (Independent Events and Conditional Probability) Recall that two events $A$ and $B$ are independent if and only if $P_r(A\cap B)=P_r(A)P_r(B)$. One can easily show that two events $A$ and $B$ with nonzero probabilities are independent if and only if $$P_r(A|B)=P_r(A)$$

References.

 Essential Discrete Mathematics for Computer Science, Harry Lewis and Rachel Zax, Princeton University Press, 2019

 A First Course in Probability, Sheldon Ross, 5th Edition, Prentice-Hall, 1998