Skip to content

E.2.6 Probability and Statistics Formula Reference and Exercises

Prerequisites: This page summarizes all formulas from module E.2. It is best reviewed after reading E.2.1 through E.2.5. If this is your first pass, start with the main articles first.


This page collects all formulas used in module E.2 for review. It is meant as a reference after you have read the preceding articles.

Probability Formulas Used in This Book

ConceptFormulaRL meaning
Policy probabilityProbability of choosing action in state
State transition probabilityProbability of entering the next state after taking an action
ExpectationAverage reward, average return, value function
State valueAverage discounted return from state
VarianceSize of learning-signal fluctuation
Monte Carlo estimateEstimate value using sample averages
Trajectory probabilityProbability that a policy generates a full trajectory
Baseline variance reductionSubtracting a baseline does not change the expected gradient
GAETrade off between TD and MC
Importance weightOff-policy correction
PPO clipped objectiveLimit extreme changes in importance weights

Summary

At this point, the basic tools of probability theory are in place: probability describes randomness, expectation describes averages, variance describes fluctuation, Monte Carlo approximates expectations through sampling, and importance sampling corrects bias with probability ratios. The structure of this page is: start from probability tables, weighted averages, and sample averages, then extend to the Bellman expectation equation, action values, trajectory importance sampling, and stochastic-gradient variance. When reading more complex formulas later, first ask what the formula is averaging over: actions, rewards, next states, trajectories, or gradient samples.


Common Pitfalls

  1. Treating one return as the value. A value is an expectation; the return from one trajectory is only one sample.
  2. Looking only at the mean and ignoring variance. Two policies can have the same average return but different variance, so their training stability can be very different.
  3. Thinking importance sampling reuses data for free. Probability ratios can correct bias, but they may also greatly increase variance.

Exercises

  1. Three trajectories have returns and probabilities . What is the state value?
  2. Sample returns are . What are the mean and variance?
  3. The behavior policy probability is , and the target policy probability is . What is the one-step importance weight?

现代强化学习实战课程