Probability, likelihood, and Bayes: reasoning under uncertainty
From conditional probability to likelihood and Bayes' theorem, build foundations that recur across statistics and machine learning.
Learning goal
Distinguish probability from likelihood, write a simple likelihood, and interpret Bayes' theorem with a numerical example.
Prerequisites
- Basic probability
- Basic algebra
- Exponential function
Conditional probability
When B is known, the probability of A is described with conditional probability.
Bayes' theorem
Bayes provides a way to update an initial belief using observed evidence.
How is likelihood different from probability?
For likelihood, observed data are fixed while the model parameter varies. Likelihood is therefore not the probability of a parameter; it compares how well different parameter values explain the observed data.
Bernoulli example
If a coin is flipped n times and produces k heads, the maximum-likelihood estimate for p is k/n.
Connection to machine learning
Probability and likelihood appear in classification, estimation, and statistical losses. Understanding them helps explain model outputs and the statistical assumptions behind them.
Exercises
- For k=7 and n=10, compute the Bernoulli MLE.
- Explain the difference between P(A|B) and P(B|A).
- Give an example of Bayes updating a belief in diagnosis or decision-making.
Related project
HowDeepLearningWorks
Learning and optimization concepts are developed through a technical learning path.
Open sourceRelated solutions
Working on an AI problem under uncertainty?
A problem can move from data and statistical assumptions through modeling and implementation.