The conditional probability of [math]B
[/math] given [math]A
[/math] is the probability of [math]B ∩ A
[/math], "scaled up" so that the probability of [math]A
[/math] given [math]A
[/math]
is 1.
Formally:
If
[math]A
[/math] and
[math]B \href{/cs2800/wiki/index.php/%E2%8A%86}{⊆} \href{/cs2800/wiki/index.php/S}{S}
[/math] are
events, then the
conditional probability of
[math]B
[/math] given [math]A
[/math] (written
[math]\href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A)
[/math]) is given by
[math]\href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A) \href{/cs2800/wiki/index.php/Definition}{:=} \frac{\href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A)}{\href{/cs2800/wiki/index.php/Pr}{Pr}(A)}
[/math]
For example, suppose we wish to model the following experiment: we first select one of two coins. The first coin (coin a) is weighted: it lands heads 3/4 of the time. The second coin (coin b) is fair: it lands heads 1/2 of the time. We choose the first coin 1/3 of the time. We want to find the probability of getting heads.
How do we interpret the facts given in the problem?
We first construct a sample space: there are 4 things that can happen: we can choose coin a and flip heads, we can choose coin a and tails, we can choose coin b and flip heads, or we could choose coin b and flip tails. A reasonable sample space would be [math]\href{/cs2800/wiki/index.php/S}{S} = \href{/cs2800/wiki/index.php/Enumerated_set}{\{a,b\}} \href{/cs2800/wiki/index.php/%5Ctimes}{\times} \href{/cs2800/wiki/index.php/Enumerated_set}{\{h,t\}} = \{(a,h),(a,t),(b,h),(b,t)\}
[/math].
It is (always) helpful to define some events: let [math]A \href{/cs2800/wiki/index.php/Definition}{:=} \{(a,h),(a,t)\}
[/math] be the event that we pick coin a, and [math]H \href{/cs2800/wiki/index.php/Definition}{:=} \{(a,h),(b,h)\}
[/math] be the event that we flip heads; define [math]B
[/math] and [math]T
[/math] similarly.
Now we need to interpret the probabilities given in the problem. When we say "[coin a] lands heads 3/4 of the time", we don't mean that 3/4 of the time we choose coin a and flip it and get heads (this would be [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(A \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} H)
[/math]). Rather, we mean that if we restrict our attention to the outcomes where we chose coin a, then the probability of getting heads in that restricted experiment is 3/4. Put more simply, the probability that we get heads given that we choose coin a is 3/4.
We interpret this in our model by setting [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(H \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A) = 3/4
[/math]. Since we choose coin a with probability 1/3, we see that [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(H \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A) = \href{/cs2800/wiki/index.php/Pr}{Pr}(H \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A) \cdot \href{/cs2800/wiki/index.php/Pr}{Pr}(A) = 1/4
[/math]: we would expect to select coin a and flip heads in about a quarter of the experiments.
Similarly, [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(H \href{/cs2800/wiki/index.php/%5Cmid}{\mid} B) = 1/2
[/math] so [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(H \href{/cs2800/wiki/index.php/%5Ccap}{\cap} B) = 1/3
[/math].
Since we can only select one of the coins, the events [math]A
[/math] and [math]B
[/math] are disjoint, so we can use the third Kolmogorov axiom to compute [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(H)
[/math]:
[math]\href{/cs2800/wiki/index.php/Pr}{Pr}(H) = \href{/cs2800/wiki/index.php/Pr}{Pr}((H \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A) \href{/cs2800/wiki/index.php/%E2%88%AA}{∪} (H \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} B)) = \href{/cs2800/wiki/index.php/Pr}{Pr}(H \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} A) + \href{/cs2800/wiki/index.php/Pr}{Pr}(H \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} B)) = 1/3 + 1/4
[/math]