By: Krischal Khanal
In the previous blogs, we saw how to use Bayes' Theorem to update belief. Then we coded that up, and ended with a question on what if result is stochastic? However, to understand that we must understand one missing piece of the Bayes' Theorem.
Bayes' Theorem is classically defined as:
Identities
Where,
Where, the symbols are defined as:
: Hypothesis : Evidence/event
Using Bayes' Theorem we are able to update the belief of hypothesis in the light of evidence.
In other words,
Note
The belief in a hypothesis means "how much certain are you that the hypothesis is true?" Thus, if hypothesis is
, belief in that hypothesis is . It's a probability.
If you assign a probability to your belief, you also implicitly assign rest of the probability for the exact negation of the belief.
Let's take the same example of rare disease.
If
Then,
It's always the case that,
If you can use Bayes' Theorem to update
Thus,
Identity
Complementary Bayes Theorem
This is the missing half of the Bayes' Theorem. It might seem obvious, in part because it's obvious. But generalizing this, we gain a profound understanding of the Bayes' theorem.
Generalizing the Bayes' Theorem: 1. Multiple hypotheses
Here we consider two competing, mutually exclusive hypotheses:
If we sum all the mutually exclusive hypothesis.
Adding them,
And, if there were
Using Bayes' Theorem for each one, we get:
Equivalently,
Note
Every denominator can be replaced by
, but it's important to emphasize that it's composed of multiple hypothesis, and your belief has a role in shaping the overall marginal probability .
Using Bayes' Theorem in Parallel:
Keep in mind, the sums of mutually exclusive hypotheses remain 1 even after update.
Bayes' Theorem is only shifting the probabilities (adjusting the belief) among the hypotheses based on the evidence.
What if hypotheses aren't mutually exclusive?
We can update the belief just the same, but the sum of the probabilities isn't guaranteed to be a constant.
Thus, we are able to update belief of discrete probability distribution over the finite hypothesis.
Generalizing the Bayes' Theorem: 2. Continuous domain
We can even generalize where domain of hypothesis is continuous, and belief is in the form of probability density function.
This is the foundation for Bayesian Inference. If you imagine E being data and
In the next blog we'll look into coding the parallel bayesian update for multiple hypothesis.
Code blocks are licensed under the MIT License. All other content is licensed under CC-BY 4.0 Copyright © 2026 Krischal Khanal.