Leaving Certificate Applied Mathematics2.10 Bellman's principle of optimality

All books

2.10 Bellman's principle of optimality — Practise with help

Warm-up: remember

  1. On the network of Section 2.9, what is the least cost from EE to FF?
  2. What is the least cost from AA to FF, and along which route?
Answers and feedback
  1. EF=1EF = 1, so 11.
  2. 88, along A→C→E→FA \to C \to E \to F.

Practise with help

1. State Bellman's principle of optimality.

Hint

It is about parts of an optimal route.

Next step

What can you say about any section of the best route?

Full working

Any part of an optimal route is itself an optimal route between its own two endpoints.

Equivalently: if a route is optimal as a whole, then replacing any section of it with a cheaper section would produce a cheaper whole, which is impossible. So no section can be improved.

2. The optimal route from AA to FF is A→C→E→FA \to C \to E \to F with cost 8. Is the part A→CA \to C optimal between AA and CC? Explain.

Hint

What other route is there from AA to CC?

Next step

The only edges out of AA are AB=2AB = 2 and AC=5AC = 5, and there is no route from BB to CC in this network.

Full working

Yes. The only edge from AA to CC is AC=5AC = 5, so the part A→CA \to C is trivially the optimal route between AA and CC.

Bellman's principle guarantees this in general, but here you can also check it directly because the network is small. Both agree, as they must.

3. A route from AA to FF goes A→B→D→FA \to B \to D \to F with cost 12. Is the part B→D→FB \to D \to F optimal between BB and FF? Show your working.

Hint

Compare B→D→FB \to D \to F with B→E→FB \to E \to F.

Next step

4+6=104 + 6 = 10 against 7+1=87 + 1 = 8.

Full working

No. B→D→FB \to D \to F costs 4+6=104 + 6 = 10, while B→E→FB \to E \to F costs 7+1=87 + 1 = 8. So the part is not optimal between BB and FF.

This does not contradict Bellman's principle, because the whole route A→B→D→FA \to B \to D \to F is not optimal — its cost is 12, against the optimal 8. The principle only makes claims about optimal routes.

4. Explain why Bellman's principle is needed for dynamic programming to work.

Hint

What does dynamic programming reuse?

Next step

The value at a state, whichever larger problem it belongs to.

Full working

Dynamic programming solves each state once and reuses its value wherever that state appears. That is only sound if the value is the same in every context.

Bellman's principle gives exactly that: the least cost from a state to the end depends only on the state, not on how you reached it. So the value is fixed, and can be computed once.

Without the principle, the best continuation from a state might depend on the route taken to reach it, and a single number per state would not be enough — dynamic programming would be invalid.

5. A student says: "Bellman's principle means the greedy method is correct — always take the best-looking step." Explain the mistake.

Hint

The principle is about an optimal route. Does the greedy choice find one?

Next step

On the network of Section 2.9, greedy gave 10 and optimal was 8.

Full working

The principle says that in an already optimal route, every part is optimal. It does not say that choosing the cheapest step at each stage builds an optimal route.

On the network of Section 2.9, the greedy choice from AA is AB=2AB = 2, leading to a total of 10, while the optimal total is 8. So the greedy route is not optimal, and the principle says nothing about its parts.

The difference is direction and knowledge. The principle is used backwards, when the cost of the rest of the journey is already known. Greedy decides forwards, without that knowledge.

6. On a four-stage network, the optimal route from stage 1 to stage 4 is P→Q→S→UP \to Q \to S \to U with cost 8. A second route P→Q→T→UP \to Q \to T \to U also costs 8. Does this break Bellman's principle?

Hint

Does the principle say the optimal route is unique?

Next step

It says parts of an optimal route are optimal — not that there is only one.

Full working

No. The principle says that every part of an optimal route is optimal between its own endpoints. It does not say there is only one optimal route.

Both routes are optimal, and both have the same cost 8. The part Q→S→UQ \to S \to U costs 3+4=73 + 4 = 7, and the part Q→T→UQ \to T \to U costs 6+1=76 + 1 = 7: both are optimal between QQ and UU, because they tie. Ties are allowed.

When values tie, a dynamic programming table records the best value; there may be more than one route achieving it.

A question from Section 2.9

7. In the backward recursion, the value at each state is computed from the values of the states one stage later. Explain how this uses Bellman's principle.

Hint

The value at a state is the cost of the best continuation.

Next step

The continuation begins with one edge, then an optimal route from the next state.

Full working

The best continuation from a state starts with one edge to some state in the next stage, and then continues optimally from there. By Bellman's principle, that continuation is itself an optimal route from the next state — so its cost is exactly the value already computed for that state.

So the value at a state is

value(state)=min⁡edges(edge cost+value(next state))\text{value(state)} = \min_{\text{edges}} \left( \text{edge cost} + \text{value(next state)} \right)

which is the recursion. Bellman's principle is what makes the "value(next state)" term the right thing to add: it is the cost of the best continuation, guaranteed.

8. A network has one stage with a single state, and the cost to the end is 0. Explain why the recursion has to start there, using Bellman's principle.

Hint

What is the optimal route from the destination to itself?

Next step

There is nothing to decide.

Full working

At the last stage the route is already finished, so the optimal route from that state to the end is the empty route, of cost 0. There is no decision and no dependence on any other state.

That is the only place where the value is known without using Bellman's principle. Every other value is computed from the values one stage later, using the principle to justify adding "the cost of the best continuation". So the recursion must start where the value is known directly — at the end — and work backwards.

Settings

Colour scheme

Light or dark pages. Your colour and layout stay the same.

Colour

The paper, ink and lettering. Your layout stays the same.

Quiet colours
Bold colours
Layout

How pages are arranged. Your colours stay the same.

Reading offline

Keep this book on this device and read it offline.