Two Words That Get Conflated

“Reward is the expected long-term reward” is a sentence that sounds almost right and is actually wrong in a way worth dwelling on.

Reward is one-step feedback: a single scalar handed back by the environment after one transition. Return is accumulated future reward from a given point onward, a sum, not a single number. The chain runs in one direction only: reward aggregates into return, and return in expectation becomes value. This chapter walks that chain end to end, and the payoff is that the Bellman equation, usually presented as a block to memorize, arrives as a consequence of one small lemma proved in the first section.

DefinitionDiscounted Return

The discounted return from time tt is

Gt=Rt+1+γRt+2+γ2Rt+3+G_t = R_{t+1} + \gamma R_{t+2} + \gamma^2 R_{t+3} + \cdots

For a finite horizon ending at TT,

Gt=Rt+1+γRt+2++γTt1RT.G_t = R_{t+1} + \gamma R_{t+2} + \cdots + \gamma^{T-t-1}R_T.

If γ=0\gamma = 0, the return collapses to the very next reward, Gt=Rt+1G_t = R_{t+1}.

The discount factor γ[0,1]\gamma \in [0,1] is not a minor tuning knob; it is what makes GtG_t well-defined at all in the general case. An unweighted infinite sum of rewards has no reason to converge, and many environments genuinely admit unboundedly long or cyclic trajectories. Discounting also encodes something more substantive than convergence bookkeeping: it says that reward further in the future counts for less, which is a reasonable stance whenever the future is less certain than the present, or when a task simply prefers reward sooner rather than later. As γ\gamma moves toward 00, the agent becomes almost entirely near-sighted, valuing only immediate reward; as γ\gamma moves toward 11, it weighs the distant future almost as heavily as the present.

This also retires the loose end left open at the end of the first chapter. “Cumulative reward” over an unboundedly long future is now a convergent quantity, and it has a name.

The return GtG_t has a structural property that everything downstream depends on: it can be split into what happens on the very next step, and what happens after that.

LemmaReturn Satisfies a One-Step Recursion
Gt=Rt+1+γGt+1G_t = R_{t+1} + \gamma G_{t+1}
Proof
Gt=Rt+1+γRt+2+γ2Rt+3+=Rt+1+γ(Rt+2+γRt+3+)=Rt+1+γGt+1.\begin{aligned} G_t &= R_{t+1} + \gamma R_{t+2} + \gamma^2 R_{t+3} + \cdots \\ &= R_{t+1} + \gamma\left(R_{t+2} + \gamma R_{t+3} + \cdots\right) \\ &= R_{t+1} + \gamma G_{t+1}. \end{aligned}

The middle step only factors γ\gamma out of every term but the first; the result inside the parentheses is, by definition, Gt+1G_{t+1}.

This one-line identity is the entire mathematical content of the Bellman equation, before any expectation or environment structure gets involved. It is worth keeping in view for the rest of the chapter: every equation below is this lemma wearing progressively more clothing.

Two Value Functions

A value function estimates expected long-term cumulative reward, not just immediate reward. The Markov ladder already flagged why one such function will not be enough once actions exist: different actions available from the same state can lead to different futures. Here is that claim, made precise.

DefinitionState-Value and Action-Value Functions

Under a fixed policy π\pi, the state-value function is the expected return starting from state ss and following π\pi thereafter:

Vπ(s)=Eπ[GtSt=s]V^\pi(s) = \mathbb{E}_\pi[G_t \mid S_t = s]

The action-value function is the expected return starting from ss, taking action aa first, and following π\pi afterward:

Qπ(s,a)=Eπ[GtSt=s,At=a]Q^\pi(s,a) = \mathbb{E}_\pi[G_t \mid S_t = s, A_t = a]
FunctionEvaluatesIncludes first action?
Vπ(s)V^\pi(s)stateno
Qπ(s,a)Q^\pi(s,a)state-action pairyes

The difference is exactly whether the first action is dictated by the policy or fixed by hand, and that difference is precisely what makes QπQ^\pi useful for comparing candidate actions against each other, while VπV^\pi only ever evaluates a state as a whole.

PropositionState-Value from Action-Value
Vπ(s)=aπ(as)Qπ(s,a)V^\pi(s) = \sum_a \pi(a \mid s)\, Q^\pi(s,a)
Proof

