Skip to content
Home » Blog » Bayes’ theorem

Bayes’ theorem

Hello, Compounders! You must have heard stories from friends and tried to guess the person they were talking about. For example, as experienced by Ilham and Aldo below.

Aldo: “Ham, yesterday I was chatting with someone at a coffee shop, and that person was really cool. I didn’t expect that person to be so polite.”

The first piece of information Ilham received was that Aldo had been chatting with someone at a coffee shop. Based on this information, Ilham assumed that Aldo’s conversation partner was a woman.

Aldo: “And she wore an oversized hoodie in my favorite color, which is cream!”

After seeing how excited Aldo was, Ilham became even more confident that Aldo’s conversation partner was a woman. Ilham assumed that it couldn’t possibly be a man, because Aldo was so excited when talking about it.

What is bayes theorem

Bayes’ theorem is a statistical method used to determine the probability of an event occurring based on existing data. This method adjusts when new information is entered, resulting in better decisions.

History of Bayes’ theorem

In the 1700s, when probability theory was still in its early stages of development, an English clergyman named Thomas Bayes wanted to know how to deduce the cause of an effect. His basic idea was something like this: how could he know the probability or likelihood of a future event if he only knew how many times that event had occurred in the past?

He wanted exact figures, but since there was no good method to answer his question, what he did was guess and adjust his guesses as he obtained additional information.

The experiment conducted was as follows: Bayes stood behind a table and asked his assistant to throw a ball onto the table, which had been specially designed to be as flat as possible so that the ball could land anywhere. He then guessed where the ball would land without looking.

Throw after throw, Bayes was able to reduce the area where the first ball was likely to land. Each new piece of information would narrow down the area where the ball was likely to be. Each guess would form the basis for the next guess.

Bayes never made his findings public; he died in 1761. His friend Richard Price found some of his notes, re-wrote the research, and published it. This research basically still did not receive much attention from the general public until Pierre-Simon Laplace read it.

Bayes’ theorem formula

Bayes’ theorem uses fundamental principles of statistics and probability to calculate the probability of an event happening. This method is based on existing data and can change as the existing data changes; this is also known as the posterior probability.

A posteriori probability is the updated probability of an event after taking new information into account. A posteriori probability is calculated by updating the initial probability using Bayes’ theorem. In other words, a posteriori probability is the probability that event A occurs, given that event B has already occurred.

An example of the application of Bayes’ theorem

Now that Compounders understand what Bayes’ theorem is and how this method was discovered, it’s time to learn how to apply it. Imagine you’re working in a research lab studying infectious diseases. You’ve been assigned to investigate a rare disease in a rural town with a population of 10,000. Here’s roughly the data you’ll have available:

  • Only 1% of the population has that disease
  • Medical tests can detect the disease with 99% accuracy
  • But sometimes the tests are inaccurate and give false-positive results in 5% of healthy people

A week after conducting research in that area, you were tested and found to be positive for the disease. You must have panicked, but it turns out the results aren’t necessarily accurate. What is the accuracy rate of medical tests when they yield a positive result for someone who is still healthy?

Your friend explained that you might not have contracted that infectious disease. He said, “Actually, you might not be sick yet. Let me do the math first. Here’s how it works.”

Step one: Determine how many people are actually sick

Determine who is actually sick. 1% of 10,000 is 100 people; since the test has a 99% accuracy rate, only 99 people will test positive.

Step two: Determine the number of healthy people who tested positive, plus the number of sick people

Let’s determine how many people are actually healthy; the rest of the population is 9,900. However, because the test has a 5% error rate, 495 healthy people will still test positive. If we add them to the number of people who are actually sick, the total is 495 + 99 = 594 people.

Third step: What is the probability that the person is actually sick?

From the data above, we can conclude that out of the 594 people who tested positive, only 99 actually fell ill. Therefore, the probability is 99/594 ≈ 16.6%.

After your colleague explained that the new accuracy rate was 16.6%, he immediately suggested that you get another test to confirm whether or not you actually have the disease.

When can you use Bayes’ theorem?

Compounders have discovered that Bayes’ theorem is highly flexible and adaptable to changes in data. If you’re wondering when you can use Bayes’ theorem, the answer is whenever you’ve identified a probability and there’s an event or condition that causes that probability to change. And the application of Bayes’ theorem isn’t limited to any specific field; as long as you’ve identified a probability and there are factors causing it to change, you can use this method.

Also read: How can you improve an outdated business