Bellman Equations

The previous sections gave us the pieces: an MDP gives states, actions, transitions, rewards, and γ\gamma; a policy π(as)\pi(a\mid s) chooses actions; Vπ(s)V^\pi(s) and Qπ(s,a)Q^\pi(s,a) estimate expected return. Bellman equations connect those pieces into one recursive statement.

The core idea is simple: value now equals immediate reward plus discounted future value. Think of value like a one-step receipt. The first line on the receipt is what happens immediately after the next action. The second line is the estimated value of wherever you end up next, discounted because it is future value.

For a delivery robot, a state ss might be "at the lobby, carrying a package." An action aa might be "go to the elevator." The next state ss' might be "inside the elevator" or "waiting because the elevator is full." The transition probability P(ss,a)P(s'\mid s,a) says how likely each next state is. The reward R(s,a,s)R(s,a,s') might charge a small time cost or give progress credit. The term γVπ(s)\gamma V^\pi(s') asks how useful the new situation is for the rest of the delivery.

Bellman equation

Inspect each component

Click directly on a boxed part of the equation to connect the symbol to the idea from the earlier sections.

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

Selected term

Vπ(s)V^\pi(s)

How good it is to be in state s if the agent follows policy pi from here onward.

A Bellman equation says: value now equals immediate reward plus discounted future value, averaged over policy choices and environment uncertainty.

For a fixed policy, the Bellman expectation equation for VV is:

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

The left side, Vπ(s)V^\pi(s), asks: if the robot starts in state ss and follows policy π\pi, what return should we expect? The right side answers by looking one step ahead, then reusing the value estimate for the state that comes next.

The first sum, aπ(as)\sum_a\pi(a\mid s), averages over the actions the policy might take. If the policy goes to the elevator 70% of the time and takes the stairs 30% of the time, both possibilities contribute to the state value in those proportions. The second sum, sP(ss,a)\sum_{s'}P(s'\mid s,a), averages over next states the environment might produce after action aa. If the elevator is available most of the time and full some of the time, both outcomes matter.

Inside the brackets, R(s,a,s)R(s,a,s') is the immediate payoff for that one transition, and γVπ(s)\gamma V^\pi(s') is the continuation value. In the delivery example, the robot might pay a small step cost now, then gain access to a much better future state once it reaches the elevator.

Why These Sums Are Averages

An ordinary average gives equal weight to each item. A probability-weighted average gives more weight to likely items and zero weight to impossible items. Because probabilities such as aπ(as)=1\sum_a\pi(a\mid s)=1, the expression aπ(as)f(a)\sum_a\pi(a\mid s)f(a) is a weighted mean of f(a)f(a).

A weather forecast is a useful metaphor. If there is a 70% chance of clear weather and a 30% chance of rain, you do not plan as if both are equally likely. Bellman equations do the same thing for actions and next states.

The Bellman expectation equation for QQ fixes the first action and then averages over what happens next:

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

Read it as: if the robot commits to action aa first, what return should we expect? After that first action, the policy takes over again. That is why the expression contains aa': after landing in ss', the policy chooses among possible next actions.

The distinction between VV and QQ is practical. Vπ(s)V^\pi(s) evaluates a situation under the policy's usual behavior. Qπ(s,a)Q^\pi(s,a) evaluates a particular first move. If the robot is deciding between the elevator and the stairs right now, QQ is the more direct comparison.

When we find the best possible policy π\pi^*, policy averaging is replaced by choosing the best action. The optimal value equations are V(s)=maxaQ(s,a)V^*(s)=\max_a Q^*(s,a) and Q(s,a)=sP(ss,a)[R(s,a,s)+γmaxaQ(s,a)]Q^*(s,a)=\sum_{s'}P(s'\mid s,a)\left[R(s,a,s')+\gamma\max_{a'}Q^*(s',a')\right] These equations define the fixed point for optimal behavior and are the backbone for dynamic programming, value iteration, and Q-learning.

Local Consistency Is Not Omniscience

A Bellman equation says how values should agree with one-step consequences. If the transition or reward model is wrong, the backup will be confidently wrong too.

Checkpoint

In a Bellman backup, what does the term R(s,a,s)+γV(s)R(s,a,s')+\gamma V(s') represent?