Hard Further Maths Dynamic programming Questions

Challenging, exam-style Further Maths Dynamic programming questions with worked solutions. Stretch yourself on the hardest dynamic-programming, bellman, stage-state-action, minimisation problems.

dynamic-programmingbellmanstage-state-actionminimisationmaximisationmaximin-minimax
Further Maths34 questionsStep-by-step solutions
Question 1
9 markschallenging
The states are arranged in stages as follows: stage 00 contains AA; stage 11 contains BB, CC, DD; stage 22 contains EE, FF, GG; stage 33 contains HH, II; stage 44 contains JJ. Each arc joins a state to a state in the next stage, and the arc values are AB=9AB=9, AC=45AC=45, AD=34AD=34, BE=23BE=23, BF=33BF=33, BG=3BG=3, CE=25CE=25, CF=44CF=44, CG=31CG=31, DE=46DE=46, DF=42DF=42, DG=18DG=18, EH=21EH=21, EI=2EI=2, FH=22FH=22, FI=24FI=24, GH=26GH=26, GI=6GI=6, HJ=41HJ=41, IJ=13IJ=13. Using Bellman's principle of optimality, determine the route of greatest total value from AA to JJ. Which of the following is that route?
Show worked solution

Worked solution

  1. Identify the stages, states and arcs of the network

    stages 0 to 4,  source A,  sink J\text{stages }0\text{ to }4,\;\text{source }A,\;\text{sink }J

    Dynamic programming labels each state by the stage it belongs to; a route uses exactly one arc per stage from the source to the sink.

  2. Give the sink its initial value

    g(J)=0g(J)=0

    The route ends at JJ, so from JJ there is no further value to add.

  3. Stage 3: optimise state HH

    g(H)=max{41+0}=41g(H)=\max\{41+0\}=41

    The optimal value at state HH combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  4. Stage 3: optimise state II

    g(I)=max{13+0}=13g(I)=\max\{13+0\}=13

    The optimal value at state II combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  5. Stage 2: optimise state EE

    g(E)=max{21+41,2+13}=62g(E)=\max\{21+41,\,2+13\}=62

    The optimal value at state EE combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  6. Stage 2: optimise state FF

    g(F)=max{22+41,24+13}=63g(F)=\max\{22+41,\,24+13\}=63

    The optimal value at state FF combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  7. Stage 2: optimise state GG

    g(G)=max{26+41,6+13}=67g(G)=\max\{26+41,\,6+13\}=67

    The optimal value at state GG combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  8. Stage 1: optimise state BB

    g(B)=max{23+62,33+63,3+67}=96g(B)=\max\{23+62,\,33+63,\,3+67\}=96

    The optimal value at state BB combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  9. Stage 1: optimise state CC

    g(C)=max{25+62,44+63,31+67}=107g(C)=\max\{25+62,\,44+63,\,31+67\}=107

    The optimal value at state CC combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  10. Stage 1: optimise state DD

    g(D)=max{46+62,42+63,18+67}=108g(D)=\max\{46+62,\,42+63,\,18+67\}=108

    The optimal value at state DD combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  11. Stage 0: optimise state AA

    g(A)=max{9+96,45+107,34+108}=152g(A)=\max\{9+96,\,45+107,\,34+108\}=152

    The optimal value at state AA combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  12. Trace the optimal route forwards from the source

    ACFHJ(45+44+22+41=152)A\to C\to F\to H\to J\quad\left(45+44+22+41=152\right)

    Following the optimal choice recorded at each state gives the route, whose arc values add up to the optimal total.

  13. State Bellman's principle of optimality

    optimal policy    optimal sub-policy\text{optimal policy}\;\Rightarrow\;\text{optimal sub-policy}

    Any part of an optimal route is itself optimal for the sub-problem that starts where that part begins, so each state need only be optimised once.

  14. Record the optimal value at every state

    g(A)=152,  g(B)=96,  g(C)=107,  g(D)=108,  g(E)=62,  g(F)=63,  g(G)=67,  g(H)=41,  g(I)=13g(A)=152,\;g(B)=96,\;g(C)=107,\;g(D)=108,\;g(E)=62,\;g(F)=63,\;g(G)=67,\;g(H)=41,\;g(I)=13

    Each label is the best value obtainable on a route from that state to the sink.

  15. Select the route of greatest total value

    optimal route:  ACFHJ\text{optimal route}:\;A\to C\to F\to H\to J

    This route attains the maximum total value of 152152 and no other route matches it.

