M04 · optional contextual support
Update a belief from counts
Distinguish conditional directions, joint mass, expectation and posterior probability.
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
Among 1,000 cases, 10 have a condition. A test detects 9 of those and falsely flags 99 of the other 990. A positive result therefore has probability 9/(9+99), about 8.33%, of indicating the condition.
2. Predict before changing a value
Hold sensitivity fixed and change prevalence. Inspect the two sources of positive results. Explain why a high sensitivity is not the posterior probability. 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
- Expected positives / 1,000
- 108.00000
- Posterior P(condition | positive)
- 0.08333
- Expected true positives
- 9.00000
- Expected false positives
- 99.00000
Vertical axis: Posterior after positive. 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.
| Condition | Prior mass | Positive likelihood | Joint positive mass |
|---|---|---|---|
| Present | 0.01 | 0.9 | 0.009000000000000001 |
| Absent | 0.99 | 0.1 | 0.099 |
Conditional rates are assumed stable. P(positive | condition) differs from P(condition | positive). A zero-probability observation has no defined posterior; undefined points are omitted from the curve rather than assigned a numerical probability.
Hold sensitivity fixed and change prevalence. Inspect the two sources of positive results. Explain why a high sensitivity is not the posterior probability.
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
Among 1,000 cases, 10 have a condition. A test detects 9 of those and falsely flags 99 of the other 990. A positive result therefore has probability 9/(9+99), about 8.33%, of indicating the condition.
Distinguish conditional directions, joint mass, expectation and posterior probability. 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
P(H|+) = P(+|H)P(H) / [P(+|H)P(H)+P(+|not H)P(not H)]
H is the condition, + the positive observation, and | means given. Numerator is joint mass; denominator is total positive mass. The formula requires a nonzero denominator.
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
Hold sensitivity fixed and change prevalence. Inspect the two sources of positive results. Explain why a high sensitivity is not the posterior probability. 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 C01, C05, C07, C10, 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
Expectation is Σ outcome×probability. A joint distribution factorizes using conditional probabilities, for example P(A,B,C)=P(A)P(B|A)P(C|A,B). Removing a conditioning variable requires an independence assumption; repeated correlated observations cannot be multiplied as independent evidence.
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
Expectation is Σ outcome×probability. A joint distribution factorizes using conditional probabilities, for example P(A,B,C)=P(A)P(B|A)P(C|A,B). Removing a conditioning variable requires an independence assumption; repeated correlated observations cannot be multiplied as independent evidence.
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 C01, C05, C07, C10, C12. Browse every support topic and course connection.