## 2019 / Andreas Koenzen## Home |

Imagine you are in the army, and you are in combat. Also imagine you have an amazing new piece of equipment, namely a new helmet that's impervious to all rifle fire. Also you know something about soldiers in the enemy army. You know that 99% of them are regular soldiers, and of those soldiers only 20% of time are they capable of firing a rifle from 400 yards and hitting a target in the head. But there's another group within the enemy army; the sharpshooters, the elite, and they are 1% of the force, but they are also really good at shooting from long distances. 90% of the time when they aim at a target at 400 yards away they can hit it in the head.

I want you to imagine you are out in the field and you look over the horizon and you spot a sole enemy soldier at 400 yards. Now you pick you head just above the edge of the hole you are in to see if that person saw you, and you get shoot right in the head. What are the chances that that person was a: regular soldier or a sniper...?

__Note:__ I will use up to 4 significant digits to make the result as accurate as I can.

**P(B _{1}): 0.99** (Probability that's a regular soldier)

Now we need to find

__Bayes Rule:__

$P(B_2/C) = { P(C/B_2) \times P(B_2) \over P(C) \; = \; {\sum_{i=1}^n P(C/B_i) \times P(B_i)} }$

A little explanation of Bayes Rule... here P(B

Now we have the following probability tree:

If we receive "1 Hit" to our helmet from 400 yards away, then:

$P(B_2/C) = { P(C/B_2) \times P(B_2) \over P(C) \; = \; {\sum_{i=1}^n P(C/B_i) \times P(B_i)} } = { 0.9 \times 0.01 \over (0.99 \times 0.2) + (0.01 \times 0.9) } = 0.04348 = 4.348\%$

This posterior probability of

If we receive "2 Consecutive Hits" to our helmet from 400 yards away, then:**Observation:** For this case we must use the posterior probability from the previous experiment/event as the prior probability of this current experiment/event. This is called Bayesian Updating. That means that we must replace **0.01** with **0.04348**.

$P(B_2/C) = { P(C/B_2) \times P(B_2) \over P(C) \; = \; {\sum_{i=1}^n P(C/B_i) \times P(B_i)} } = { 0.9 \times 0.04348 \over (0.99 \times 0.2) + (0.01 \times 0.9) } = 0.1890 = 18.90\%$

This posterior probability of

If we receive "3 Consecutive Hits" to our helmet from 400 yards away, then:**Observation:** We update our prior probability again. That means that we must replace **0.04348** with **0.1890**.

$P(B_2/C) = { P(C/B_2) \times P(B_2) \over P(C) \; = \; {\sum_{i=1}^n P(C/B_i) \times P(B_i)} } = { 0.9 \times 0.1890 \over (0.99 \times 0.2) + (0.01 \times 0.9) } = 0.8217 = 82.17\%$

This posterior probability of

If we received "3 Consecutive Hits" and now "1 Miss" (Suppose we heard the shot) then:**Observation:** What we must do in this case is use the previous posterior probability as our prior in order to represent the "3 Hits", but the likelihood of missing "given" that's a snipper over the evidence or Total Probability of missing, in order to represent the current "1 Miss".

$P(B_2/\overline{C}) = { P(\overline{C}/B_2) \times P(B_2) \over P(\overline{C}) \; = \; {\sum_{i=1}^n P(\overline{C}/B_i) \times P(B_i)} } = { 0.1 \times 0.8217 \over (0.8 \times 0.99) + (0.1 \times 0.01) } = 0.1036 = 10.36\%$

Now we can see that our probability that the shooter is a snipper after three hits and one miss has dropped to

$\begin{array}{c|lcr}Probability & \text{No Shot} & \text{First Shot} & \text{Second Shot} & \text{Third Shot} & \text{Fourth Shot} \\\hline Regular & 0.99 & 0.95652 & 0.811 & 0.1783 & 0.8964 \\Snipper & 0.01 & 0.04348 & 0.1890 & 0.8217 & 0.1036 \\\hline & \text{} & \text{Hit} & \text{Hit} & \text{Hit} & \text{Miss} \\\hline \end{array}$