Answer
ACFHJA\to C\to F\to H\to J
Question 2
9 markschallenging
The states are arranged in stages as follows: stage 00 contains AA; stage 11 contains BB, CC, DD; stage 22 contains EE, FF, GG; stage 33 contains HH, II; stage 44 contains JJ. Each arc joins a state to a state in the next stage, and the arc values are AB=9AB=9, AC=2AC=2, AD=33AD=33, BE=17BE=17, BF=30BF=30, BG=4BG=4, CE=47CE=47, CF=29CF=29, CG=23CG=23, DE=34DE=34, DF=25DF=25, DG=24DG=24, EH=42EH=42, EI=13EI=13, FH=18FH=18, FI=3FI=3, GH=14GH=14, GI=12GI=12, HJ=15HJ=15, IJ=36IJ=36. Using Bellman's principle of optimality, determine the route of greatest total value from AA to JJ. Which of the following is that route?
Show worked solution

Worked solution

  1. Identify the stages, states and arcs of the network

    stages 0 to 4,  source A,  sink J\text{stages }0\text{ to }4,\;\text{source }A,\;\text{sink }J

    Dynamic programming labels each state by the stage it belongs to; a route uses exactly one arc per stage from the source to the sink.

  2. Give the sink its initial value

    g(J)=0g(J)=0

    The route ends at JJ, so from JJ there is no further value to add.

  3. Stage 3: optimise state HH

    g(H)=max{15+0}=15g(H)=\max\{15+0\}=15

    The optimal value at state HH combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  4. Stage 3: optimise state II

    g(I)=max{36+0}=36g(I)=\max\{36+0\}=36

    The optimal value at state II combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  5. Stage 2: optimise state EE

    g(E)=max{42+15,13+36}=57g(E)=\max\{42+15,\,13+36\}=57

    The optimal value at state EE combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  6. Stage 2: optimise state FF

    g(F)=max{18+15,3+36}=39g(F)=\max\{18+15,\,3+36\}=39

    The optimal value at state FF combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  7. Stage 2: optimise state GG

    g(G)=max{14+15,12+36}=48g(G)=\max\{14+15,\,12+36\}=48

    The optimal value at state GG combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  8. Stage 1: optimise state BB

    g(B)=max{17+57,30+39,4+48}=74g(B)=\max\{17+57,\,30+39,\,4+48\}=74

    The optimal value at state BB combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  9. Stage 1: optimise state CC

    g(C)=max{47+57,29+39,23+48}=104g(C)=\max\{47+57,\,29+39,\,23+48\}=104

    The optimal value at state CC combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  10. Stage 1: optimise state DD

    g(D)=max{34+57,25+39,24+48}=91g(D)=\max\{34+57,\,25+39,\,24+48\}=91

    The optimal value at state DD combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  11. Stage 0: optimise state AA

    g(A)=max{9+74,2+104,33+91}=124g(A)=\max\{9+74,\,2+104,\,33+91\}=124

    The optimal value at state AA combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  12. Trace the optimal route forwards from the source

    ADEHJ(33+34+42+15=124)A\to D\to E\to H\to J\quad\left(33+34+42+15=124\right)

    Following the optimal choice recorded at each state gives the route, whose arc values add up to the optimal total.

  13. State Bellman's principle of optimality

    optimal policy    optimal sub-policy\text{optimal policy}\;\Rightarrow\;\text{optimal sub-policy}

    Any part of an optimal route is itself optimal for the sub-problem that starts where that part begins, so each state need only be optimised once.

  14. Record the optimal value at every state

    g(A)=124,  g(B)=74,  g(C)=104,  g(D)=91,  g(E)=57,  g(F)=39,  g(G)=48,  g(H)=15,  g(I)=36g(A)=124,\;g(B)=74,\;g(C)=104,\;g(D)=91,\;g(E)=57,\;g(F)=39,\;g(G)=48,\;g(H)=15,\;g(I)=36

    Each label is the best value obtainable on a route from that state to the sink.

  15. Select the route of greatest total value

    optimal route:  ADEHJ\text{optimal route}:\;A\to D\to E\to H\to J

    This route attains the maximum total value of 124124 and no other route matches it.

