M04 · optional contextual support
Separate likelihood from a prior
Fit a Bernoulli probability and compare maximum likelihood with explicit prior assumptions.
Start with arithmetic, percentages and basic algebra. Open any section directly. Practice and completion here do not change any AI course requirement or the original five-lesson mathematics pilot.
1. Try a concrete case
Six successes in ten independent trials give maximum likelihood 0.6. A symmetric Beta(2,2) prior gives posterior mean (6+2)/(10+4)=4/7, closer to 0.5.
2. Predict before changing a value
Keep successes and trials fixed while changing prior strength. Compare MLE, posterior mean and interior MAP. Then add trials without adding successes and explain the change. Name the quantity you expect to change and one you expect to stay fixed before using the controls.
3. Experiment
Change one quantity, follow every calculation
- MLE
- 0.60000
- Posterior mean
- 0.57143
- Interior MAP
- 0.58333
- Prior
- Beta(2, 2)
Vertical axis: Likelihood / peak. Fixed scales; 0 points clipped for display. Lines join sampled values to aid reading; they do not create extra observations. Exact numerical values are below.
| p | Relative likelihood |
|---|---|
| 0.01 | 0.00000 |
| 0.11 | 0.00093 |
| 0.21 | 0.02797 |
| 0.31 | 0.16843 |
| 0.41 | 0.48191 |
| 0.51 | 0.84929 |
| 0.61 | 0.99791 |
| 0.71 | 0.75857 |
| 0.81 | 0.30816 |
| 0.91 | 0.03119 |
Independent Bernoulli outcomes are assumed. Likelihood varies the candidate parameter while data stay fixed; it is not a probability distribution over parameters until combined with a prior and normalized. Interior MAP formula excludes boundary modes.
Keep successes and trials fixed while changing prior strength. Compare MLE, posterior mean and interior MAP. Then add trials without adding successes and explain the change.
Controls save locally as practice. No timers, remote services or GPU are required. Maximum numerical work is a bounded small table or 256 bootstrap resamples.
4. Understand the calculation
Start with a calculation you can inspect
Six successes in ten independent trials give maximum likelihood 0.6. A symmetric Beta(2,2) prior gives posterior mean (6+2)/(10+4)=4/7, closer to 0.5.
Fit a Bernoulli probability and compare maximum likelihood with explicit prior assumptions. The experiment changes one named quantity at a time and shows the intermediate values, rather than asking you to accept a final score. Before changing a control, write down which value you expect to move and why.
Read the formula in words and symbols
likelihood(p) ∝ p^k (1−p)^(n−k); posterior mean = (k+α)/(n+2α)
k counts successes, n counts independent trials, p is a candidate probability, and α controls the symmetric Beta prior. ∝ means proportional while the observed data stay fixed.
A subscript names a coordinate, case or time index; it is not multiplication. A summation sign means add the terms for the stated indices. Parentheses identify which calculation happens first. Carry units through arithmetic: adding incompatible quantities or confusing a rate with a count changes the question.
Connect the visual and the numbers
Keep successes and trials fixed while changing prior strength. Compare MLE, posterior mean and interior MAP. Then add trials without adding successes and explain the change. The plot uses declared fixed axes, so a new setting does not silently rescale the apparent change. Any clipped values are counted and remain available in the numerical table. Do not infer an exact curve or a new observation from a line drawn between points.
Use it in an AI experiment
These ideas support C05, C06, C07, C12. Use the return link when you entered from an AI lesson; its original section and experiment remain separate. A mathematical support calculation is a way to inspect an assumption, not evidence that a trained model generalizes.
Optional derivation and implementation depth
Maximum a posteriori chooses a posterior mode, not its mean. For interior Beta parameters, MAP=(k+α−1)/(n+2α−2); boundary cases require separate treatment. Log likelihood sums terms instead of multiplying tiny probabilities. A prior expresses a modeling choice and should be inspected for sensitivity.
Recompute the worked example with a separate piece of arithmetic or a short program. State the domain and test a boundary case before using the formula elsewhere. Guided numerical practice, independent implementation and human review are different outcomes.
Optional implementation and research depth
Maximum a posteriori chooses a posterior mode, not its mean. For interior Beta parameters, MAP=(k+α−1)/(n+2α−2); boundary cases require separate treatment. Log likelihood sums terms instead of multiplying tiny probabilities. A prior expresses a modeling choice and should be inspected for sensitivity.
Recompute one row independently, then test a boundary case and state which assumption it probes. Passing the supplied practice case does not establish independent implementation proficiency.
5. Apply it to a different case
Practice not yet passed; independent mastery and human review are not claimed.
6. Continue when useful
Completion not recorded. Skipping retains settings and practice; it never awards completion.
Used in C05, C06, C07, C12. Browse every support topic and course connection.