If you’ve recently searched for something on Google, Bayes' Theorem was used to display your search results. The same is true for those recommendations on Netflix. Hedge funds? Self-driving cars? Search and rescue? Bayes' Theorem is used in all of the above and more. At its core, Bayes' Theorem is a simple mathematical formula that has revolutionized how we understand and deal with uncertainty. If life is seen as black and white, Bayes' Theorem helps us think about the gray areas. When new evidence comes our way, it helps us update our beliefs and create a new belief.
Bayes' Theorem is often called Bayes' Rule or Bayes' Formula. Bayes' Theorem is a law of probability theory. It helps us work with, revise, and understand probabilities when we are presented with new evidence.
Practically speaking, the theorem helps us quantify or put a number on our skepticism and make more informed, rational choices. It helps us answer the following:
When we encounter new evidence, how much should it change our confidence in a belief?
Bayes' Theorem Explained: 4 Ways
- Bayes' Theorem helps us update a belief based on new evidence by creating a new belief.
- Bayes' Theorem helps us revise a probability when given new evidence.
- Bayes' Theorem helps us change our beliefs about a probability based on new evidence.
- Bayes' Theorem helps us update a hypothesis based on new evidence.
Scenario 1: The Flu
Let’s say that you are at work one day and have just finished lunch. You suddenly feel horrible and find yourself lying down. Wasn’t your friend at work recently sick with the flu? What if you have it? Will you have to cancel your big trip next week?
You have a headache and sore throat, and you know that people with the flu have the same symptoms roughly 90% of the time. In other words, 90% of people with the flu have the same symptoms you currently have. Does this mean you have the flu?
Wanting to gain a little more information you roll over, grab your phone and search Google. You find a reputable article that says that only 5% of the population will get the flu in a given year. Ok. So, the probability of having the flu, in general, is only 5%.
You then spot one more statistic that says 20% of the population in a given year will have a headache and sore throat at any given time. Do you have the flu? What should you do?
P(A) - In our formula, this ingredient is represented as P(Flu) and answers the question: What is the probability of you having the flu? This number is .05
P(B|A) - In our formula, this ingredient is represented as P(Symptoms | Flu). This number is .9
P(B) - In our formula, this ingredient is represented as P(Symptoms) and answers the question: What is the probability of you having the symptoms? This number is .2.
Conclusion: So, after plugging each ingredient into the formula our answer is 22.5%. We can conclude from this that if you have a sore throat and headache you only have a 22.5% probability of having the flu. Wow! Now, remember what Bayes' Theorem does: it helps us update a hypothesis based on new evidence.
Originally, we thought that the probability of having the flu was as high as 90%! This belief was based on our latching on to P(B|A). However, our answer P(A|B) is very different! The 22.5% we ended with is more accurate than the 90% probability we started with.
This problem is a fantastic illustration of the power that Bayes' Theorem can give us when facing tough uncertainties. It is also a tweaked example of a questionnaire given to 1000 gynecologists. In the study, only 21% of gynecologists chose the correct answer while almost 50% chose the equivalent of our 90%!
Conclusion for a different scenario: Once we’ve plugged all of our ingredients into the formula we arrive at 64%. Based on this, we can conclude that the probability of the truck being rigged with a gun given that heavy firepower came our way is 64%. We originally thought the probability was higher around the 80% mark, but now we can see it hovers about 15 % lower.
We chose this last scenario to contrast the first two and demonstrate that using Bayes Theorem does not always provide a clear answer. Sometimes a probability only slightly changes.
If some part of info is missing…
In real life this is typically the case and often requires us to discover one or more of the ingredients. P(B) is often the culprit. Decision trees are a fantastic and powerful tool that can be used to quickly find P(B) and give you a clear understanding of how it is discovered. They are a great visual aid for helping you grapple with and comprehend probability questions.
The Scenario: (Expanded from Example Section 1)
You grab your phone and search for some answers. Google tells you that 5% of the population will get the flu each year. A few minutes pass by and you remember that you just downloaded a new app that predicts illness. Why not see what it says?
You open it and input your symptoms, and within a few seconds the app predicts that you have the flu. It also displays the following: It correctly predicts people having the flu 75% of the time. 20% of the time it predicts that people have the flu when they do not have the flu.
You throw the phone onto the seat beside you. What do you make of this?
Now, what is P(B)? How do we define what event “B” is so we can try to find it? To find our answers, let’s go back to what we are trying to figure out, which we defined in Step 1. Step 1 can be broken into two parts, and P(B) is tucked into the second part.
The two parts of Step 1 are: Probability of having the flu. This is P(A). Probability of the app predicting yes “B” given that you have the flu “A” is .75. This is P(B|A), which contains both events “A” and “B”. This tells us that the definition of event “B” is the app predicting yes.
Now we know the definition of event “B”. But what about its probability P(B)? We were given a third number in the scenario (20%), but this is not P(B). It is a part of P(B). To figure out where it fits and how to solve for P(B) we need to do the following:
Let’s think for a moment. How many ways can the app arrive at a yes (positive) prediction? There are only 2 ways: It can predict a positive prediction that is correct. It can predict positive prediction that is false.
All we need to do is multiply the numbers of each yes path and then add the answers together.
Example Section 3: Solving For Two Possible Outcomes With All Probability Data Provided
Sometimes we are presented with two possibilities and we want know which is greater. For example, say you are sneezing and coughing. Is it an allergy or cold? Given the information you have (your symptoms), which has the greater probability?
Basically, we’ll be applying Bayes' Formula to both possibilities, and then comparing our answers to find which is the greatest.
Real Life: Search and Rescue What if you were lost at sea? How could search and rescue find you? In 2014 a missing fisherman was discovered using Bayes' Theorem.
Real Life: Spam Filtering In 1998 Microsoft applied for a spam filter patent that used a Bayesian filter. Bayesian filters determine if an email is spam or not based on the email’s content. When an email is received, each word is read and the filter determines the probability of it being spam or legitimate (often defined as spam or ham). What sets Bayesian filters apart from other email filters though is that they learn and adapt to each individual email user. And that, in a nutshell, is why they are so effective.
Real Life: Driverless Cars Google’s driverless cars use a form of Bayesian modeling to help the vehicle know its location.
The key to using Bayes' Theorem in everyday decision making is to make rough calculations quickly in your mind that will help you discover the odds of an event, not the probability. That is really the only way the theorem can be used quickly on a daily basis.
Scenario 1: Dating
Step 1: Let's assign some probability numbers. Number 1: Guess the probability that she likes you regardless of anything else. Based on your past dating success, you’d say this is 20%. You think at least 2/10 girls will like you.
Number 1 = 2 **to keep it simple all our numbers will be whole between 1 and 10 and have no decimal place.
Number 2: Guess the probability that she doesn’t like you regardless of anything else. Based on our answer above, if your past history tells you that your dates like you 2/10 times, that means your date will not like you 8/10 times, or 80%. Number 2 = 8
Number 3: Guess the probability of your date laughing and flirting if she likes you. Considering that she is flirting, you guess that there is a 90% chance of this. Number 3 = 9
Number 4: Guess the probability of your date laughing and flirting if she doesn’t like you. You think this is low, so you guess 10%. Number 4 = 1
Step 2: Line your numbers up as ratios.
Conclusion: Based on a quick calculation, the odds that she likes you are 9 to 4, or slightly greater than 2 to 1. For simplicity, we’ll stay with the 2 to 1 ratio. What does this mean? This means it is roughly twice as likely that she likes you as opposed to not liking you. And that’s a good thing, right?!