Menu

Bayes' Theorem

Chapter 3: Bayes’ Theorem Examples to Get You Started

In Chapter 1: Bayes’ Theorem for Dummies, Bayes’ Theorem was demonstrated visually without using its formula. Now, in Chapter 3: Bayes’ Theorem Examples to Get You Started we’ll see how we can derive the same numbers using the formula. To refresh your memory, we had two boxes of cookies in front of us. One box was filled with 10 chocolate chip cookies. The other box had 5 chocolate chip and 5 peanut butter cookies. We then closed our eyes and picked a cookie out of a box, and when we opened them back up we had selected a chocolate chip cookie.Bayesian Probability Represents a Small Box

After doing this we discovered the following:

  • There is a ~66% probability we chose the cookie from Box A
  • There is a ~33% probability we chose the cookie from Box B

This time, let’s follow 4 steps to finding the answer using the Bayes’ formula. We will find the answer for Box A first and then deduce from this to find the answer for Box B.

Step 1: To start, we always need to determine what we are wanting to find.
We want to know the probability of Box A given that we selected a chocolate chip cookie.

Step 2: Write what you want to find as a formula.
Cookie Example Bayes Formula

Step 3: Find each ingredient. Then, plug it in.

  • P(Box A) = .5 * To answer this we ask the following: What is the probability of drawing from Box A? Remember, this probability is independent of all other events. Since there are only two boxes and the probability of selecting from either is equal, the answer is .5
  • P(CC Cookie) = .75 * To answer this we ask the following: What is the probability that we will select a chocolate chip cookie? Remember, this probability is independent of all other events. There is 20 cookies total in both boxes, and 15 of them are chocolate chip. So, 15/20 is .75
  • P(CC Cookie | Box A) = 1* To answer this question, we ask the following: What is the probability of selecting a chocolate chip cookie given that we have selected from Box A? Since there are only chocolate chip cookies in Box A, the probability is 1. * A probability of 1 represents a 100% probability of something occurring.

Now, we can plug each ingredient into the formula:
Cookie Example Bayes Math

Answer: We now know that there is a ~66% probability that we selected from Box A given that we have a chocolate chip cookie. To find the probability of selecting Box B, we can follow steps 1-3 again by replacing the term Box A with Box B. Or, we can simply deduce from our answer that if there is a ~66% probability Box A was selected, there must be a ~33% chance Box B was selected. Since all probability adds up to 1, we can discover this by doing the following: 1-.66 = .33, or ~33%.

Continue on to Chapter 4: Bayes’ Theorem Flu Example.