--- title: "Probability Tree Examples" author: "Tom Fletcher" date: "September 5, 2017" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## Problem 1 __(from Lecture 2 notes)__ You are given two boxes with balls numbered 1 - 5. One box contains balls 1, 3, 5, and the other contains balls 2 and 4. You first pick a box at random, then pick a ball from that box at random. What is the probability that you pick a 2? __Setup:__ Define events $B_1$ = "you pick the odd box" and $B_2$ = "you pick the even box". Let $A_k$ be the event that you pick the $k$th ball (for $k = 1,2,3,4,5$). Here is the full conditional probability tree in table form: First Events | Second Events | Joint Probabilities | -----------------|-------------------------|-------------------------| $P(B_1) = 1/2$ | $P(A_1 \mid B_1) = 1/3$ | $P(A_1 \cap B_1) = 1/6$ |
| $P(A_3 \mid B_1) = 1/3$ | $P(A_3 \cap B_1) = 1/6$ |
| $P(A_5 \mid B_1) = 1/3$ | $P(A_5 \cap B_1) = 1/6$ | $P(B_2) = 1/2$ | $P(A_2 \mid B_2) = 1/2$ | $P(A_2 \cap B_2) = 1/4$ |
| $P(A_4 \mid B_2) = 1/2$ | $P(A_4 \cap B_2) = 1/4$ | __Answer:__ Probability of picking ball 2 is $P(A_2) = P(A_2 \cap B_2) = 1/4$. ## Problem 2 __(from Lecture 2 notes, with different numbers)__ I have a box with 10 red balls and 5 green balls. I draw 2 balls from the box without replacing them. What is the probability that I get 2 red balls? __Setup:__ Define events $R_1$ = "first ball red", $R_2$ = "second ball red", $G_1$ = "first ball green", and $G_2$ = "second ball green". Here is the conditional probability tree. Note: this is similar to the problem in the notes, but with different proportions of red/green balls to give an example where the first step is not 50-50. First Events | Second Events | Joint Probabilities | ------------------------|---------------------------------|--------------------------| $P(R_1) = 10/15 = 2/3$ | $P(R_2 \mid R_1) = 9/14$ | $P(R_1 \cap R_2) = 3/7$ |
| $P(G_2 \mid R_1) = 5/14$ | $P(R_1 \cap G_2) = 5/21$ | $P(G_1) = 5/15$ = 1/3 | $P(R_2 \mid G_1) = 10/14 = 5/7$ | $P(G_1 \cap R_2) = 5/21$ |
| $P(G_4 \mid G_1) = 4/14 = 2/7$ | $P(G_1 \cap G_2) = 2/21$ | __Answer:__ Probability of two red balls is $P(R_1 \cap R_2) = 3/7$. ## Problem 3 __(from Lecture 3 notes)__ You have two urns, one with 4 black balls and 3 white balls, the other with 2 black balls and 2 white balls. You pick one urn at random and then select a ball from the urn. What is the probability the ball is white? __Setup:__ Define events $U_1$ = "you pick urn with 4 black / 3 white" and $U_2$ = "you pick urn with 2 black / 2 white". Events $B,W$ will be that you pick a black or white ball, respectively. First Events | Second Events | Joint Probabilities | ----------------|-----------------------|------------------------| $P(U_1) = 1/2$ | $P(B \mid U_1) = 4/7$ | $P(B \cap U_1) = 2/7$ |
| $P(W \mid U_1) = 3/7$ | $P(W \cap U_1) = 3/14$ | $P(U_2) = 1/2$ | $P(B \mid U_2) = 1/2$ | $P(B \cap U_2) = 1/4$ |
| $P(W \mid U_2) = 1/2$ | $P(W \cap U_2) = 1/4$ | __Answer:__ We need to use __total probability__, which involves adding up all events in the last column (joint probabilities) that involve the event $W$ (picking a white ball). This gives us $$P(W) = P(W \cap U_1) + P(W \cap U_2) = \frac{3}{14} + \frac{1}{4} = \frac{13}{28}.$$