Skip to main content

Probability Mechanics Lab

Build the core probability objects by hand: sample spaces, random-variable maps, expectation, variance, conditioning, and transformations.

probability mechanics

Expectation

A weighted center of mass. Probabilities are the weights; random-variable values are the positions.

E[Y]
1.04
Var(Y)
2.72
P(event)
32%
active atoms
8/8

Sample space atoms

Each card is one possible outcome with probability mass.

X maps atoms to numbers
omega 18.0%
input
X = -2
output
Y = -2

rare low outcome

omega 212%
input
X = -1
output
Y = -1

low outcome

omega 310%
input
X = 0
output
Y = 0

neutral

omega 420%
input
X = 1
output
Y = 1

common middle

omega 518%
input
X = 1
output
Y = 1

same value, different atom

omega 612%
input
X = 2
output
Y = 2

upper outcome

omega 710%
input
X = 3
output
Y = 3

high outcome

omega 810%
input
X = 4
output
Y = 4

tail outcome

Output distribution

Mass that lands on the same output value is added together.

Identity
Y = -28.0%
Y = -112%
Y = 010%
Y = 138%
Y = 212%
Y = 310%
Y = 410%
Current transform: .
Transform
diagnosis

Expectation is balance, not the most likely atom

The mean can sit between values that never occur. It is the point where weighted pull from the left and right balances.

why this matters

This is the language behind ML data

Losses, predictions, labels, gradients, and test metrics are random variables. Expectation is average behavior, variance is instability, conditioning is slicing the data-generating world, and transformations are how models create new quantities to measure.