This page can stand on its own, so the first job is to build the mental picture carefully.
Probability Basics
Events are subsets of a sample space, and probabilities obey a few axioms; from there you get conditional probability, independence, and Bayes' rule.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
You see one outcome, but you do not see the hidden situation that produced it. How should your belief change?
Probability starts by listing possible worlds and assigning mass to sets of worlds. An event is a subset of those worlds. Conditional probability is what happens when you learn that the true world lies inside one event: you keep only the compatible worlds and renormalize their mass back to 1.
This "filter then renormalize" picture is the foundation for likelihood, Bayesian inference, calibration, uncertainty, and losses such as cross-entropy. In machine learning, a model is often a device that assigns probabilities to possible observations or labels. The first question is not whether the model is deep; it is whether its probability statements obey the basic rules.
The analogy has a limit: probability is not only long-run frequency. In Bayesian inference it can also represent degrees of belief over unknowns. What stays invariant is the algebra of events, conditioning, and normalization.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
For this page, start with a finite probability model. A probability space is (Ω,F,P):
- Ω: sample space (all outcomes)
- F: events (in a finite model, usually all subsets of Ω; in general, a sigma-algebra of measurable subsets)
- P: probability measure
For events E∈F, the basic axioms are:
- P(E)≥0
- P(Ω)=1
- If E1,E2,… are pairwise disjoint, then
For finite examples, this reduces to adding the probabilities of disjoint pieces.
The complement rule follows:
Conditional probability means updating probabilities after observing an event O:
The denominator matters. Conditioning does not merely keep E∩O; it rescales all probability inside O so the new total mass is 1. If P(O)=0, there is no mass inside the observed event to renormalize, so P(E∣O) is undefined.
The product rule is the same equation rearranged:
when the conditioning events have positive probability.
Independence means learning one event does not change the probability of the other:
Equivalently, when P(O)>0, independence means P(E∣O)=P(E).
Bayes' rule follows by writing the same intersection two ways:
If C1,…,Cm are mutually exclusive hidden cases that cover the sample space, they form a partition. The denominator can be expanded by total probability:
for hidden cases with positive prior probability.
That gives the form used in classification, diagnosis, and Bayesian updating:
The numerator is likelihood times prior. The denominator is the total evidence. In the demo, the hidden cases are "coin A was chosen" and "coin B was chosen," while O is the observed Head or Tail.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
rng = np.random.default_rng(0)
# Hidden state: choose coin A or coin B, then observe Head or Tail.
prior_B = 0.30
p_head_A = 0.20
p_head_B = 0.80
prior_A = 1 - prior_B
joint = {
("A", "H"): prior_A * p_head_A,
("A", "T"): prior_A * (1 - p_head_A),
("B", "H"): prior_B * p_head_B,
("B", "T"): prior_B * (1 - p_head_B),
}
assert abs(sum(joint.values()) - 1.0) < 1e-12
# Bayes numerator = likelihood times prior.
bayes_numerator = p_head_B * prior_B
evidence_H = p_head_A * prior_A + p_head_B * prior_B
posterior_B_given_H = bayes_numerator / evidence_H
assert abs(bayes_numerator - joint[("B", "H")]) < 1e-12
assert abs(evidence_H - (joint[("A", "H")] + joint[("B", "H")])) < 1e-12
print("P(H):", round(evidence_H, 3))
print("P(B and H):", round(joint[("B", "H")], 3))
print("P(H | B)P(B):", round(bayes_numerator, 3))
print("P(B | H):", round(posterior_B_given_H, 3))
# Monte Carlo check: simulate the same process.
n = 200_000
is_B = rng.random(n) < prior_B
head_probability = np.where(is_B, p_head_B, p_head_A)
heads = rng.random(n) < head_probability
print("simulation P(B | H):", round(is_B[heads].mean(), 3))
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Live Concept Demo
Explore Probability Basics
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Choose what to inspect in Probability Basics. This shared fallback is an observation guide, not evidence of learning.
Move the prior and likelihood sliders, then switch the observation between Head and Tail. After you reveal, the table shows the four joint probabilities. Conditioning keeps the column matching the observation and renormalizes it.
When Head is observed, the likelihoods are P(H∣A) and P(H∣B). When Tail is observed, the likelihoods are P(T∣A)=1−P(H∣A) and P(T∣B)=1−P(H∣B).
Watch the base rate. A coin can be very good at producing heads, but if it is rare enough, observing heads may still leave uncertainty about which coin was chosen.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
Concept: Probability Basics
What is the smallest example that makes Probability Basics click without losing the math?
Object contextProbability
concept:probability/probability-basicsProbability Basics
What is the smallest example that makes Probability Basics click without losing the math?
Start with the prediction checkpoint, then compare the reveal to the mental model.
Take this moveStudy modes
Keep the object fixed; change the lens.Route back through the notebook
Carry the same object through intuition, math, code, and demo.
Events are subsets of a sample space, and probabilities obey a few axioms; from there you get conditional probability, independence, and Bayes' rule.
The next edge should feel earned: use the demo prediction here before following Random Variables.
After The First Pass
Turn the concept into an inspected object.
The lower panels are one second act: keep the object fixed, inspect it visually, check source boundaries, practice transfer, then attach the research question.Mechanism Storyboard
See the idea move before the page explains it
Events are subsets of a sample space, and probabilities obey a few axioms; from there you get conditional probability, independence, and Bayes' rule.

Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Probability Basics should make visible.
Visual Inquiry
Make the image answer a mathematical question
Events are subsets of a sample space, and probabilities obey a few axioms; from there you get conditional probability, independence, and Bayes' rule.
Which visible object should carry the first intuition?
Pick the cue that should make Probability Basics easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
What is the smallest example that makes Probability Basics click without losing the math?
concept:probability/probability-basicssources: deisenroth-2020-mml
Open the closest source note before trusting the local explanation.
1 selected-object source shown first; 1 reference total.
Audit the claim boundary, then ask from the same selected object.
Grounds probability basics, conditional probability, Bayes' rule, and expectation for ML readers.
Mathematics for Machine Learning introduces probability for ML through probability spaces, events, conditional probability, independence, Bayes' theorem, and expectation, matching this pa...
This checks the finite-event probability and conditioning bridge used here, not continuous regular conditional probabilities or philosophical interpretations of probability.
Claim Review
Events are subsets of a sample space, and probabilities obey a few axioms; from there you get conditional probability, independence, and Bayes' rule.
What is the smallest example that makes Probability Basics click without losing the math?
concept:probability/probability-basicssources: deisenroth-2020-mml
Treat every claim as provisional until source support and a local witness agree.
1 structured claim check on this concept.
Run the prediction or practice transfer before asking for a grounded review.
Publisher-side editorial review is not independent replication. Claims without it still need exact source-support review. 1 reference and 3 local witnesses are available for inspection.
Mathematics for Machine Learning introduces probability for ML through probability spaces, events, conditional probability, independence, Bayes' theorem, and expectation, matching this page's finite-event an...
This checks the finite-event probability and conditioning bridge used here, not continuous regular conditional probabilities or philosophical interpretations of probability.
Checked MML chapter 6.1-6.3: it defines the sample space as all outcomes, event space as subsets of Omega, assigns each event A a probability P(A) in [0,1], and requires total mass P(Omega)=1. Its finite coin example adds the probabilities of disjoint outcomes in a union, section 6.2 defines conditional probabilities as table fractions, and section 6.3 derives Bayes' rule with evidence normalizing the posterior.
Reviewer: codex+oracle; reviewed 2026-05-06Practice notebook
Use the idea, then test it somewhere new
Events are subsets of a sample space, and probabilities obey a few axioms; from there you get conditional probability, independence, and Bayes' rule.
What is the smallest example that makes Probability Basics click without losing the math?
concept:probability/probability-basicssources: deisenroth-2020-mml
Use one state from Probability Basics to explain what changes, why it changes, and which assumption the explanation needs.
No learner move yet; no learning state is inferred.
Write first, use only the help you need, then try a new case without it.
Use one state from Probability Basics to explain what changes, why it changes, and which assumption the explanation needs.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Write an attempt before asking the companion.
0 of 3 progressive hints opened.
This draft and any AI response do not establish mastery; a later unassisted case can.
- ObjectConceptProbability Basics
- PredictBefore revealProbability Basics prediction
- WitnessCompare codeProbability Basics code witness 1
- RoomAsk groundedChecking local snapshot
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Probability Basics
What is the smallest example that makes Probability Basics click without losing the math?
These are fixed, deterministic perspectives derived from the selected object. They do not represent people, community contributions, or independent review.
Source ids deisenroth-2020-mml must support the exact object, not just the surrounding topic.
Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion.
Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo.
The learner can state the mechanism in their own words
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:probability/probability-basics.
- Source ids to inspect: deisenroth-2020-mml
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Probability Basics Object key: concept:probability/probability-basics Context: Probability Anchor id: concept/concept-notebook/probability/probability-basics Open question: What is the smallest example that makes Probability Basics click without losing the math? Evidence to inspect: - Source ids to inspect: deisenroth-2020-mml - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan Deterministic role lenses for this object: - Boundary: fixed perspectives, not people, community contributions, or independent review - Source-checking summary: Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Teach/transfer move: Turn the mechanism into one sentence that predicts a neighboring concept. - Assumptions: - Source ids deisenroth-2020-mml must support the exact object, not just the surrounding topic. - The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. - The concept explanation is local atlas prose until checked against its math, code, and source support. - Prerequisite gaps should become a repair route, not a reason to leave the object vague. - Role-lens requests: - Learner: ask for "Ask what would make "Probability Basics" feel predictable rather than familiar." | assumption: Source ids deisenroth-2020-mml must support the exact object, not just the surrounding topic. | next action: The learner can state the mechanism in their own words - Researcher: ask for "Source ids to inspect: deisenroth-2020-mml" | assumption: The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. | next action: The learner can name the prerequisite that would repair confusion - Experimenter: ask for "Choose one variable or condition to perturb before asking for an explanation." | assumption: The concept explanation is local atlas prose until checked against its math, code, and source support. | next action: The learner can predict how the mechanism changes under one perturbation - Professor: ask for "Find the smallest transferable rule a learner could reuse without the AI." | assumption: Prerequisite gaps should become a repair route, not a reason to leave the object vague. | next action: Teach or transfer: Turn the mechanism into one sentence that predicts a neighboring concept. What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action. Current deterministic role lens for this object: - Role lens: Learner - Evidence request: Ask what would make "Probability Basics" feel predictable rather than familiar. - Assumption to keep visible: Source ids deisenroth-2020-mml must support the exact object, not just the surrounding topic. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Next action: The learner can state the mechanism in their own words
concept/concept-notebook/probability/probability-basics
concept:probability/probability-basics