Bellman Optimality Equation for q*
The Bellman optimality equation expresses this idea as a consistency rule.
From a State to Its Best Return
Suppose you are evaluating a state in which several actions are available. A policy would tell you which action choices to evaluate. The optimal value function takes a different viewpoint: it asks how much return can be obtained from that state when the best available action is used. The Bellman optimality equation expresses this idea as a consistency rule.
The optimal value function v* assigns each state its maximum expected return.
Tracing the State Value
The expression being compared for an action is R + γv*(s'), evaluated in expectation given the state and action. R represents the reward in that expression, while γv*(s') represents the discounted optimal value associated with the next state. The maximization selects the largest expected return among the available actions.
Selecting the Maximum
Two actions from one state
A hypothetical state s has two possible actions. The expected return for the first action is 7, and the expected return for the second action is 4. What is the optimal value of s?
- 1Evaluate each action
The first action has expected return 7, while the second action has expected return 4.
- 2Apply maximization
The optimal value function retains the larger of the two action returns.
- 3Identify the best action
The first action is the best action because its expected return is larger.
v*(s) follows the first action's expected return, so v*(s) is 7.
The numbers 7 and 4 illustrate the selection rule. The important point is that v*(s) is tied to the best action rather than to a policy action selected in advance.
Checking Bellman Consistency
The equation can be used as a consistency test. Start at a state, evaluate the expected return for every possible action, and retain the largest result. The resulting quantity must agree with the optimal value assigned to that state.
| Question | What is being selected? |
|---|---|
| Ordinary policy viewpoint | The action choices specified by a policy |
| Optimal value viewpoint | The action with the largest expected return |
The optimal value function differs from evaluating a preselected policy action.
Mistakes in Maximization
Common mistake Treating v*(s) as the return from any one action.
What it looks likeChoosing the expected return 4 even though another available action has expected return 7.
Why it failsThe optimal value function assigns the state its maximum expected return.
Do this insteadEvaluate the available action returns and retain the largest one.
Common mistake Replacing the maximization with a preselected policy action.
What it looks likeUsing only the action chosen by an ordinary policy when determining the optimal value.
Why it failsThe Bellman optimality equation uses maximization so it does not need to name a particular policy.
Do this insteadCompare the expected returns of the available actions and select the best result.
Common mistake Ignoring the expected continuation value.
What it looks likeConsidering only R and leaving out the γv*(s') part of the expression.
Why it failsThe compared expression is R + γv*(s'), evaluated in expectation given a state and action.
Do this insteadInclude both the reward and the discounted optimal value associated with the next state when evaluating an action.
Common mistake Failing the consistency check.
What it looks likeAssigning a state a value that differs from the largest expected return produced by its available actions.
Why it failsThe state value must agree with the expected return of the best action.
Do this insteadRecompute the action returns and compare the assigned value with their maximum.
Practice and Summary
A state has three available actions with expected returns 5, 9, and 6. Identify the action return that determines v*(s), and explain why the other two values do not determine the optimal value.
Hints
- The equation uses maximization over actions.
- Compare all three expected returns.
- The largest expected return determines the state's optimal value.
- 1v*(s) represents the maximum expected return available from state s. The Bellman optimality equation compares the expected expression R + γv*(s') for the available actions. Maximization selects the best action without requiring a particular policy to be named. The resulting maximum must agree with the optimal value assigned to the state.
At a glance
- v*(s) assigns a state its maximum expected return.
- The Bellman optimality equation evaluates R + γv*(s') in expectation for each available action.
- Maximization selects the best action rather than a preselected policy action.
- The assigned optimal value must agree with the largest expected action return.