The Student Room Group

D2 Dynamic programming help

I cant understand how to do Dynamic programming by looking at the tables. I can do it when its in graph form but I dont understand whats what in the table questions.

E.g.
http://tinypic.com/r/5d2e5e/9
Original post by fpmaniac
I cant understand how to do Dynamic programming by looking at the tables. I can do it when its in graph form but I dont understand whats what in the table questions.

E.g.
http://tinypic.com/r/5d2e5e/9


stage is jam, pie filling and dried fruit
state is how many units you can allocate
action is how many units you allocate
destination is how many units you have left to allocate for the next stage
value is finding the maximum of the profits
Reply 2
Original post by KloppOClock
stage is jam, pie filling and dried fruit
state is how many units you can allocate
action is how many units you allocate
destination is how many units you have left to allocate for the next stage
value is finding the maximum of the profits


Yeah, I dont know what to do with that though. I know how you do D.P on a chart but I dont know what to do with this.
Original post by fpmaniac
Yeah, I dont know what to do with that though. I know how you do D.P on a chart but I dont know what to do with this.


draw a table like this on question 7

https://3cb8366df74746bcd8eec8f4a7035f5f8ad90c26.googledrive.com/host/0B1ZiqBksUHNYRDVfakk5MURORVE/June%202014%20AB%20-%20D2%20Edexcel.pdf

put stage as jam, as you are working backwards, your state (how many fruits you can allocate should be 1,2,3,4,5. then at the end of this final stage, you have to allocate all your fruits so the actions should be equal the the states in this stage. then your destination should all be 0. work out how much money you get for allocating that much fruit in each row for jam

next stage is pie filling, for your state (how many fruits you have available to allocate) you put the first state as 5, and for the action of this you can put 5,4,3,2,1,0. do the same for all states 1-5. for each row work out how much money that gets you added on to the maximum from the last stage, then mark the maximum row for each state.

for the final stage of dried fruit, you only start with 5 units of fruit to allocate so that is your only fruit, so you can allocate 5,4,5,3,2,1,0 for your actions, find the maximum and then you can work out your answer

its kinda complex to explain through text so if you want i could explain it on skype
Reply 4
Original post by KloppOClock
draw a table like this on question 7

https://3cb8366df74746bcd8eec8f4a7035f5f8ad90c26.googledrive.com/host/0B1ZiqBksUHNYRDVfakk5MURORVE/June%202014%20AB%20-%20D2%20Edexcel.pdf

put stage as jam, as you are working backwards, your state (how many fruits you can allocate should be 1,2,3,4,5. then at the end of this final stage, you have to allocate all your fruits so the actions should be equal the the states in this stage. then your destination should all be 0. work out how much money you get for allocating that much fruit in each row for jam

next stage is pie filling, for your state (how many fruits you have available to allocate) you put the first state as 5, and for the action of this you can put 5,4,3,2,1,0. do the same for all states 1-5. for each row work out how much money that gets you added on to the maximum from the last stage, then mark the maximum row for each state.

for the final stage of dried fruit, you only start with 5 units of fruit to allocate so that is your only fruit, so you can allocate 5,4,5,3,2,1,0 for your actions, find the maximum and then you can work out your answer

its kinda complex to explain through text so if you want i could explain it on skype


Oh I get it now :biggrin:. The books not really clear on the table bit
Original post by fpmaniac
Oh I get it now :biggrin:. The books not really clear on the table bit


in the exam you will get that table, but you will have to figure out yourself what each column represents

Quick Reply

Latest