# Eleisha's Segment 2: Bayes

**To Calculate: **

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

TTGGG bridges (20%)

TGGGG bridges (20%)

GGGGG bridges (60%)

If the knight captures a gnome, the only possibility of a safe crossing if he crosses one of the third type of bridge (GGGGG).

Hypothesis 1 (H_{1}) = Knight crosses a TTGGG bridge

Hypothesis 2 (H_{2}) = Knight crosses a TGGGG bridge

Hypothesis 3 (H_{3}) = Knight crosses a GGGGG bridge
**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle P(H_2 | G) = \frac{P(G| H_2)P(H_2)}{P(G | H_1)p(H_1) + P(G| H_2)P(H_2) + P(G | H_3)P(H_3) } =\frac{(1)(\frac{3}{5})}{(\frac{3}{5})(\frac{1}{5}) + (\frac{4}{5})(\frac{1}{5}) + (1)(\frac{3}{5})} \approx 0.682 }**

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?

A = Drawn from Box A

B = Drawn from Box B

Probability that the drawn ball is blue =
**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle P(Blue) = P(Blue | A)P(A) + P(Blue | B)P(B) = \left(\frac{1}{2}\right)\left(\frac{3}{8}\right) + \left(\frac{1}{2}\right)\left(\frac{4}{6}\right) = \frac{25}{48} \approx 0.521 }**

Using Bayes and the observation that the ball drawn was Blue, we can can calculate the probability that the ball is from box B

Hypothesis 1 (H_{1}) = The ball was drawn from box A

Hypothesis 2 (H_{2}) = The ball was drawn from box B

Probability that if the drawn ball is blue then it came from box B =
**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle P(H_2 | Blue) }**
**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle P(H_2 | Blue) = \frac{P(Blue | H_2)P(H_2)}{P(Blue | H_1)p(H_1) + P(Blue| H_2)P(H_2)} = \frac{(\frac{1}{2})(\frac{4}{6})}{ (\frac{3}{16}) + (\frac{4}{12})} = \frac{16}{25} = 0.64 }**

** To Think About **

1. Do you think that the human brain's intuitive "inference engine" obeys the commutativity and associativity of evidence? For example, are we more likely to be swayed by recent, rather than older, evidence? How can evolution get this wrong if the mathematical formulation is correct?

2. How would you simulate the Knight/Troll/Gnome problem on a computer, so that you could run it 100,000 times and see if the Knights probability of crossing safely converges to 1/3?

3. Since different observers have different background information, isn't Bayesian inference useless for making social decisions (like what to do about climate change, for example)? How can there ever be any consensus on probabilities that are fundamentally subjective?

** Back To: ** Eleisha Jackson