Answer
ADEHJA\to D\to E\to H\to J
Question 3
9 markschallenging
The states are arranged in stages as follows: stage 00 contains AA; stage 11 contains BB, CC, DD; stage 22 contains EE, FF, GG; stage 33 contains HH, II; stage 44 contains JJ. Each arc joins a state to a state in the next stage, and the arc values are AB=18AB=18, AC=6AC=6, AD=12AD=12, BE=44BE=44, BF=28BF=28, BG=35BG=35, CE=13CE=13, CF=17CF=17, CG=21CG=21, DE=19DE=19, DF=34DF=34, DG=42DG=42, EH=37EH=37, EI=48EI=48, FH=24FH=24, FI=16FI=16, GH=41GH=41, GI=38GI=38, HJ=8HJ=8, IJ=25IJ=25. Using Bellman's principle of optimality, determine the route of greatest total value from AA to JJ. Which of the following is that route?
Show worked solution

Worked solution

  1. Identify the stages, states and arcs of the network

    stages 0 to 4,  source A,  sink J\text{stages }0\text{ to }4,\;\text{source }A,\;\text{sink }J

    Dynamic programming labels each state by the stage it belongs to; a route uses exactly one arc per stage from the source to the sink.

  2. Give the sink its initial value

    g(J)=0g(J)=0

    The route ends at JJ, so from JJ there is no further value to add.

  3. Stage 3: optimise state HH

    g(H)=max{8+0}=8g(H)=\max\{8+0\}=8

    The optimal value at state HH combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  4. Stage 3: optimise state II

    g(I)=max{25+0}=25g(I)=\max\{25+0\}=25

    The optimal value at state II combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  5. Stage 2: optimise state EE

    g(E)=max{37+8,48+25}=73g(E)=\max\{37+8,\,48+25\}=73

    The optimal value at state EE combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  6. Stage 2: optimise state FF

    g(F)=max{24+8,16+25}=41g(F)=\max\{24+8,\,16+25\}=41

    The optimal value at state FF combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  7. Stage 2: optimise state GG

    g(G)=max{41+8,38+25}=63g(G)=\max\{41+8,\,38+25\}=63

    The optimal value at state GG combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  8. Stage 1: optimise state BB

    g(B)=max{44+73,28+41,35+63}=117g(B)=\max\{44+73,\,28+41,\,35+63\}=117

    The optimal value at state BB combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  9. Stage 1: optimise state CC

    g(C)=max{13+73,17+41,21+63}=86g(C)=\max\{13+73,\,17+41,\,21+63\}=86

    The optimal value at state CC combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  10. Stage 1: optimise state DD

    g(D)=max{19+73,34+41,42+63}=105g(D)=\max\{19+73,\,34+41,\,42+63\}=105

    The optimal value at state DD combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  11. Stage 0: optimise state AA

    g(A)=max{18+117,6+86,12+105}=135g(A)=\max\{18+117,\,6+86,\,12+105\}=135

    The optimal value at state AA combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.

  12. Trace the optimal route forwards from the source

    ABEIJ(18+44+48+25=135)A\to B\to E\to I\to J\quad\left(18+44+48+25=135\right)

    Following the optimal choice recorded at each state gives the route, whose arc values add up to the optimal total.

  13. State Bellman's principle of optimality

    optimal policy    optimal sub-policy\text{optimal policy}\;\Rightarrow\;\text{optimal sub-policy}

    Any part of an optimal route is itself optimal for the sub-problem that starts where that part begins, so each state need only be optimised once.

  14. Record the optimal value at every state

    g(A)=135,  g(B)=117,  g(C)=86,  g(D)=105,  g(E)=73,  g(F)=41,  g(G)=63,  g(H)=8,  g(I)=25g(A)=135,\;g(B)=117,\;g(C)=86,\;g(D)=105,\;g(E)=73,\;g(F)=41,\;g(G)=63,\;g(H)=8,\;g(I)=25

    Each label is the best value obtainable on a route from that state to the sink.

  15. Select the route of greatest total value

    optimal route:  ABEIJ\text{optimal route}:\;A\to B\to E\to I\to J

    This route attains the maximum total value of 135135 and no other route matches it.

