You are on page 1of 2

A master student has 7 days remaining before final examinations begin in his four courses, and he wants to allocate

this study
time as effectively as possible. He needs at least 1 day on each course, and he likes to concentrate on just one course each
day, so he wants to allocate 1, 2, 3, or 4 days to each course. He decides to use dynamic programming to make these
allocations to maximize the total grade points to be obtained from the four courses. He estimates that the alternative
allocations for each course would yield the number of grade points shown in the following table

Solve this problem using dynamic programming.


a) Using "brute force" enumeration, we can inspect all the possible allocations as follows.
Allocation day Estimate grade point Total
Course 1 Course 2 Course 3 Course 4 Course 1 Course 2 Course 3 Course 4 Point
3 1 2 1 6 5 6 4 21 Maximize total grade points = 21
8 5 4 4 21
4
3
1
2
1
1
1
1 6 6 4 4 20
With 2 scenarios:
1 1 4 1 1 5 9 4 19
1 3 2 1 1 8 6 4 19
2 1 3 1 3 5 7 4 19
2 2 2 1 3 6 6 4 19
2 3 1 1 3 8 4 4 19
3 1 1 1 6 5 4 4 19
3 1 1 2 6 5 4 4 19
1 1 1 4 1 5 4 8 18
1 2 3 1 1 6 7 4 18
2 1 2 1 3 5 6 4 18
2 1 2 2 3 5 6 4 18
1 1 2 3 1 5 6 5 17
1 1 3 1 1 5 7 4 17
1 1 3 2 1 5 7 4 17
1 2 2 1 1 6 6 4 17
1 2 2 2 1 6 6 4 17
1 3 1 1 1 8 4 4 17
1 3 1 2 1 8 4 4 17
1 4 1 1 1 8 4 4 17
2 1 1 3 3 5 4 5 17
2 2 1 1 3 6 4 4 17
2 2 1 2 3 6 4 4 17
1 1 2 1 1 5 6 4 16
1 1 2 2 1 5 6 4 16
1 2 1 3 1 6 4 5 16
2 1 1 1 3 5 4 4 16
2 1 1 2 3 5 4 4 16
1 1 1 3 1 5 4 5 15
1 2 1 1 1 6 4 4 15
1 2 1 2 1 6 4 4 15
1 1 1 1 1 5 4 4 14
1 1 1 2 1 5 4 4 14

You might also like