Creative Maths, including Statistics Learning Centre brings you
Bayes' Theorem 2: Formulas, Tables and Implications
Hi, I'm Dr Nic, and in this video I am going to show how to solve problems involving Bayes'
theorem and the implications of Bayes theorem for our understanding of risk and chance.
This video continues on from Bayes Theorem 1: Introduction
First we will introduce a scenario. Then we will explore it using Bayes formula, and using a table.
Then I will discuss the implications.
The Scenario
You are a manufacturer and you buy parts from two suppliers: You buy 80% of your
requirements from Kapai and 20% from Acme.
Generally 5% of Kapai parts are defective, while 10% of Acme parts are defective.
You know that Acme parts have a higher failure rate, but Kapai do not make enough for your requirements.
A worker has just brought you a defective part.
Which supplier is it more likely to have come from? A. Kapai, B. Acme, C. It's equally likely,
D. we need more information
Well the answer is A- Kapai.
Let's have a look at why this is the case, using formulas, a table and a diagram.
Then we will look at the implications of this for real-world applications.
What we want to know is the probability the part came from Kapai, given that it is defective.
We know the proportion of parts from Kapai, which is 80%.
This is also the probability that any part chosen at random is from Kapai. This is a prior probability.
We can express this as P(K)= 0.8
Similarly the probability that a part came from Acme is P(A)= 0.2
These are the only two suppliers of this particular part, so the probabilities sum to 1.
Now we also know that the probability that a Kapai part is defective is 5%,
We write this: Probabiity of defective, given Kapai = 0.05
Similarly the probability of defective, given Acme = 0.1
So here is all we know at present.
We want to find out the probability of Kapai, given that it is defective.
Let's start with Bayes formula We will replace the A with K
and the B with D and get:
The probability of K given D = the probability of D given K times the probability of K all over the probability of D
Ah - but we do not yet know the probability of defective.
We will need to find that out.
The probability of defective is the probability of K and Defective plus the probability of A and defective.
The probability of K AND defective is the probability of defective given K times the probability of K.
Similarly, The probability of A AND defective is the probability of defective given A times the probability of A.
We add the two of those together and get the overall probability of defective.
It comes to 0.06 or 6%.
It is a higher rate than KaPai, but lower than Acme.
We will complete the calculations: Substituting in the known values,
we end up with the probability that a defective part comes from KaPai is the probability of KaPai,
given defective, which is 2/3 or 67%
Using Bayes' formula we have calculated the probability of K given D is 0.67.
The probability of A given D is 0.33 or one third.
Let us now use a table to summarise and calculate this.
We will have the suppliers in two rows and whether or not they are defective in two columns.
We will make the table about 100 parts so we can use whole numbers.
Out of 100 parts, 80 come from KaPai and 20 come from Acme.
Out of the 80 from Kapai we would expect 5% to be defective. 5% of 80 is 4 parts.
Four out of 80 are defective, so 76 are ok or not defective.
Out of the 20 from Acme we expect 10% to be defective. 10% of 20 is 2 parts.
2 out of 20 are defective, so 18 are ok.
Then we find the totals. 4 + 2 = 6 defective 76 + 18 = 94 ok.
And we check that 6 + 94 = 100. Yes it does!
Now we can use the table to find the probability of K given D, which is 4 out of 6 which equals two thirds or 0.67 as before.
I prefer to use a table as it makes it easier to see what is happening, but the result is the same as for the formulas.
In this diagram you can see that though the proportion of defectives was higher from Acme,
the number of defectives was lower as Acme parts made up a smaller proportion of the whole.
So what are the implications of Bayes' theorem?
With the Parts example, the tendency was to take notice of some information,
while ignoring other aspects of probability. Many people would say that the defective part
is more likely to have come from Acme as Acme has a higher rate of defectives.
However, because the underlying proportion of parts from KaPai was so high, even though there
was a lower rate of defectives among them, the defective part was more likely to come from KaPai.
This is known as the prior probability. Before we had information about whether the part was defective
we had the probability that a part was from KaPai was 80%.
After we knew that it was defective, our posterior probability was 67%.
This is similar to what can happen with screening for disease.
Most diseases that we screen for are only found in a very small percentage of the population.
Because screening tests will always have a degree of error, if a test comes back positive,
it can either mean that the person has the disease, or it is a false positive.
In most cases of screening, the probability that you do not have the disease is still high
even if you get a positive result from a screening test.
You can see this explained more fully in the video about Risk and Screening.
In general, when you are considering how likely something is, based on some new information,
make sure you also take into account the prior probability,
which is affected by the proportions in the population.
This video has been about Bayes' Theorem. See in the description below for
links to other videos about Bayes' Theorem, screening and probability.
Please like this video, subscribe, but most of all join the channel - especially if you are using our
videos in your teaching. Help the channel grow and help me help more and more people like you.
Joining the channel also gives you access to more helpful videos like these.
I am truly grateful for my channel members who help make these videos possible.
Special thanks to my super supporters: Rana Al Zamil and kiwikid in the USA.
Thank you