# Segment 2 Sanmit Narvekar

## Segment 2

#### To Calculate

1. If the knight had captured a Gnome instead of a Troll, what would his chances be of crossing safely?

If the knight captures a gnome, the only bridge that is guaranteed to be safe is H3. Thus, we are interested in the probability that the knight is on H3 given that he has captured a gnome.

First we calculate the marginal, which will be useful in later calculations:

$\displaystyle P(Gnome) = \sum_i P(H_i) P(Gnome | H_i) = (1/5)(3/5) + (1/5)(4/5) + (3/5)(1) = 22/25$

And now we apply Bayes theorem to calculate the probability of being on H3:

$\displaystyle P (H_3 | Gnome) = \frac{P (H_3) P(Gnome | H_3)}{P(Gnome)} = \frac{(3/5)(1)}{(22/25)} = 15/22$

2. Suppose that we have two identical boxes, A and B. A contains 5 red balls and 3 blue balls. B contains 2 red balls and 4 blue balls. A box is selected at random and exactly one ball is drawn from the box. What is the probability that it is blue? If it is blue, what is the probability that it came from box B?

To calculate the marginal probability of obtaining a blue ball, we use Bayes rule and sum the probability of picking the blue ball in all possible boxes:

$\displaystyle P( Blue) = \sum_{i \in \{A,B\}} P(Box_i) P(Blue | Box_i) = P(Box_A) P(Blue|Box_A) + P(Box_B) P(Blue | Box_B) = (1/2)(3/8) + (1/2)(4/6) = 25/48$

To calculate the probability that a blue ball came from box B, we use Bayes rule (and conveniently reuse our calculation from the first part in the denominator):

$\displaystyle P(Box_B | Blue) = \frac{P(Box_B) P(Blue | Box_B)}{P(Blue)} = \frac{(1/2)(4/6)}{(25/48)} = 16/25$