What You'll Learn
- Derive the Bellman expectation equation for and
- Derive the Bellman optimality equations for and
- Explain what “bootstrapping” means and why it enables efficient learning
- Understand why Bellman equations are the foundation of all RL algorithms
Richard Bellman discovered something remarkable in the 1950s: the value of a state depends on the values of states you can reach from it. This recursive insight—that you can break down a complex problem into simpler subproblems—is the foundation of everything in reinforcement learning.
You can watch that insight at work right now. Press Play: each sweep applies the Bellman backup you’re about to learn, once to every cell.
Value Iteration Visualization
Watch value iteration solve the GridWorld problem step by step.
The Recursive Nature of Value
Consider standing at a crossroads. How valuable is your current position? It depends on:
- What reward you get right now (maybe there’s a rest stop here)
- Where you can go from here (the available roads)
- How valuable those destinations are (what awaits down each path)
But wait—the value of those destinations depends on their successors. And those depend on further successors. It seems like an infinite regress!
Bellman’s insight was that this recursion is actually a feature, not a bug. The value of any state can be expressed in terms of immediate rewards plus the values of neighboring states. This creates a system of equations that we can solve.
Recursive relationships that express the value of a state (or state-action pair) in terms of immediate rewards and the values of successor states. They form a system of equations that value functions must satisfy.
The Core Insight: Value Flows Backward
Think about how you might evaluate different starting positions in a maze:
Consider a 3-state path: Start, Middle, Goal
With and the +10 earned on the transition from Mid into the terminal Goal:
- Goal value: (terminal: nothing happens after arriving)
- Middle value:
- Start value:
Value flows backward from rewards through the state space.
This backward flow is the essence of the Bellman equations. Each state’s value depends on its successors’ values, which depend on their successors’ values, all the way to the rewards.
Chapter Overview
The Two Types of Bellman Equations
There are two families of Bellman equations, and understanding the difference is crucial:
- Describe values under a specific policy π
- AVERAGE over actions, weighted by the policy
- Describe the best possible values
- Take the MAX over actions instead of averaging
Bellman expectation equation (average over the policy’s actions):
Bellman optimality equation (maximum over actions):
The shift from averaging over the policy’s actions to maximizing over actions is subtle but profound. It means the optimality equations don’t require knowing the optimal policy—the operator embeds the optimal action choice directly into the equation.
Why This Chapter Matters
The Bellman equations are not just theoretical curiosities—they’re the foundation of every major RL algorithm:
If you understand the Bellman equations deeply, you understand the core of reinforcement learning. Everything else is about how to solve or approximate these equations under different conditions—when you know the model, when you don’t, when states are discrete, when they’re continuous.
The Journey Ahead
The payoff comes immediately in the next section of the book: Policy Evaluation turns the Bellman expectation equation directly into an algorithm.
By the end of this chapter, you’ll be comfortable with all four Bellman equations:
For state values:
- Expectation:
- Optimality:
For action values:
- Expectation:
- Optimality:
Summary
- Values are recursiveThe value of a state is the immediate reward plus the discounted value of its successors.
- Expectation averages, optimality maximizesOne family describes a given policy; the other describes the best possible behavior — the only difference is average vs. max over actions.
- Value flows backward from rewardsEach backup pushes reward information one step further from its source, as you saw in the demo.
- The max operator embeds the optimal policyYou can characterize optimal values without knowing the optimal policy in advance.
- Every RL algorithm is Bellman in disguiseDP solves the equations exactly; TD and Q-learning sample them.