5.1.3 · D5Reinforcement Learning Foundations

Question bank — Policies and value functions

2,001 words9 min readBack to topic

Before we start, a few symbols this whole page leans on — make sure each is a picture in your head, not just a letter:


True or false — justify

TF1. is just the reward you get in state .
False. is the expected sum of all future discounted rewards (the return ) from onward, not the single immediate reward. The immediate reward is only the first term inside the sum.
TF2. A deterministic policy is always at least as good as a stochastic one.
False in general. In partially observable settings or adversarial games (mixed strategies), a randomized policy can strictly beat every deterministic one. It's only in a fully observable MDP that a deterministic optimal policy is guaranteed to exist.
TF3. If , the agent maximizes only its immediate reward.
True. With , every future term for vanishes, leaving . The agent becomes totally myopic.
TF4. Two different policies can have exactly the same value function .
True. Nothing forbids two distinct strategies from producing equal expected returns in every state — e.g. if they only differ on actions that lead to identical downstream outcomes. "Different policy" does not imply "different value."
TF5. There is always exactly one optimal policy.
False. When two actions tie in optimal action-value, breaking the tie either way (or randomizing over them) is still optimal, so several distinct optimal policies can share the single optimal value function .
TF6. requires action to be one the policy would actually take.
False. is defined for any action — you force on the first step, then follow . That's exactly why is useful: it lets you ask "what if I deviated once?"
TF7. .
True. Under the optimal policy you take the best action, so the state's value equals the value of its best action. (Contrast with , an average not a max.)
TF8. The Bellman equation is an assumption we impose on .
False. It's a consequence — it follows from the recursive split of the return (defined above) plus taking expectations. Any valid automatically satisfies it.
TF9. "Increasing toward always makes values larger" — is this statement, exactly as written, true?
False as written. raises the weight on future rewards; if those future rewards are negative, a larger can lower the value. The only defensible claim is conditional — for strictly non-negative rewards a larger cannot decrease value — so the unqualified "always" is wrong.

Spot the error

SE1. ", so the same state's value on both sides."
The right side must reference the next state , not itself, and average over what the world does: . Only when the environment is guaranteed to stay in do the two coincide.
SE2. "."
You can't over something that doesn't depend on has no action argument. The correct greedy rule is , choosing the best action-value.
SE3. "Since the policy is stochastic, we drop the expectation and just use the sampled reward."
The whole point of is to average over the policy's randomness and the environment's randomness. Using a single sample gives a noisy estimate, not the value function.
SE4. "."
Two errors: the reward and next-state value must be averaged over transition outcomes , and the future value is (the state you land in), not : .
SE5. "The optimal policy maximizes reward at every single step."
It maximizes the long-run discounted return , which sometimes means accepting a small immediate reward now for a large one later. Greedy-per-step is generally not optimal — that confusion is the whole reason we need value functions.
SE6. "."
For a fixed policy , the state value is the policy-weighted average, — not a max. The max only appears for the optimal value function .
SE7. "Discounting is only a convergence trick with no real meaning."
It has three real meanings: uncertainty about the far future, economic impatience, and guaranteeing a finite sum for bounded rewards (). Dismissing it as "just a trick" hides the modelling choice it encodes.

Why questions

WHY1. Why average (take expectation) instead of just summing rewards along one path?
Because both the policy (if stochastic) and the transitions can be random, so from one state many futures are possible. The value is the average over all of them, weighted by their probabilities.
WHY2. Why do we ever need if we already have ?
only rates situations; to improve a policy you must compare actions, which is exactly what ranks. With you read off the best action directly by , no environment model required.
WHY3. Why must (strictly) for infinite-horizon problems?
With bounded reward , the sum is finite only if (geometric series). At the sum can diverge unless episodes are guaranteed to terminate.
WHY4. Why does the Bellman equation let us solve for values rather than simulate forever?
It turns an infinite sum into a finite system of linear equations — one equation per state, each referencing only immediate reward plus neighbours' values. We solve the system instead of rolling out infinite trajectories.
WHY5. Why does a stochastic environment force to depend on ?
Because even after fixing the action, where you land next is uncertain. The value must weight each possible next state by its transition probability, then add its downstream value .
WHY6. Why is being greedy w.r.t. optimal, but being greedy w.r.t. an arbitrary generally isn't?
already encodes the best possible future, so acting greedily on it is self-consistent. Being greedy on a sub-optimal gives a different, usually better policy — this one improvement step is the engine of 5.2.01-Policy-Iteration.
WHY7. Why can we split into "action from policy, then next state from dynamics"?
Because the process is Markov: the future depends only on the current state and chosen action, letting us factor the expectation as — first the agent's dice, then the world's dice.

Edge cases

EC1. What is of an absorbing terminal state that gives reward forever?
It's : every future reward is , so the discounted sum is regardless of . Terminal states anchor the recursion — their values are known without any equation to solve.
EC2. What if a state has only one available action?
Then for that action and — the average over actions collapses to that single action's value. The policy choice is trivial there.
EC3. What happens to for an action the policy takes with probability ?
It's still perfectly well-defined — forces the action once, then follows . A zero-probability action can even have the highest , which is a signal to change the policy toward it.
EC4. If two actions have exactly equal values, is the optimal policy undefined?
No — any tie-breaking (including a random mix over the tied actions) is optimal. This is precisely how multiple optimal policies can share one .
EC5. With exactly in a guaranteed-terminating (episodic) task, is still finite?
Yes. If every episode ends in finitely many steps, the sum has finitely many nonzero terms, so undiscounted return is finite even at . The divergence worry only bites for non-terminating infinite horizons.
EC6. What is if the immediate reward is always the constant and the agent never leaves the region?
The geometric sum gives (for ). For example, a state that pays forever with has value .
EC7. Can be negative?
Yes — if rewards can be negative (penalties/costs), the expected discounted sum can be negative. Values are not probabilities; nothing forces them to be non-negative.
Recall Quick self-test before you leave

One-max-vs-average distinction ::: (average), but (max). The greedy rule that recovers the optimal policy ::: , never of . Why discounting keeps sums finite ::: makes a convergent geometric series for bounded rewards.