Answer
ABEIJA\to B\to E\to I\to J
Question 4
9 markschallenging
The states are arranged in stages as follows: stage 00 contains AA; stage 11 contains BB, CC, DD; stage 22 contains EE, FF, GG; stage 33 contains HH, II; stage 44 contains JJ. Each arc joins a state to a state in the next stage, and the arc values are AB=20AB=20, AC=17AC=17, AD=6AD=6, BE=11BE=11, BF=23BF=23, BG=42BG=42, CE=25CE=25, CF=3CF=3, CG=32CG=32, DE=35DE=35, DF=22DF=22, DG=38DG=38, EH=49EH=49, EI=29EI=29, FH=2FH=2, FI=14FI=14, GH=21GH=21, GI=12GI=12, HJ=46HJ=46, IJ=47IJ=47. Using Bellman's principle of optimality, determine the route of least total cost from AA to JJ. Which of the following is that route?
Show worked solution

Worked solution

  1. Identify the stages, states and arcs of the network

    stages 0 to 4,  source A,  sink J\text{stages }0\text{ to }4,\;\text{source }A,\;\text{sink }J

    Dynamic programming labels each state by the stage it belongs to; a route uses exactly one arc per stage from the source to the sink.

  2. Give the sink its initial value

    g(J)=0g(J)=0

    The route ends at JJ, so from JJ there is no further value to add.

  3. Stage 3: optimise state HH

    g(H)=min{46+0}=46g(H)=\min\{46+0\}=46

    The optimal value at state HH combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  4. Stage 3: optimise state II

    g(I)=min{47+0}=47g(I)=\min\{47+0\}=47

    The optimal value at state II combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  5. Stage 2: optimise state EE

    g(E)=min{49+46,29+47}=76g(E)=\min\{49+46,\,29+47\}=76

    The optimal value at state EE combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  6. Stage 2: optimise state FF

    g(F)=min{2+46,14+47}=48g(F)=\min\{2+46,\,14+47\}=48

    The optimal value at state FF combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  7. Stage 2: optimise state GG

    g(G)=min{21+46,12+47}=59g(G)=\min\{21+46,\,12+47\}=59

    The optimal value at state GG combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  8. Stage 1: optimise state BB

    g(B)=min{11+76,23+48,42+59}=71g(B)=\min\{11+76,\,23+48,\,42+59\}=71

    The optimal value at state BB combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  9. Stage 1: optimise state CC

    g(C)=min{25+76,3+48,32+59}=51g(C)=\min\{25+76,\,3+48,\,32+59\}=51

    The optimal value at state CC combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  10. Stage 1: optimise state DD

    g(D)=min{35+76,22+48,38+59}=70g(D)=\min\{35+76,\,22+48,\,38+59\}=70

    The optimal value at state DD combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  11. Stage 0: optimise state AA

    g(A)=min{20+71,17+51,6+70}=68g(A)=\min\{20+71,\,17+51,\,6+70\}=68

    The optimal value at state AA combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  12. Trace the optimal route forwards from the source

    ACFHJ(17+3+2+46=68)A\to C\to F\to H\to J\quad\left(17+3+2+46=68\right)

    Following the optimal choice recorded at each state gives the route, whose arc values add up to the optimal total.

  13. State Bellman's principle of optimality

    optimal policy    optimal sub-policy\text{optimal policy}\;\Rightarrow\;\text{optimal sub-policy}

    Any part of an optimal route is itself optimal for the sub-problem that starts where that part begins, so each state need only be optimised once.

  14. Record the optimal value at every state

    g(A)=68,  g(B)=71,  g(C)=51,  g(D)=70,  g(E)=76,  g(F)=48,  g(G)=59,  g(H)=46,  g(I)=47g(A)=68,\;g(B)=71,\;g(C)=51,\;g(D)=70,\;g(E)=76,\;g(F)=48,\;g(G)=59,\;g(H)=46,\;g(I)=47

    Each label is the best value obtainable on a route from that state to the sink.

  15. Select the route of least total cost

    optimal route:  ACFHJ\text{optimal route}:\;A\to C\to F\to H\to J

    This route attains the minimum total cost of 6868 and no other route matches it.

