Notes

Expectation

Expectation is the idea of a “typical” value you’d get if you could repeat the same uncertain situation many times. It’s not a guarantee about any single outcome—it’s the long-run average you’d expect to see.

What expectation means
In probability, the expectation (also called the expected value and written E[X]) is the average value of a random variable X, weighted by how likely each value is. For a discrete variable (like number of purchases), it’s a probability-weighted sum; for a continuous variable (like house price), it’s a probability-weighted average computed via an integral. The key point is weighting: more likely outcomes pull the expectation more strongly.

A quick intuition
Think of expectation as the “center of mass” of a distribution. If you placed probability mass along a number line, the expectation is where the distribution would balance on a fulcrum. Skewed distributions can have expectations that feel higher or lower than the “most common” value.

Practical examples

  • Exam scores: If a student’s score is uncertain due to test-day variability, E[score] is their long-run average score across many similar exams.
  • Sales forecasting: If daily demand is random, E[demand] helps set staffing and inventory targets.
  • Medical measurements: For noisy blood pressure readings, the expectation represents the average underlying level (before noise).

Why it matters in AI/ML
Many ML objectives are written as minimizing an expected loss: you want a model that performs well on average over the data-generating process, not just on one sample. Training with stochastic gradient descent uses mini-batches to estimate expectations like E[∇loss]. In probabilistic models, expectations summarize predictions (e.g., the expected click-through rate), and in reinforcement learning, the goal is to maximize expected return.

Expectation (expected value) is the probability-weighted average of a random variable’s possible outcomes, representing its long-run mean under repeated sampling. It is central in AI/ML for defining objectives and risks, such as expected loss, and for deriving estimators and gradients in probabilistic models. Example: in linear regression, training minimizes the expected squared error between predictions and targets under the data distribution.

Imagine you’re thinking about how much money you might win from a scratch-off ticket. You probably won’t win the “big prize,” but you can still talk about what you’d get on average if you bought lots of tickets. That “long-run average” idea is the expectation.

In statistics and AI, expectation means the average value you’d expect from a random variable (a number that can change because of chance), when you repeat the situation many times. Machine learning uses expectation to talk about average error, average reward, or average outcomes under uncertainty, helping models make sensible decisions even when results are unpredictable.