Professional Documents
Culture Documents
Dynamic Programming
Dynamic Programming
PROGRAMMING
Lecture 3
Prof. Preetam Basu
IIM Calcutta
f T (i ) boundary condition
p ( j | i, a ) f
j
t 1 (
j )
If Sally makes it to the head of the line and enters service before the
end of her lunch break, she earns reward r . Here the assumption is
Sally earns the reward r if her transaction starts. This model is
represented as Model 1
However, Sally does not enjoy waiting in lines, so to reflect her dislike
for waiting in line, she incurs a cost of c for each minute she waits.
Suppose that when Sally arrives, 20 people are ahead of her in line.
Solution: Model 1
(Leave)
f 29 (n) max rp (n | n) c
p (k | n) f 30 (n k ) (Stay)
k n
Solution Contd
(Leave)
t 1
k n
Solution Contd
k n
,30 will be
Solution Contd
Model 2
t 1
k n
Example 1: Inventory
Management
Example 2: Capacity
Expansion
Example 3