Bayes theorem – a worked example

So I found this quite a mind-bender, although I believe this is part and parcel of the typical high-school maths syllabus now! Here is my stab at understanding the theorem and how it relates to a real-life example…

Problem wording: Jane witnessed a robbery in which a car was involved. It is known that 1 in 10 cars are black. Jane said the car involved in the robbery was a black car. The court tested Jane’s reliability in correctly identifying cars as black in similar twilight conditions to the time when the robbery occurred and concluded that she correctly identified the car colour 80% of the time. What is the probability that the car involved in the robber was black, given her testimony?

Problem-solving source: https://betterexplained.com/articles/an-intuitive-and-short-explanation-of-bayes-theorem/

My proposed solution:

Using the tabular method in the problem-solving source, I populated a table as follows:

Black (10%) – A Not black (90%) – not A
Identified black – X True positive:
0.1 * 0.8 = 0.08
False positive:
0.9 * 0.2 = 0.18
Identified not black False negative:
0.1 * 0.2 = 0.02
True negative:
0.9 * 0.8 = 0.72

Using the longer equation given:

Pr(A|X) = [Pr(X|A) Pr(A)] / [Pr(X|A) Pr(A) + Pr(X|not A)Pr(not A)]

I derived the below values:

Pr(A|X) = Probability of a car being black given Jane’s testimony that it is

Pr(A) = Probability of a car being black = 0.1

Pr(not A) = Probability of a car being not black = 0.9

Pr(X|A) = Probability of it being identified as black given that the car is black = 0.8

Pr(X|not A) = Probability of being identified as black, given that the car is not black = 0.2

Therefore:

Pr(A|X) = (0.8 * 0.1) / (0.8 * 0.1) + (0.9 * 0.2)

Pr(A|X) = (0.08) / (0.08 + 0.18)

Pr(A|X) = 0.08 / 0.26

Pr(A|X) = 0.3076

Pr(A|X) = 30.77%

But is it correct?! Feel free to use the Contact page to let me know if there is a flaw in my logic somewhere 🙂

One thought on “Bayes theorem – a worked example

Comments are closed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: