How to solve Bayes' theorem problems

 
 
Bayes' theorem blog post.jpeg
 
 
 

Bayes’ Theorem finds the probability of an event, given knowledge that another event already occurred

Bayes’ theorem, also known as Bayes’ law or Bayes’ rule, tells us the probability of an event, given prior knowledge of related events that occurred earlier. Bayes’ theorem is

???P(A|B)=\frac{P(B|A)\cdot P(A)}{P(B)}???

Krista King Math.jpg

Hi! I'm krista.

I create online courses to help you rock your math class. Read more.

 

To simplify Bayes’ theorem problems, it can be really helpful to create a tree diagram. If you’re ever having trouble figuring out a conditional probability problem, a tree diagram is a great tool to fall back on, because it shows all of the sample space of the problem.

 
 

How to solve probability questions using Bayes’ Theorem with tree diagrams


 
Krista King Math Signup.png
 
Probability & Statistics course.png

Take the course

Want to learn more about Probability & Statistics? I have a step-by-step course for that. :)

 
 

 
 

Bayes’ Theorem when we roll one biased die and one unbiased die

Example

You have two dice. One is fair, and the other one is weighted to land on ???6???, ???50\%??? of the time. There’s an equal probability for the other five faces on the biased die. Without knowing which one you’re choosing, you pick one of the dice, roll it, and get a ???6???. What is the probability that you rolled the biased die?

Since we’re looking for the probability that a die is biased given that we already rolled a ???6???, we can say that we’re looking for ???P(\text{Biased}|6)???. In this case, ???P(A) = P(\text{Biased})??? and ???P(B)=P(6)???. So we need to find the following values and put them into a formula:

      • ???P(6|\text{Biased})???

      • ???P(\text{Biased})???

      • ???P(6)???

We know from the problem that ???P(6|\text{Biased})=1/2???. And since there are two die and each choice is equally likely ???P(\text{Biased})=1/2???.

The probability of rolling a ???6??? is the probability of choosing the biased die and rolling a ???6??? or the probability of choosing the fair die and rolling a ???6???.

Let’s first find the probability that the die is biased and we roll a ???6???. ???P(\text{Biased})=1/2??? and the probability of a ???6??? on the biased die is ???50\%???. So the probability of biased and ???6??? is

???P(\text{Biased and }6)=\left(\frac12\right)\left(\frac12\right)=\frac14???

Now let’s find the probability that the die is fair and we roll a ???6???.

???P(\text{Fair and }6)=\left(\frac12\right)\left(\frac16\right)=\frac1{12}???

Therefore, the probability of rolling a ???6??? is

???P(6)=\frac14+\frac{1}{12}???

???P(6)=\frac{3}{12}+\frac{1}{12}???

???P(6)=\frac{4}{12}???

???P(6)=\frac13???

Putting these values into Bayes’ theorem, we get

???P(A|B)=\frac{P(B|A)\cdot P(A)}{P(B)}???

???P(A|B)=\frac{\frac12\cdot \frac12}{\frac13}???

???P(A|B)=\frac{\frac14}{\frac13}???

???P(A|B)=\frac14\cdot\frac31???

???P(A|B)=\frac34???

Let’s look at how we would do this with a tree diagram. We need to show branches in our tree for every event in our problem. First, we picked a die. It can either be the biased die or the unbiased die, and we have an equal chance of picking each one.

biased vs. unbiased
Bayes theorem for Probability and Statistics.jpg

If you’re ever having trouble figuring out a conditional probability problem, a tree diagram is a great tool to fall back on.

Each die can lead to six possible outcomes, so we’ll show these in our tree. We also know that the biased die will land on ???6???, ???50\%??? of the time, and that all five other outcomes are equally likely, which means you could think of this as ???5??? possible outcomes leading to ???6???, and one possible outcome leading to each of the other numbers.

biased and unbiased options

But we always need to make sure our tree is balanced. We can’t have ???10??? branches coming down from the biased side, and ???6??? branches coming down from the unbiased side. We have to have an equal number of branches on both sides, so we’ll scale up both sides to the least common multiple, which is ???60???. That means we need to scale up all the biased branches by ???6??? and all the unbiased branches by ???10???.

counts of biased vs. unbiased options

The next part of the problem tells us that we rolled one die and got a ???6???. So we’ll trim all the branches of our tree that lead to results that didn’t occur.

eliminating results that didn't occur

Now we want to know the probability that we rolled the biased die. Remember that each of the branches on the biased side represents ???6??? possibilities, so there are ???30??? branches coming from the biased side. The branch on the unbiased side represents ???10??? possibilities, so there are ???10??? branches coming from the unbiased side. Therefore, the probability that we rolled the biased die is all the outcomes coming from the biased side, ???30???, divided by all of the branches in total, ???40???:

???P(\text{Biased})=\frac{30}{30+10}=\frac{30}{40}=75\%???

 
Krista King.png
 

Get access to the complete Probability & Statistics course