Silver RL·Lecture 3·Lecture Notes

Lecture 3 · Planning by Dynamic Programming

Updated 2026-08-30·EN

Slides: David Silver, UCL Course on Reinforcement Learning (2015), CC BY-NC 4.0. Some slide content is from third parties and is outside that licence.

Slides: David Silver - RL Course (UCL 2015) · Previous: Lecture 2 · Markov Decision Processes · Next: Lecture 4 · Model-Free Prediction
Companion: Silver RL Lecture 3 — Question List (your own stuck points, in Korean) · Contraction Mapping & Bellman Convergence

Read this instead of watching. Each slide is embedded below with only what the slide itself does not say — the reasoning, the caveats, and the questions worth being able to answer.


The one idea

L2 wrote down the Bellman equations and left them as equations. L3 does one thing to them:

Turn the equality into an assignment, and iterate.

vπ(s)=∑aπ(a∣s)(Rsa+γ∑s′Pss′avπ(s′))⏟L2: a fact about vπ⟶vk+1(s)←∑aπ(a∣s)(Rsa+γ∑s′Pss′avk(s′))⏟L3: an algorithm\underbrace{v_\pi(s)=\sum_a\pi(a|s)\Big(\mathcal{R}^a_s+\gamma\sum_{s'}\mathcal{P}^a_{ss'}v_\pi(s')\Big)}_{\text{L2: a fact about }v_\pi} \quad\longrightarrow\quad \underbrace{v_{k+1}(s)\leftarrow\sum_a\pi(a|s)\Big(\mathcal{R}^a_s+\gamma\sum_{s'}\mathcal{P}^a_{ss'}v_k(s')\Big)}_{\text{L3: an algorithm}}

Everything else follows from which Bellman equation you iterate. Slide p.26 is the entire lecture in one table:

Problem Bellman equation Algorithm
Prediction expectation iterative policy evaluation
Control expectation + greedy improvement policy iteration
Control optimality value iteration
Why MDPs are a dynamic-programming problem at all

DP needs two properties, and the MDP supplies each from a different object:

  • Optimal substructure — the problem decomposes into subproblems. This is the Bellman equation: the value of a state is one step plus the value of the successor.
  • Overlapping subproblems — the same subproblem recurs, so answers can be cached. This is the value function: a store of "how much reward can I get from here onward", computed once and reused everywhere it appears.

That reframing is worth keeping: the value function is a cache. Every algorithm in this course is a scheme for filling it in.

This lecture solves planning, not reinforcement learning

Somebody hands you P\mathcal{P} and R\mathcal{R} — the full source code of the environment. Nothing here works without them, which is exactly the assumption L4 removes.
Keep the two axes separate, because the course is organized by them: planning vs learning (do you know the model?) and prediction vs control (evaluate a given policy, or find the best one?). L3 is planning; both halves of the second axis appear here.

Contents


1 · What dynamic programming is

p.3–6 · Requirements and Scope ⏱ 2:18

Lecture 3 Planning by Dynamic Programming, slide 4
Lecture 3 Planning by Dynamic Programming, slide 4

Neither word means what it looks like. Dynamic = the problem has a sequential or temporal structure. Programming = mathematical programming, as in linear programming — optimizing a "program", which for mathematicians means what we call a policy. Nothing to do with writing code.

The shortest-path example makes both DP properties concrete at once: the shortest path from here to the wall decomposes through a midpoint (optimal substructure), and the sub-path from that midpoint gets reused by many different starting points (overlapping subproblems).

Lecture 3 Planning by Dynamic Programming, slide 5
Lecture 3 Planning by Dynamic Programming, slide 5

The two planning problems, and note that the second contains the first:

  • Prediction: given MDP + policy → vπv_\pi. Equivalently, flatten the MDP under π\pi into an MRP and evaluate that.
  • Control: given MDP → v∗v_*, and hence π∗\pi_*.

