L29 - Dynamic Programming (Continued)
L29 - Dynamic Programming (Continued)
stages i, i+1, …, n.
Stage n: Thus xn = yn
Optimal return for this stage =
Fn ( xn ) max{ yn } xn
yn
Stage n-1:
Optimal return for this stage =
2
max{ yn1 ( xn1 yn1 )} xn 1
yn1 2
occurs when yn-1 = (xn-1)/2
Stage n-2:
Optimal return for this stage =
Fn 2 ( xn 2 )
max{ yn 2 Fn 1 ( xn 2 yn 2 )}
yn 2
( xn 2 yn 2 )
3
xn 2
2
max{ yn 2 }
yn 2 4 3
occurs when yn-2 = (xn-2)/3
Stage i:
Optimal return for this stage (by
induction on i) =
n i 1
xi
Fi ( xi )
n i 1
n n
x1 c
F1 ( x1 )
n n
occurs when y1 = x1/ n = c/ n
y2 = x2/(n-1) = (x1-y1)/(n-1)
= (c- c/n)/(n-1) = c/n
y3 y3*F4(x3-y3) F3(x3) y 3*
x3 0 1 2 3 4 5
0 0 - - - - - 0 0
1 0 0 - - - - 0 0,1
2 0 1 0 - - - 1 1
3 0 2 2 0 - - 2 1,2
4 0 3 4 3 0 - 4 2
5 0 4 6 6 4 0 6 2,3
n=2 Here
F2 ( x2 ) max{( y2 5) F3 ( x2 y2 )} 2
y2
y2 ( y2 y5) F
*f2 (x -y3 ()x2 y2 )
3 4 3 3 F2(x2) y 2*
x2 0 1 2 3 4 5
0 25 - - - - - 25 0
1 25 16 - - - - 25 0
2 26 16 9 - - - 26 0
3 27 17 9 4 - - 27 0
4 29 18 10 4 1 - 29 0
5 31 20 11 5 1 0 31 0
n=1 Here
F1 ( x1 ) max{( y1 2) F2 ( x1 y1 )} 2
y1
y1 ( y1 y2) 2
-y
*f (x F2 () x1 y1 )
3 4 3 3 F1(x1) y 1*
x1 0 1 2 3 4 5
0 29 - - - - - 29 0
1 29 34 - - - - 34 1
2 30 34 41 - - - 41 2
3 31 35 41 50 - - 50 3
4 33 36 42 50 61 - 61 4
5 35 38 43 51 61 74 74 5
Thus the optimal solution is:
y1 5, y2 0, y3 0, y4 0
And the optimal value is z = 74
Hillier and Lieberman Problem 11.3-13
Page 573
Maximize z y1 y y
2
2
3
3
Subject to
y1 2 y2 3 y3 10
y1 1, y2 1, y3 1,
x3 F3(x3) y 3*
0, 1, 2 0 0
3, 4, 5 1 1
6, 7, 8 8 2
9, 10 27 3
F (
Stage 2 2 2x ) max y
y2
2 F3 ( x2 2 y2 )
2
y2 y22 F3 ( x2 2 y2 )
x2 1 2 3 4 5 F2(x2) y2*
5 1 - - - - 1 1
6 1 - - - - 1 1
7 1 4 - - - 4 2
8 8 4 - - - 8 1
9 8 4 9 - - 9 3
10 8 32 9 - - 32 2
Stage 1 F1 ( x1 ) max y1 F2 ( x1 y1 )
y1
y1 y1 F2 ( x1 y1 )
x1 1 2 3 4 5 F1(x1) y1*
10 9 16 12 4 5 16 2
Cost
Component
Parallel units 1 2 3 4
1 1 2 1 2
2 2 4 3 3
3 3 5 4 4
Because of budget limitations, a maximum of
$1,000 can be expended.
Use Dynamic Programming to determine
how many parallel units should be installed in
each of the four components to maximize the
probability that the system will function.
Solution: There are 4 stages. At stage i, we
decide the number yi of component i to be
installed. At stage i, the system is in state xi,
namely the amount to be allocated to the
stages i, i+1, …,4. All amount is in hundreds
of dollars.
Our objective is to maximize the reliability of
the system, namely,
z p1 ( y1 ) p2 ( y2 ) ... pn ( yn )
where pi(yi) = probability of component i
functioning when yi number of component i
are installed (and is given in the first table)
If Fi(xi) is the optimal reliability of the system
for stages i,i+1, …, 4 we then have the
recursive relation
Fi ( xi ) max{ pi ( yi ) Fi 1 ( xi ci ( yi ))}
yi
i=1,2,3,4
where pi(yi) = probability of component i
functioning when yi number of component i
are installed (and is given in the first table)
and ci(yi) is the cost of yi number of
component i (and is given in the second
table).
Stage 4
x4 F4(x4)= p4(y4) y4*
2 0.5 1
3 0.7 2
4, 6 0.9 3
Stage 3
y3 p3(y3) * F4(x3-c3(y3))
x3 1 2 3 F3(x3) y3*
0.7x0.5
3 = 0.35 - - 0.35 1
0.7x0.7
4 = 0.49 - - 0.49 1
0.7x0.9 0.8x0.5
5 = 0.63 = 0.40 - 0.63 1
0.7x0.9 0.8x0.7 0.9x0.5
6 = 0.63 = 0.56 = 0.45 0.63 1
0.7x0.9 0.8x0.9 0.9x0.7
7 = 0.63 = 0.72 = 0.63 0.72 2
Stage 3 (Continued)
y3 p3(y3) * F4(x3-c3(y3))
x3 1 2 3 F3(x3) y3*
0.7x0.9 0.8x0.9 0.9x0.9
8 = 0.63 = 0.72 = 0.81 0.81 3
0.7x0.9 0.8x0.9 0.9x0.9
9 = 0.63 = 0.72 = 0.81 0.81 3
0.7x0.9 0.8x0.9 0.9x0.9
10 = 0.63 = 0.72 = 0.81 0.81 3
And z = 0.3024