Skip to content
Minsing Log
Go back

English Edition

Bayes' Theorem

Programming & CS

What is Bayes’ Theorem?

Bayes’ theorem is a law of probability used to infer the cause after an event has occurred.
In other words, it provides a way to update the probability of another event occurring based on an event that has already occurred.


1. Formula for Bayes’ Theorem

Bayes’ theorem is expressed as follows using conditional probability:


2. Why Is Bayes’ Theorem Important?

Bayes’ theorem is the process of updating probabilities when new information is provided.
In other words, it calculates the posterior probability by modifying the existing probability (prior probability) using new information (likelihood).


3. Example: Disease Diagnosis

Suppose that the probability of having a certain disease (e.g., influenza) is 1%.
The probability of receiving a positive result on a test for this disease is as follows:

Here:

We need to find the probability that a person actually has the disease when the test result is positive, P(D | T^+).

Applying Bayes’ Theorem

First, we need to find P(T^+). The overall probability of receiving a positive test result is calculated as follows:

Substituting the values:

Now, use Bayes’ theorem to find P(D | T^+):

In other words, even if the test result is positive, the probability that the person actually has the disease is only about 16.1%.
(This is why you should not rely solely on the test result!)


4. Extension: Multiple Causes (Using the Law of Total Probability)

Bayes’ theorem can also be used when there are multiple causes rather than a single cause (A).

If B occurred due to one of several possible causes A_1, A_2, …, A_n:

This is called the Law of Total Probability.


5. Conclusion

If you have any further questions, please feel free to ask! 😊

공개 여정 구독

글이 올라오면 이메일로 보내드릴게요.

개발, 창업, 배움, 실패와 회고를 짧고 솔직하게 기록합니다. 검색으로 스쳐가는 독자가 아니라 여정을 따라오는 팬을 만들기 위한 뉴스레터입니다.

뉴스레터는 준비 중입니다. 그동안 RSS 로 구독하거나 이메일 로 알림을 요청해 주세요.


Share this post:

Comments

Sign in with GitHub to leave a comment.


Previous Post
What It Means for a Model to Learn
Next Post
If a Problem Only Tells You That A and B Are Dependent, Without Giving the Intersection Probability or Conditional Probability