DP is far older and broader than RL — scheduling, sequence alignment, shortest paths, the Viterbi algorithm. What is special here is only that the Bellman equation supplies the recursion.


2 · Iterative policy evaluation

p.7–8 · The Update ⏱ 12:56

Lecture 3 Planning by Dynamic Programming, slide 8
Lecture 3 Planning by Dynamic Programming, slide 8

vk+1(s)=∑a∈Aπ(a∣s)(Rsa+γ∑s′∈SPss′avk(s′))⟺vk+1=Rπ+γPπvkv_{k+1}(s)=\sum_{a\in\mathcal{A}}\pi(a|s)\Big(\mathcal{R}^a_s+\gamma\sum_{s'\in\mathcal{S}}\mathcal{P}^a_{ss'}v_k(s')\Big) \qquad\Longleftrightarrow\qquad \mathbf{v}^{k+1}=\mathcal{R}^\pi+\gamma\mathcal{P}^\pi\mathbf{v}^k

Read the backup diagram as every state taking a turn at being the root. One sweep = each state gets one one-step lookahead, using the previous iteration's values at the leaves.

Synchronous means the whole new value function is computed from the whole old one before anything is swapped in. That is a choice, not a requirement — p.29 drops it.

The starting point v1v_1 is arbitrary; zeros everywhere is the natural choice and means "I expect no reward anywhere."

Convergence is asserted here and deferred to the end of the lecture

Two distinct questions are open at this point: does a value function satisfying the equation exist and is it unique, and does this iteration reach it. Both are answered by the contraction mapping theorem on p.35–42 — which the lecture ran out of time for → Contraction Mapping & Bellman Convergence.

p.9–11 · Small Gridworld ⏱ 19:45

Lecture 3 Planning by Dynamic Programming, slide 9
Lecture 3 Planning by Dynamic Programming, slide 9

4×44\times4 grid, two terminal corners, −1-1 per step, uniform random policy, γ=1\gamma=1. Since every step costs exactly −1-1, the value of a state is minus the expected number of steps to termination — the question "how good is this state?" and "how long until I get out?" are the same question.

Lecture 3 Planning by Dynamic Programming, slide 10
Lecture 3 Planning by Dynamic Programming, slide 10

Work one cell by hand and the mechanism becomes concrete. At k=2k=2, a cell adjacent to the terminal corner: three directions give −1+(−1)=−2-1+(-1)=-2, and the one leading to the terminal gives −1+0=−1-1+0=-1. Average over the four with probability 14\tfrac14 each:

v2=34(−2)+14(−1)=−1.75v_2=\tfrac34(-2)+\tfrac14(-1)=-1.75

which the slide prints as −1.7-1.7 — it is truncated to fit, not rounded to something else. Several cells that look identical differ past the displayed decimal.

Lecture 3 Planning by Dynamic Programming, slide 11
Lecture 3 Planning by Dynamic Programming, slide 11

The right-hand column is the actual reveal, and it sets up the next three sections

The left column is policy evaluation converging to vπ≈−14,−20,−22v_\pi\approx-14,-20,-22 at k=∞k=\infty. The right column asks a different question: if I acted greedily with respect to vkv_k, what policy would I get?
By k=3k=3 the greedy policy is already optimal — while the value function is still nowhere near converged. Iterations 4 through ∞\infty compute more accurate numbers that change the greedy policy not at all.
Two consequences, and the lecture builds both: (1) any value function can be used to produce a better policy — you do not need vπv_\pi; (2) running evaluation to convergence is usually wasted work. That is modified policy iteration (p.18) and, pushed to the limit, value iteration.


3 · Policy iteration

p.12–13 · Evaluate, Improve, Repeat ⏱ 29:41

Lecture 3 Planning by Dynamic Programming, slide 13
Lecture 3 Planning by Dynamic Programming, slide 13

Up-arrows evaluate, down-arrows act greedily, and the two converge on v∗v_* and π∗\pi_* from any starting point.

Two facts the slide does not state:

  • After the first improvement your policy is deterministic and stays deterministic, because arg⁡max⁡\arg\max returns a single action. That is consistent with the L2 theorem that a deterministic optimal policy always exists, so restricting the search to deterministic policies costs nothing.
  • The convergence rate is independent of the initialization, though the initialization obviously affects how much work you do in practice — start at π∗\pi_* and you finish immediately.

This diagram is the one to memorize. It recurs in L5 with sampled evaluation, in L6 with function approximation, and in L7 with a gradient step replacing the greedy jump.

p.14–15 · Jack's Car Rental ⏱ 36:34

Lecture 3 Planning by Dynamic Programming, slide 15
Lecture 3 Planning by Dynamic Programming, slide 15

Two rental locations, up to 20 cars each, move up to 5 overnight, $10 per car rented, Poisson demand and returns. Location 2 receives more requests than returns, so it drains — the policy has to keep feeding it.

Reading the figure: the five squares are policies drawn as contour maps — axes are cars at each location, and the contour label is how many cars to move. The surface at the end is the value function, in dollars of expected lifetime revenue.

Unlike the gridworld, one improvement step is not enough: it takes four or five iterations to stabilize.

Notice what had to be known to run this at all

The Poisson rates for requests and returns are P\mathcal{P}. Without them there is no lookahead and no algorithm. This is planning: you supply a model, and DP returns the optimal policy for the model you supplied.
That framing is how this is actually used — industry writes down an approximate model of a system and solves it. Whether the model matches reality is a separate problem, and it is the one L4 onwards attacks.


4 · Why greedy improvement works

p.16 · The Policy Improvement Theorem ⏱ 46:30

Lecture 3 Planning by Dynamic Programming, slide 16
Lecture 3 Planning by Dynamic Programming, slide 16

π′(s)=arg⁡max⁡a∈Aqπ(s,a)\pi'(s)=\arg\max_{a\in\mathcal{A}}q_\pi(s,a)

The proof is two moves, and separating them is what makes it readable.

Move 1 — one step is not worse. By construction π′\pi' picks the maximizing action, so

qπ(s,π′(s))=max⁡aqπ(s,a)  ≥  qπ(s,π(s))=vπ(s)q_\pi(s,\pi'(s))=\max_a q_\pi(s,a)\;\ge\;q_\pi(s,\pi(s))=v_\pi(s)

The inequality is just a max is at least as large as any particular element. What it says: follow π′\pi' for one step, then π\pi forever, and you do at least as well as π\pi throughout.

Move 2 — telescope it. Apply Move 1 again inside the expectation, at the next state, then again, unrolling:

vπ(s)≤qπ(s,π′(s))≤Eπ′[Rt+1+γqπ(St+1,π′(St+1))]≤⋯≤vπ′(s)v_\pi(s)\le q_\pi(s,\pi'(s))\le\mathbb{E}_{\pi'}[R_{t+1}+\gamma q_\pi(S_{t+1},\pi'(S_{t+1}))]\le\dots\le v_{\pi'}(s)

Each step converts one more "then follow π\pi" into "then follow π′\pi'". One step at a time is what turns a one-step improvement into a whole-policy improvement.

Greedy does not mean myopic

The commonest misreading of "act greedily" is that it optimizes immediate reward and ignores the future. It does not.
arg⁡max⁡aqπ(s,a)\arg\max_a q_\pi(s,a) maximizes over one step of action plus the value function, and the value function already summarizes all future reward under π\pi. So greedy improvement is a one-step lookahead into a long-horizon summary — it will happily accept a worse immediate reward for a better successor state.

p.17 · When Improvement Stops ⏱ 52:36

Lecture 3 Planning by Dynamic Programming, slide 17
Lecture 3 Planning by Dynamic Programming, slide 17

Set the inequality to equality: vπ(s)=max⁡aqπ(s,a)v_\pi(s)=\max_a q_\pi(s,a) — which is the Bellman optimality equation. So vπ=v∗v_\pi=v_* and π\pi is optimal.

That is the whole convergence argument for policy iteration: the only way improvement can stop is by satisfying the optimality equation.

Why can't policy iteration get stuck at a local optimum?

Because policy improvement defines a partial order on policies, and you can only climb it.
Write π′≥π\pi'\ge\pi when vπ′(s)≥vπ(s)v_{\pi'}(s)\ge v_\pi(s) for every state — not on average, not in most states, but everywhere. The improvement theorem guarantees each greedy step produces a policy that is ≥\ge its predecessor in exactly this sense.
The trap you would worry about — better in some states, worse in others — is ruled out by that "for every state". There is no sideways move to get stuck in. You climb the lattice until nothing above you exists, and by p.17 that top is π∗\pi_*.
(The finiteness of the deterministic policy set is what makes "you cannot climb forever" a termination argument.)


5 · How much evaluation is enough

p.18–19 · Modified and Generalized Policy Iteration ⏱ 58:54

Lecture 3 Planning by Dynamic Programming, slide 18
Lecture 3 Planning by Dynamic Programming, slide 18

This slide answers the question the gridworld raised: must policy evaluation converge before you improve? No. Options, from most to least work: run to convergence; stop at ϵ\epsilon-convergence; stop after a fixed kk; stop after k=1k=1.

And k=1k=1 turns out to be value iteration — evaluate once, improve, and the two collapse into a single max.

Lecture 3 Planning by Dynamic Programming, slide 19
Lecture 3 Planning by Dynamic Programming, slide 19

GPI is the abstraction the rest of the course fills in

Any evaluation algorithm, any improvement algorithm, alternating. Iterative policy evaluation and greedy improvement are one instantiation among many.
Later lectures swap components in without changing the diagram: MC or TD evaluation instead of DP (L5), ϵ\epsilon-greedy instead of greedy (L5), a function approximator for the value (L6), a gradient step instead of a max (L7). The picture stays; only the boxes change.


6 · Value iteration

p.20 · Principle of Optimality ⏱ 1:01:54

Lecture 3 Planning by Dynamic Programming, slide 20
Lecture 3 Planning by Dynamic Programming, slide 20

An optimal policy splits into an optimal first action and an optimal policy from wherever you land. The theorem says π\pi achieves v∗(s)v_*(s) if and only if it achieves v∗(s′)v_*(s') for every reachable s′s'.

The "if and only if" is what licenses working backwards: solve the successors, then a one-step lookahead settles the predecessor.

Unreachable states are not an exception — they carry zero probability and simply do not appear in the equation.

p.21–22 · Value Iteration Intuition ⏱ 1:06:28

Lecture 3 Planning by Dynamic Programming, slide 22
Lecture 3 Planning by Dynamic Programming, slide 22

Shortest path with −1-1 per step. Values propagate outward from the goal: after kk sweeps, every state within kk steps has its correct value.

"Start at the end and work backwards" is intuition, not the algorithm

The algorithm has no idea where the goal is — or whether one exists. It sweeps every state every iteration, doing the same one-step lookahead everywhere, because in general there may be no terminal state, several, or none reachable.
Value iteration works fine on continuing, looping, stochastic MDPs with discounting and no goal at all. The backwards picture is a special case that happens to be legible; do not mistake it for a requirement.

p.23–24 · Value Iteration ⏱ 1:12:38

Lecture 3 Planning by Dynamic Programming, slide 24
Lecture 3 Planning by Dynamic Programming, slide 24

vk+1(s)=max⁡a∈A(Rsa+γ∑s′∈SPss′avk(s′))v_{k+1}(s)=\max_{a\in\mathcal{A}}\Big(\mathcal{R}^a_s+\gamma\sum_{s'\in\mathcal{S}}\mathcal{P}^a_{ss'}v_k(s')\Big)

Same machinery as policy evaluation with one symbol changed: ∑aπ(a∣s)\sum_a\pi(a|s) becomes max⁡a\max_a. Expectation equation → optimality equation.

The intermediate value functions may correspond to no policy at all

Policy iteration produced, at every step, the value function of an actual policy. Value iteration does not. Stop it early and vkv_k is generally not vπv_\pi for any π\pi — it is an intermediate construct, some numbers on the way to v∗v_*.
This resolves a genuine contradiction with p.16. The improvement theorem promised values go up; the shortest-path figure shows them going down (0→−1→−2→…0\to-1\to-2\to\dots). Both are correct because they describe different objects: the theorem is about values of policies under policy iteration, and these are not values of policies.

Why k=1k=1 modified policy iteration equals value iteration: evaluating the greedy (arg⁡max⁡\arg\max) policy for exactly one step is taking the max. The two steps fuse, and no explicit policy is ever built.


7 · The summary, and complexity

p.26 · Synchronous DP Algorithms ⏱ 1:24:03

Lecture 3 Planning by Dynamic Programming, slide 26
Lecture 3 Planning by Dynamic Programming, slide 26

The slide the lecture asks you to take away. Three algorithms, each an iterated Bellman equation, differing only in which one.

Complexity per iteration, for mm actions and nn states:

Using Cost Why
v(s)v(s) O(mn2)O(mn^2) nn states as root × nn successors × mm actions
q(s,a)q(s,a) O(m2n2)O(m^2n^2) mnmn pairs as root × mnmn successor pairs
If qq costs mm times more, why does the rest of the course use it?

Because qq removes the need for a model, and that is worth any constant factor.
Picking an action from vv requires a one-step lookahead — arg⁡max⁡a(Rsa+γ∑s′Pss′av(s′))\arg\max_a(\mathcal{R}^a_s+\gamma\sum_{s'}\mathcal{P}^a_{ss'}v(s')) — and that lookahead is P\mathcal{P} and R\mathcal{R}. With qq it collapses to arg⁡max⁡aq(s,a)\arg\max_a q(s,a), which needs nothing but the table.
Here in L3 you were given the model, so the cheaper vv suffices. From L5 onward you are not, and the extra cost buys the only thing that matters → Lecture 5 · Model-Free Control. Silver flags this explicitly as coming later.


8 · Asynchronous dynamic programming

p.27–31 · Three Ways to Choose States ⏱ 1:29:27

Lecture 3 Planning by Dynamic Programming, slide 27
Lecture 3 Planning by Dynamic Programming, slide 27

Drop the requirement that an iteration touches every state. Back up states individually, in any order.

The convergence condition is weak and worth remembering: it still converges as long as every state continues to be selected eventually. The order is free; only the coverage matters.

Lecture 3 Planning by Dynamic Programming, slide 29
Lecture 3 Planning by Dynamic Programming, slide 29

In-place keeps one copy of vv instead of two, so a backup immediately sees values updated earlier in the same sweep.

Ordering can change the cost by a factor of nn

On a corridor, sweep from the goal backwards and in-place value iteration solves the whole thing in one sweep — each state uses the freshly-computed value of its neighbor. Sweep the other direction and you gain nothing, needing nn sweeps.
Same algorithm, same states, same arithmetic — only the order differs. That is the entire motivation for the next two ideas.

Lecture 3 Planning by Dynamic Programming, slide 30
Lecture 3 Planning by Dynamic Programming, slide 30

Prioritized sweeping orders by Bellman error — how much this state's value would change if updated. Large error = large downstream consequences, so do it first.

The practical picture: with rewards concentrated somewhere far away, most of the state space sits at 00 and updating it recomputes 0=0+γ⋅00=0+\gamma\cdot 0 forever. Prioritization spends effort only where something is actually changing. The cost is needing reverse dynamics — which states lead into the one you just updated — and a priority queue.

Lecture 3 Planning by Dynamic Programming, slide 31
Lecture 3 Planning by Dynamic Programming, slide 31

Real-time DP picks states by running the agent and backing up whatever it visits. If your robot is on this bit of carpet, the far corner of the room is not worth computing.

Real-time DP is the first appearance of an idea that becomes an entire lecture

Using the agent's actual trajectory to decide where to compute is the seed of simulation-based search and Dyna in L8 — plan around where you are, not uniformly over everything.
Note what it is not: this is still planning. You use experience to choose where to look, but the backup itself remains a full-width expectation requiring the model.


9 · The bridge to model-free RL

p.32–33 · Full-Width and Sample Backups ⏱ 1:36:18

Lecture 3 Planning by Dynamic Programming, slide 32
Lecture 3 Planning by Dynamic Programming, slide 32

Every backup so far considered every action and every successor state. Two costs follow, and the second is the one that ends the lecture:

  1. Bellman's curse of dimensionality. n=∣S∣n=|\mathcal{S}| grows exponentially in the number of state variables, so DP tops out around millions of states — fine for medium problems, hopeless for Go's 1017010^{170}, where even a single backup is unaffordable.
  2. You must know P\mathcal{P} and R\mathcal{R}. The expectation is not computable otherwise.

Lecture 3 Planning by Dynamic Programming, slide 33
Lecture 3 Planning by Dynamic Programming, slide 33

One change fixes both problems at once, and it is the whole rest of the course

Replace the full-width expectation with a sample: take ⟨S,A,R,S′⟩\langle S,A,R,S'\rangle from actual interaction and back up that one transition.

  • Cost becomes constant, independent of ∣S∣|\mathcal{S}| — the curse of dimensionality is broken by sampling.
  • The model disappears, because you no longer compute an expectation over P\mathcal{P} — you sample from the environment, which does it for you.

The second consequence is the larger one and it is almost a side effect: sampling was introduced for efficiency and delivered model-freedom. That is the transition from planning to reinforcement learning, and L4 begins on the other side of it.


Study checklist

Answer these without the notes before moving on to L4. Each item links back to where it is worked out; open the toggle only after you have tried.

1. What single operation turns L2's Bellman equations into L3's algorithms, and what does each choice give you?
→ p.7–8 · The Update ⏱ 12:56

Answer

Turn the equality into an assignment and iterate.
Bellman expectation equation → iterative policy evaluation (prediction). Expectation + greedy improvement → policy iteration. Bellman optimality equation → value iteration. That is slide p.26 and it is the whole lecture.

2. Which two properties must a problem have for DP, and what supplies each in an MDP?
→ p.3–6 · Requirements and Scope ⏱ 2:18

Answer

Optimal substructure — supplied by the Bellman equation, which decomposes a state's value into one step plus the successor's value.
Overlapping subproblems — supplied by the value function, which caches "reward obtainable from here" and is reused everywhere that state appears.
The reframe worth keeping: the value function is a cache.

3. In the small gridworld, what does the right-hand column show, and what does it imply?
→ p.9–11 · Small Gridworld ⏱ 19:45

Answer

The greedy policy with respect to vkv_k. By k=3k=3 it is already optimal, while the value function is far from converged (v∞≈−14,−20,−22v_\infty\approx-14,-20,-22).
Two implications: any value function can produce a better policy — you do not need vπv_\pi — and running evaluation to convergence is wasted work. That is modified policy iteration, and at k=1k=1, value iteration.
Also: −1.7-1.7 is 34(−2)+14(−1)=−1.75\tfrac34(-2)+\tfrac14(-1)=-1.75 truncated for display.

4. Prove that greedy policy improvement does not make things worse, and say why greedy is not myopic.
→ p.16 · The Policy Improvement Theorem ⏱ 46:30

Answer

One step: qπ(s,π′(s))=max⁡aqπ(s,a)≥qπ(s,π(s))=vπ(s)q_\pi(s,\pi'(s))=\max_a q_\pi(s,a)\ge q_\pi(s,\pi(s))=v_\pi(s) — a max is at least any particular element. Follow π′\pi' once then π\pi forever and you do no worse.
Telescope: apply that inequality again at the next state, and again, converting one more "then π\pi" into "then π′\pi'" each time, until vπ(s)≤vπ′(s)v_\pi(s)\le v_{\pi'}(s).
Not myopic because arg⁡max⁡aqπ(s,a)\arg\max_a q_\pi(s,a) maximizes one step of action plus the value function, which already summarizes all future reward under π\pi. It will trade immediate reward for a better successor.

5. Why can policy iteration not get stuck at a local optimum?
→ p.17 · When Improvement Stops ⏱ 52:36

Answer

Policy improvement defines a partial order: π′≥π\pi'\ge\pi iff vπ′(s)≥vπ(s)v_{\pi'}(s)\ge v_\pi(s) in every state. Each greedy step produces a policy ≥\ge its predecessor in that sense, so you can only climb.
The failure you would fear — better in some states, worse in others — is excluded by the "every state" quantifier; there is no sideways move to be trapped in.
And when climbing stops, vπ(s)=max⁡aqπ(s,a)v_\pi(s)=\max_a q_\pi(s,a), which is the Bellman optimality equation, so π\pi is optimal.

6. Does policy evaluation have to converge before you improve?
→ p.18–19 · Modified and Generalized Policy Iteration ⏱ 58:54

Answer

No. Options: run to convergence, stop at ϵ\epsilon-convergence, stop after fixed kk, or stop after k=1k=1 — all converge to π∗\pi_*.
k=1k=1 is exactly value iteration: evaluating the arg⁡max⁡\arg\max policy for one step is taking the max, so the two steps fuse and no explicit policy is built.
The general frame is GPI — any evaluation, any improvement, alternating — and the rest of the course swaps components into it without changing the diagram.

7. Value iteration's numbers go down while the improvement theorem says values go up. Resolve it.
→ p.23–24 · Value Iteration ⏱ 1:12:38

Answer

They describe different objects. The improvement theorem is about the value functions of actual policies under policy iteration, which do increase.
Value iteration's intermediate vkv_k is generally not vπv_\pi for any policy π\pi — it is an intermediate construct on the way to v∗v_*, so no monotonicity claim was ever made about it.
Policy iteration produces a real policy's value at every step; value iteration works directly in value space and never builds a policy until the end.

8. State the principle of optimality and say why "work backwards from the goal" is only intuition.
→ p.20 · Principle of Optimality ⏱ 1:01:54

Answer

π\pi achieves v∗(s)v_*(s) if and only if it achieves v∗(s′)v_*(s') for every reachable s′s'. The "only if" is what lets you solve successors first and settle the predecessor with a one-step lookahead.
The algorithm does not know where the goal is — or whether one exists. It sweeps every state every iteration and works on continuing, looping, stochastic MDPs with no terminal state at all. The backwards picture is a legible special case, not a requirement.

9. Give the complexity of DP with vv and with qq, and say why the course later prefers the expensive one.
→ p.26 · Synchronous DP Algorithms ⏱ 1:24:03

Answer

O(mn2)O(mn^2) per iteration with vv; O(m2n2)O(m^2n^2) with qq — because qq's roots and leaves are both state-action pairs.
qq removes the model. Acting from vv needs arg⁡max⁡a(Rsa+γ∑s′Pss′av(s′))\arg\max_a(\mathcal{R}^a_s+\gamma\sum_{s'}\mathcal{P}^a_{ss'}v(s')), and that lookahead is P,R\mathcal{P},\mathcal{R}. With qq it is arg⁡max⁡aq(s,a)\arg\max_a q(s,a) and needs nothing.
In L3 you have the model, so vv is cheaper and sufficient. From L5 you do not, and the constant factor is trivially worth paying.

10. Name the three asynchronous DP schemes and the condition that keeps convergence.
→ p.27–31 · Three Ways to Choose States ⏱ 1:29:27

Answer

In-place (one copy of vv, so backups see values updated earlier in the same sweep), prioritized sweeping (order by Bellman error; needs reverse dynamics and a priority queue), real-time DP (back up the states the agent actually visits).
Condition: convergence holds as long as every state continues to be selected eventually — the order is entirely free.
Ordering is worth a factor of nn: on a corridor swept goal-backwards, in-place value iteration finishes in one sweep.

11. What two problems do full-width backups have, and what single change fixes both?
→ p.32–33 · Full-Width and Sample Backups ⏱ 1:36:18

Answer

(1) Bellman's curse of dimensionality — ∣S∣|\mathcal{S}| grows exponentially in the number of state variables, and for large problems even one backup is unaffordable. (2) You must know P\mathcal{P} and R\mathcal{R} to compute the expectation.
The fix is sampling. Back up a sampled transition ⟨S,A,R,S′⟩\langle S,A,R,S'\rangle instead of expanding the full expectation: the cost becomes constant in ∣S∣|\mathcal{S}|, and the model disappears because the environment performs the expectation for you.
Sampling was introduced for efficiency and delivered model-freedom as a side effect. That is the step from planning to RL.

Gaps to close on your own

Slides p.35–42 — the entire contraction mapping section — are deferred

The lecture ran out of time and points you to the notes. This is the block that answers the questions raised and postponed twice during the lecture: does a solution exist, is it unique, do these iterations reach it, and how fast?

Lecture 3 Planning by Dynamic Programming, slide 38
Lecture 3 Planning by Dynamic Programming, slide 38

The argument in one line: measure distance between value functions by the ∞\infty-norm ∥u−v∥∞=max⁡s∣u(s)−v(s)∣\|u-v\|_\infty=\max_s|u(s)-v(s)|, then show the Bellman backup operator is a γ\gamma-contraction — it shrinks that distance by at least γ\gamma every application. The contraction mapping theorem then delivers a unique fixed point and a linear convergence rate of γ\gamma, all at once.

Lecture 3 Planning by Dynamic Programming, slide 41
Lecture 3 Planning by Dynamic Programming, slide 41

The same argument covers both operators: TπT^\pi has fixed point vπv_\pi (giving iterative policy evaluation and policy iteration), and T∗T^* has fixed point v∗v_* (giving value iteration).
You already had this section made permanent → Contraction Mapping & Bellman Convergence.

  • Slide p.34, approximate dynamic programming, is passed over. It is the first appearance of a function approximator v^(s,w)\hat v(s,\mathbf{w}) in the course: sample a subset of states, compute Bellman targets for them, fit the approximator, repeat — fitted value iteration. This is the direct ancestor of L6, and of DQN's fixed Q-targets in particular.
  • The value iteration demo (cs.ubc.ca/~poole/demos/mdp/vi.html) is recommended and not shown. It is the same gridworld at a size where you can watch values propagate.
  • Modified policy iteration's convergence for general kk is asserted and not proved; only the k=1k=1 case is identified with value iteration.
  • Prioritized sweeping needs reverse dynamics — the predecessors of a state. In a learned or sampled setting that is not free, and the lecture does not say how to get it.
  • The relationship between policy iteration and expectation-maximization is mentioned as real but subtle, explored in recent papers, and left there.

Language notes

Phrasings worth stealing for your own technical writing and talks:

Expression Use
breaking them down into subproblems the defining move of divide-and-conquer
a cache of everything we've figured out reframing a data structure by what it saves you
each state gets a turn at being the root describing a sweep without pseudocode
how much juice you can get out of it informal gloss on a value function
turn the equation into an iterative update converting a fixed-point condition into an algorithm
that gained us zero information computation that ran but changed no decision
you can only climb a monotone process that cannot get stuck
it's just an intermediate construct a quantity with no interpretation outside the algorithm
the ordering really matters same operations, different cost, by scheduling alone
breaks the curse of dimensionality through sampling trading exhaustiveness for constant cost
rlsilver-courselecture-notesdynamic-programmingpolicy-iterationvalue-iterationplanning