class: center, middle, inverse, title-slide # Joint, Marginal, Conditional Probability ### Dr. Dogucu --- layout: true <div class="my-header"></div> <div class="my-footer"> Copyright © <a href="https://mdogucu.ics.uci.edu">Dr. Mine Dogucu</a>. <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a></div> --- ## Data - GSS 2018 The General Social Survey (GSS) is a sociological survey that has been regularly conducted since 1972. It is a comprehensive survey that provides information on experiences of residents of the United States. <table align = "center"> <thead> <tr> <th colspan="2" rowspan="2"></th> <th colspan="3">Belief in Life After Death</th> </tr> <tr> <td>Yes</td> <td>No<br></td> <td>Total<br></td> </tr> </thead> <tbody> <tr> <td rowspan="3">College Science Course<br></td> <td>Yes</td> <td>375</td> <td>75</td> <td>450</td> </tr> <tr> <td>No</td> <td>485</td> <td>115</td> <td>600</td> </tr> <tr> <td>Total</td> <td>860</td> <td>190</td> <td>1050</td> </tr> </tbody> </table> --- ## Events Let B represent an event that a randomly selected person in this sample believes in life after death. -- Let C represent an event that a randomly selected person in this sample took a college level science course. --- ## Joint Probability <table align = "center"> <thead> <tr> <th colspan="2" rowspan="2"></th> <th colspan="3">Belief in Life After Death</th> </tr> <tr> <td>Yes</td> <td>No<br></td> <td>Total<br></td> </tr> </thead> <tbody> <tr> <td rowspan="3">College Science Course<br></td> <td>Yes</td> <td>375</td> <td>75</td> <td>450</td> </tr> <tr> <td>No</td> <td>485</td> <td>115</td> <td>600</td> </tr> <tr> <td>Total</td> <td>860</td> <td>190</td> <td>1050</td> </tr> </tbody> </table> Note that events `\(B\)` and `\(C\)` are not mutually exclusive. A randomly selected person can believe in life after death and might have taken a college science course. `\(B \cap C \neq \emptyset\)`. -- `\(P(B \cap C) = \frac{375}{1050}\)` -- Note that `\(P(B\cap C) = P(C\cap B)\)`. Order does _not_ matter. --- ## Marginal Probability <table align = "center"> <thead> <tr> <th colspan="2" rowspan="2"></th> <th colspan="3">Belief in Life After Death</th> </tr> <tr> <td>Yes</td> <td>No<br></td> <td>Total<br></td> </tr> </thead> <tbody> <tr> <td rowspan="3">College Science Course<br></td> <td>Yes</td> <td>375</td> <td>75</td> <td>450</td> </tr> <tr> <td>No</td> <td>485</td> <td>115</td> <td>600</td> </tr> <tr> <td>Total</td> <td>860</td> <td>190</td> <td>1050</td> </tr> </tbody> </table> `\(P(B)\)` represents a __marginal probability__. So do `\(P(C)\)`, `\(P(B^C)\)` and `\(P(C^C)\)`. In order to calculate these probabilities we could only use the values in the margins of the contingency table, hence the name. `\(P(B) = \frac{860}{1050}\)` `\(P(C) = \frac{450}{1050}\)` --- ## Conditional Probability <table align = "center"> <thead> <tr> <th colspan="2" rowspan="2"></th> <th colspan="3">Belief in Life After Death</th> </tr> <tr> <td>Yes</td> <td>No<br></td> <td>Total<br></td> </tr> </thead> <tbody> <tr> <td rowspan="3">College Science Course<br></td> <td>Yes</td> <td>375</td> <td>75</td> <td>450</td> </tr> <tr> <td>No</td> <td>485</td> <td>115</td> <td>600</td> </tr> <tr> <td>Total</td> <td>860</td> <td>190</td> <td>1050</td> </tr> </tbody> </table> `\(P(B|C)\)` represents a __conditional probability__. So do `\(P(B^c|C)\)`, `\(P(C| B)\)` and `\(P(C|B^c)\)`. To calculate the probabilities we focus on the row or the column of the given information. We _reduce_ the sample space to this given information. -- Probability that a randomly selected person believes in life after death given that they have taken a college science course `\(P(B|C) = \frac{375}{450}\)` --- ## Conditional Probability The order matters! `\(P(\text{has a dog | like dogs}) \neq\)` `\(P(\text{like dogs | has a dog})\)` --- ## Addition Rule <table align = "center"> <thead> <tr> <th colspan="2" rowspan="2"></th> <th colspan="3">Belief in Life After Death</th> </tr> <tr> <td>Yes</td> <td>No<br></td> <td>Total<br></td> </tr> </thead> <tbody> <tr> <td rowspan="3">College Science Course<br></td> <td>Yes</td> <td>375</td> <td>75</td> <td>450</td> </tr> <tr> <td>No</td> <td>485</td> <td>115</td> <td>600</td> </tr> <tr> <td>Total</td> <td>860</td> <td>190</td> <td>1050</td> </tr> </tbody> </table> `\(P(B\cup C) = P(B) + P(C) - P(B \cap C)\)` -- `\(P(B\cup C) = \frac{860}{1050} + \frac{450}{1050} -\frac{375}{1050} = \frac{935}{1050}\)` -- `\(P(B\cup C) = \frac{375}{1050} + \frac{75}{1050} + \frac{485}{1050} = \frac{935}{1050}\)`