Mathster Maths topics Free worksheets Coverage Mathster for schools

Maths topics › A level Further Maths › D2, dynamic and programming

Solve dynamic programming problems presented in table form (A level only)

A level Further Maths · D2, dynamic and programming

A question

A street trader works for three days, at one market each day. She leaves home, goes to a market on each day in turn, then returns home. On day 1 she can go to A, B, C; on day 2 to D, E, F; on day 3 to G, H.

The profit, in hundreds of pounds, at each market:
ShopABCDEFGH
Profit9101311149614

The travel costs, in hundreds of pounds:
From / toABCDEFGHHome
Home545
A114
B456
C644
D64
E45
F61
G2
H3

She wants to maximise her income: total profit minus total travel costs. Use dynamic programming with stage = the number of days remaining and state = where she is; the value of each action is the profit at the next market minus the travel cost. Complete the table (stage, state, action, destination, value), mark with * the best action for each state, and state the markets she should visit, in order, and her maximum income.

Free worksheet

10 questions on this objective, ready to print.

Download the worksheet (PDF)

We use this address to send you the answers, and for news only if you tick the box.

Worked solution

The working

  1. (a) From \(E\), for each day-3 market: (profit there) minus (travel from \(E\)) minus (travel home). The largest is \(6\).
  2. (b) Working back one stage at a time, keeping the largest value at each state, gives \(24\) hundred pounds.   (c) The best tour is C, E, H, so day 2 is E.

Mathster is maths homework, practice and assessment for schools, with animated worked solutions. Try Mathster free for 60 days →

Objectives from the AS and A level subject content for further mathematics (Department for Education). Contains public sector information licensed under the Open Government Licence v3.0.