This page builds every symbol the parent note uses, starting from a reader who has never seen an expectation, a policy, or a Greek letter in this context. Read it top to bottom: each brick rests on the one before it.
Picture a robot on a grid of tiles. Each tile it can stand on is a state. At each tile it can pick a move — up, down, left, right — and each move is an action.
Why sets (the curly S, A)? Because later we count "at most ∣A∣∣S∣ policies" — the bars ∣⋅∣ just mean "how many things are in this set". With 16 tiles and 4 moves that is 416, a huge number; DP beats brute force over all of them.
Why do we need γ at all — why not just add up rewards? Two reasons, one practical, one mathematical:
Practical: a cookie today beats a cookie in a year. γ<1 encodes impatience.
Mathematical: if the robot could wander forever, a plain sum of −1's would be −∞ for everyone and comparisons become meaningless. Multiplying by γk makes the total a finite number, so states become comparable.
The robot cares about its whole future, not one reward. Stack up the discounted rewards from time t onward:
Gt=Rt+1+γRt+2+γ2Rt+3+⋯
The single most important algebraic trick on the parent page pulls the first reward off this trail:
Gt=Rt+1+γ=Gt+1(Rt+2+γRt+3+⋯)=Rt+1+γGt+1
Why bother? Because the bracket is the same kind of object one step later. This "now-reward plus discounted next-return" shape is the seed of every Bellman equation. Recognise it — it is the whole topic.
Random / stochastic: e.g. π(a∣s)=0.25 for each of 4 moves — a full pie.
Greedy / deterministic: one arrow gets probability 1 — a single confident arrow.
Why probabilities and not just one arrow? Because DP starts with a guess and improves it; early on the rulebook is a fuzzy pie, and we watch it sharpen into single arrows as the robot learns.
The world may be uncertain: "move right" might slip and land elsewhere. When outcomes are random, we cannot say the return — only its average.
Why is this the right tool (and not, say, the best case or worst case)? Because a rational agent that repeats an episode many times cares about its long-run mean payoff. The expectation is the honest summary of "what you get on average" — no other single number captures that.
Concretely, for a value x′ that occurs with probability p′:
E[value]=∑outcomes(probability of outcome)×(value of outcome).
Every ∑ (capital sigma, "add these up") in the Bellman equations is one of these probability-weighted averages spelled out.
Notation care: s′ (read "s-prime") just means "the next state" — the prime is a tick meaning "one step later", nothing more. DP needs p because it is a model-based method: it looks up every possible next outcome and averages over them. (Later chapters like 5.1.11-Q-learning drop p and sample instead — but that story starts here.)
Why keep both V and Q? V answers "how good is this tile?"; Q answers "how good is this move from this tile?". To choose, you need the per-move numbers — that is why the greedy policy is argmaxaQ.
Why does the optimal equation use max while the policy equation uses ∑aπ(a∣s)? Because an averaging policy blends all arrows (weighted sum), but an optimal agent never blends — it always grabs the single best arrow. Averaging vs. maximising is the one line that separates the two Bellman equations on the parent page.
With every symbol earned, the parent's central equation is now readable left to right, in words:
value hereVπ(s)=average over my movesa∑π(a∣s)average over the world’s outcomess′,r∑p(s′,r∣s,a)[grab nowr+shrunk value of next tileγVπ(s′)]
That is Section 3's "Rt+1+γGt+1" trick with the two averages (π and p) written out. Swap ∑aπ(a∣s) for maxa and you have the optimality equation. Nothing else is new. These live formally in Bellman-equations and power 5.108-Markov-Decision-Process-(MDP).