Answer
ACFHJA\to C\to F\to H\to J
Question 5
9 markschallenging
The states are arranged in stages as follows: stage 00 contains AA; stage 11 contains BB, CC, DD; stage 22 contains EE, FF, GG; stage 33 contains HH, II; stage 44 contains JJ. Each arc joins a state to a state in the next stage, and the arc values are AB=14AB=14, AC=5AC=5, AD=23AD=23, BE=42BE=42, BF=25BF=25, BG=33BG=33, CE=19CE=19, CF=31CF=31, CG=9CG=9, DE=17DE=17, DF=12DF=12, DG=11DG=11, EH=22EH=22, EI=46EI=46, FH=45FH=45, FI=27FI=27, GH=30GH=30, GI=48GI=48, HJ=16HJ=16, IJ=41IJ=41. Using Bellman's principle of optimality, determine the route of least total cost from AA to JJ. Which of the following is that route?
Show worked solution

Worked solution

  1. Identify the stages, states and arcs of the network

    stages 0 to 4,  source A,  sink J\text{stages }0\text{ to }4,\;\text{source }A,\;\text{sink }J

    Dynamic programming labels each state by the stage it belongs to; a route uses exactly one arc per stage from the source to the sink.

  2. Give the sink its initial value

    g(J)=0g(J)=0

    The route ends at JJ, so from JJ there is no further value to add.

  3. Stage 3: optimise state HH

    g(H)=min{16+0}=16g(H)=\min\{16+0\}=16

    The optimal value at state HH combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  4. Stage 3: optimise state II

    g(I)=min{41+0}=41g(I)=\min\{41+0\}=41

    The optimal value at state II combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  5. Stage 2: optimise state EE

    g(E)=min{22+16,46+41}=38g(E)=\min\{22+16,\,46+41\}=38

    The optimal value at state EE combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  6. Stage 2: optimise state FF

    g(F)=min{45+16,27+41}=61g(F)=\min\{45+16,\,27+41\}=61

    The optimal value at state FF combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  7. Stage 2: optimise state GG

    g(G)=min{30+16,48+41}=46g(G)=\min\{30+16,\,48+41\}=46

    The optimal value at state GG combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  8. Stage 1: optimise state BB

    g(B)=min{42+38,25+61,33+46}=79g(B)=\min\{42+38,\,25+61,\,33+46\}=79

    The optimal value at state BB combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  9. Stage 1: optimise state CC

    g(C)=min{19+38,31+61,9+46}=55g(C)=\min\{19+38,\,31+61,\,9+46\}=55

    The optimal value at state CC combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  10. Stage 1: optimise state DD

    g(D)=min{17+38,12+61,11+46}=55g(D)=\min\{17+38,\,12+61,\,11+46\}=55

    The optimal value at state DD combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  11. Stage 0: optimise state AA

    g(A)=min{14+79,5+55,23+55}=60g(A)=\min\{14+79,\,5+55,\,23+55\}=60

    The optimal value at state AA combines each outgoing arc with the value already fixed at the state it leads to, and keeps the smallest total.

  12. Trace the optimal route forwards from the source

    ACGHJ(5+9+30+16=60)A\to C\to G\to H\to J\quad\left(5+9+30+16=60\right)

    Following the optimal choice recorded at each state gives the route, whose arc values add up to the optimal total.

  13. State Bellman's principle of optimality

    optimal policy    optimal sub-policy\text{optimal policy}\;\Rightarrow\;\text{optimal sub-policy}

    Any part of an optimal route is itself optimal for the sub-problem that starts where that part begins, so each state need only be optimised once.

  14. Record the optimal value at every state

    g(A)=60,  g(B)=79,  g(C)=55,  g(D)=55,  g(E)=38,  g(F)=61,  g(G)=46,  g(H)=16,  g(I)=41g(A)=60,\;g(B)=79,\;g(C)=55,\;g(D)=55,\;g(E)=38,\;g(F)=61,\;g(G)=46,\;g(H)=16,\;g(I)=41

    Each label is the best value obtainable on a route from that state to the sink.

  15. Select the route of least total cost

    optimal route:  ACGHJ\text{optimal route}:\;A\to C\to G\to H\to J

    This route attains the minimum total cost of 6060 and no other route matches it.

Answer
ACGHJA\to C\to G\to H\to J

Unlock 29 more Dynamic programming questions

Create a free account to work through every Further Maths Dynamic programming question with instant step-by-step worked solutions, progress tracking and interactive lessons.

  • Full worked solutions for every question
  • Interactive lessons and instant feedback
  • Track your mastery across every topic
Create a Free Account

No card required · Free forever

More Dynamic programming practice

Related Decision Maths topics