The University of Edinburgh · FACULTY OF MATHEMATICS

MATH10065 Chap.1 Dynamic Programming and Optimality

- one subject, every graph, every model, every mark
5 Chapters2-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 1 of 10 · MATH10065

Dynamic Programming and Optimality

Start with the state

Dynamic programming solves sequential decisions by linking smaller subproblems. A useful formulation names the stage, the state available before the decision, the feasible decision set, the transition to the next state and the terminal condition.

The state should retain all information that changes the future without carrying history that no future calculation uses.

Read the value function

For minimisation, each candidate combines an immediate cost with the optimal remaining cost from the next state. Compare candidates only after both pieces are present. A greedy choice can fail because the smallest immediate cost may create an expensive continuation.

Store the decision attaining each best value so the optimal policy can be recovered.

Verify the policy

Begin from the initial state and follow stored choices until the boundary. Recompute the accumulated objective along that path and confirm every transition is feasible.

When data change, locate the first value depending on the changed datum and propagate the repair backwards rather than restarting unrelated stages.

Distinguish value from policy

A value table says how good the best continuation is from every state. A policy table says which decision attains that value. Keep them beside each other, especially when choices tie.

During reconstruction, take the stored decision, apply its transition and read the next decision from the resulting state. A route assembled from disconnected entries is not a feasible policy.

Check the principle of optimality

The remaining decisions of an optimal policy must themselves be optimal for the state created by the first choice. Ask whether future evaluation depends only on the proposed state.

If an unrecorded earlier decision changes later feasibility or cost, enlarge the state before applying recursion. The defect lies in the model description rather than the backward calculation.

Prepare an exam table

Use columns for stage, state, feasible decision, immediate contribution, next-state value, total and chosen decision.

This layout exposes a missing boundary, reversed optimisation direction or invalid transition. Trace the finished policy in the language of the question and total its contributions independently. Agreement with the initial value is the closing numerical check.

In this chapter

What this chapter covers

  • 01

    Stage and state

  • 02

    Decision and transition

  • 03

    Value function

  • 04

    Boundary condition

  • 05

    Principle of optimality

Worked example · free

Compare complete route costs

Q [4 marks]. A route through P costs 6 then 4; a route through Q costs 3 then 9. Which is best? The mark allocation shown here is not University-published; it is a study structure for this recurrence.
Backward recursion on a layered network.Backward recursion on a layered network. Each arrow carries an immediate cost, while the value at a node adds that cost to the best remaining route.SABT4258
Backward recursion on a layered network. Each arrow carries an immediate cost, while the value at a node adds that cost to the best remaining route.
  • 1Total the P route.
  • 1Total the Q route.
  • 2Select and interpret.
P costs 10 and Q costs 12, so choose P despite its larger first cost.
Sia tip — Never compare first arcs without their continuation values.
Glossary

Key terms

State
A State contains the information required for future choices and contributions, allowing different histories to share one value only when they have identical feasible decisions, transitions and remaining objective effects.
Recurrence
A Recurrence links a current decision to the optimal value of a smaller subproblem by combining immediate contribution with the continuation value of the resulting state.
Boundary Condition
A Boundary Condition fixes the value at the end of the decision horizon and closes the backward recursion numerically, preventing the final-stage equation from referring to an undefined future value and ensuring every earlier candidate can be evaluated on the same objective scale with a defined stopping rule for policy reconstruction.
FAQ

Dynamic Programming and Optimality FAQ

Why can a greedy route be wrong?

A greedy route compares only the next visible cost, while dynamic programming compares immediate cost plus the best remaining continuation. A cheap first move can lead to an expensive future state, so complete candidate values must be compared at the same stage.

How can I tell whether a state is sufficient?

Imagine two histories with the same proposed state. If they have different feasible decisions, transition laws or future costs, the state is missing information. If all future calculations match, the discarded historical detail is unnecessary.

What must be stored besides the optimal value?

Store an argmin or argmax decision beside every value, including ties when relevant. The values prove objective quality, but the stored choices recover the route or policy that actually attains that objective from the initial state.

Study strategy

Exam move

Write the five modelling objects from memory, then solve a short layered network backwards. Cover the decision column and reconstruct it from the value calculations. Finally change one arc cost and update only the affected predecessor values. Build three variants of the same network: one with a tie, one where the greedy first arc fails and one where a resource status must join location in the state.

For every variant, state the terminal value before the recurrence. Read each computed row aloud as immediate contribution plus best remaining value, then name the selected decision. Trace the policy forward and total its arcs independently. If the two totals disagree, inspect the first transition rather than changing the final answer.

Once this is reliable, practise translating non-network settings into the same structure by identifying stages, sufficient state information and the action that moves the state. Keep a two-column error log separating arithmetic slips from modelling slips; recurrence fluency improves fastest when an incomplete state is not misdiagnosed as bad addition.

Add a forward-recursion version of one route and explain how its state meaning differs from the backward version. Compare the recovered policies, not just their final values. Use one example with multiple optimal decisions and preserve every tie until a later criterion is stated.

End revision by writing the principle of optimality in ordinary language and giving one state definition for which it would fail because relevant history was omitted.

Working through Dynamic Programming and Optimality in MATH10065? Sia is AskSia’s AI Mathematics tutor — ask any MATH10065 Dynamic Programming and Optimality question and get a clear, step-by-step explanation grounded in how MATH10065 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 10 of your subjects at The University of Edinburgh, plus 1,000+ more Bibles across the AskSia library.
Sia - your MATH10065 tutor, unlimited, worked the way the exam marks it
The full 2-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works