Vπ(s)V^\pi(s) averages the return over trajectories starting at ss under π\pi; the first action AtA_t in such a trajectory is itself distributed as Atπ(s)A_t \sim \pi(\cdot \mid s). Conditioning on the value of that first action and applying the tower property,

Vπ(s)=Eπ[GtSt=s]=aπ(as)Eπ[GtSt=s,At=a]=aπ(as)Qπ(s,a).V^\pi(s) = \mathbb{E}_\pi[G_t \mid S_t=s] = \sum_a \pi(a\mid s)\, \mathbb{E}_\pi[G_t \mid S_t=s, A_t=a] = \sum_a \pi(a\mid s)\, Q^\pi(s,a).

Keep this proposition in hand. It is one of the two halves the Bellman expectation equation gets assembled from a few paragraphs below.

Value Now, Reward Plus Value Later

Now push the recursion lemma through the expectation. Take the MRP case first, where V(s)=E[GtSt=s]V(s) = \mathbb{E}[G_t \mid S_t = s] and no actions are involved. Because the return satisfies Gt=Rt+1+γGt+1G_t = R_{t+1} + \gamma G_{t+1}, so does VV.

TheoremBellman Equation (Markov Reward Process)
V(s)=R(s)+γsP(ss)V(s)V(s) = R(s) + \gamma \sum_{s'}P(s' \mid s)V(s')
Proof

Starting from the definition and applying the one-step recursion lemma:

V(s)=E[GtSt=s]=E[Rt+1+γGt+1St=s]=E[Rt+1St=s]+γE[Gt+1St=s].\begin{aligned} V(s) &= \mathbb{E}[G_t \mid S_t = s] \\ &= \mathbb{E}[R_{t+1} + \gamma G_{t+1} \mid S_t = s] \\ &= \mathbb{E}[R_{t+1} \mid S_t = s] + \gamma\,\mathbb{E}[G_{t+1} \mid S_t = s]. \end{aligned}

The first term is exactly R(s)R(s), the expected immediate reward from ss, by definition of the reward function. The second term needs one more step: E[Gt+1St=s]\mathbb{E}[G_{t+1} \mid S_t = s] is an expectation over the next state ss' of the expectation of Gt+1G_{t+1} given that next state. This is the tower property (law of total expectation), conditioning on St+1S_{t+1} inside the outer expectation over StS_t:

E[Gt+1St=s]=sP(ss)E[Gt+1St+1=s]=sP(ss)V(s).\mathbb{E}[G_{t+1} \mid S_t = s] = \sum_{s'} P(s' \mid s)\, \mathbb{E}[G_{t+1} \mid S_{t+1} = s'] = \sum_{s'} P(s' \mid s)\, V(s').

The last equality holds because E[Gt+1St+1=s]\mathbb{E}[G_{t+1} \mid S_{t+1}=s'] is, by definition, V(s)V(s'), the process has no memory beyond the current state, by the Markov property. This step also silently uses that the dynamics are time-homogeneous: VV does not depend on tt itself, only on the state, so the value “one step into the future” and “at any other time” are computed by the same function VV. This is a standing assumption throughout this series, not something the Markov property alone guarantees. Substituting both pieces back in gives the claimed equation.

Read in words: value now equals immediate reward plus discounted expected value one step later. That sentence is the entire content of the Bellman equation; the sum over ss' is just what “expected value one step later” means once you write out the expectation explicitly. Every Bellman equation in reinforcement learning, expectation, optimality, MRP, MDP, tabular or function-approximated, is a variation on this same one-line idea, because it is a direct consequence of the return satisfying Gt=Rt+1+γGt+1G_t = R_{t+1} + \gamma G_{t+1} and nothing else.

From MRP to MDP: Two Halves of the Same Backup

The proposition above already proved Vπ(s)=aπ(as)Qπ(s,a)V^\pi(s) = \sum_a \pi(a\mid s)\,Q^\pi(s,a), half of the relationship between VπV^\pi and QπQ^\pi. The other half is a direct MDP analogue of the MRP Bellman equation just derived, with the first action fixed.

PropositionAction-Value from State-Value
Qπ(s,a)=R(s,a)+γsP(ss,a)Vπ(s)Q^\pi(s,a) = R(s,a) + \gamma \sum_{s'}P(s' \mid s,a)\,V^\pi(s')

The argument is identical to the MRP Bellman equation’s proof, with every transition and reward now conditioned on the fixed action aa as well as the state ss. Fixing aa turns the first step back into an ordinary MRP-style backup, which is why the proof is not repeated here.

CorollaryBellman Expectation Equations

Composing the two halves, substituting the action-value backup into the state-value average, gives the Bellman expectation equation:

Vπ(s)=aπ(as)[R(s,a)+γsP(ss,a)Vπ(s)]V^\pi(s) = \sum_a \pi(a \mid s) \left[ R(s,a) + \gamma \sum_{s'}P(s' \mid s,a)V^\pi(s') \right]

This equation is usually presented as a single block to memorize. Built up this way, it decomposes into two independent, individually obvious facts: value-from-action-value is just the definition of expectation over the first action, and action-value-from-state-value is just the MRP Bellman equation with the action held fixed. The “expectation” in “Bellman expectation equation” refers to exactly one thing: the average over actions sampled from π\pi, layered on top of the same recursive structure derived from Gt=Rt+1+γGt+1G_t = R_{t+1} + \gamma G_{t+1}.

From Evaluating a Policy to Finding the Best One

Everything so far evaluates a fixed policy π\pi, this is the prediction problem. Control asks a different, harder question: what is the best possible value achievable at each state, over every policy at once?

RemarkBellman's Principle of Optimality

Richard Bellman’s original 1957 statement of the idea behind all of this is worth quoting directly, because it is the actual justification for replacing an average over actions with a maximum: an optimal policy has the property that, whatever the initial state and initial decision are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision. Optimality is self-similar across time: the tail of an optimal plan is itself an optimal plan for the sub-problem it starts. This is what licenses solving a problem with an unboundedly long horizon by a local, one-step recursive equation at all. Without it, there would be no reason to expect that a short-sighted, one-step-at-a-time backup could ever assemble into a globally optimal policy.

DefinitionOptimal Value Functions
V(s)=maxπVπ(s)Q(s,a)=maxπQπ(s,a)V^*(s) = \max_\pi V^\pi(s) \qquad\qquad Q^*(s,a) = \max_\pi Q^\pi(s,a)
TheoremBellman Optimality Equations
V(s)=maxa[R(s,a)+γsP(ss,a)V(s)]V^*(s) = \max_a \left[ R(s,a) + \gamma \sum_{s'}P(s' \mid s,a)V^*(s') \right]Q(s,a)=R(s,a)+γsP(ss,a)maxaQ(s,a)Q^*(s,a) = R(s,a) + \gamma \sum_{s'}P(s' \mid s,a)\max_{a'}Q^*(s',a')
RemarkWhy the Average Becomes a Maximum

These equations are not a separate derivation from the Bellman expectation equations above, they are what the expectation equations become once π\pi is required to be optimal. By the principle of optimality, an optimal policy must place all of its probability mass on whichever action maximizes Q(s,a)Q^*(s,a) at every state; averaging Q(s,a)Q^*(s,a) over a distribution that is entirely concentrated on its own maximizer is the same as just taking that maximum. The max\max is the trace left behind by optimizing over π\pi itself, not a new assumption bolted onto the earlier recursion.

Formula Ownership Rule

With three families of Bellman equation now on the table, a quick rule settles which one is in front of you:

Pattern in the equationWhich Bellman equation
No action term at allMarkov reward process
Action term, averaged with a fixed π(as)\pi(a \mid s)Policy evaluation / prediction
Action term, combined with max\max or argmax\arg\maxControl / optimality

Further Reading

This chapter derives the recursive structure but stops short of turning it into an algorithm. A Bellman equation is an identity, a true statement a value function must satisfy, and not yet a procedure for computing one. Planning with a Known Model closes that gap, by proving the operators behind these equations are contractions and therefore that repeatedly applying them converges.

The value functions built here are also exactly the objects that value-based and actor-critic methods reuse later: the baseline and advantage-function machinery in Policy Gradient is VπV^\pi, QπQ^\pi, and AπA^\pi from this chapter, put to work reducing the variance of a different kind of estimator.

References