# Difference between revisions of "User:Jzhang/Segment2"

Solutions for segment 2.

## Skilled problem

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

Let

$H_1$ be the hypothesis that he is on bridge without troll
$H_2$ be that he is on bridge with one troll
$H_3$ be that he is on bridge with two trolls

The probability of crossing safely(or on the bridge without troll) is:

$P(H_1|G) = \frac{P(G|H_1)*P(H_1)}{P(G)} = \frac{P(G|H_1)*P(H_1)}{P(GH_1)+P(GH_2)+P(GH_3)} = \frac{1*\frac{3}{5}}{1*\frac{3}{5}+\frac{4}{5}*\frac{1}{5}+\frac{3}{5}*\frac{1}{5}} = \frac{15}{22}$

### Problem 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?

The probability of be blue ball is: $P(b) = P(bA)+P(bB) = \frac{1}{2}*\frac{3}{8}+\frac{1}{2}*\frac{4}{6} = \frac{25}{48}$

The probability of being box B given blue ball is: $P(B|b) = \frac{P(b|B)*P(B)}{P(b)} = \frac{16}{25}$