0% found this document useful (0 votes)
33 views8 pages

Stoch 1

The document discusses a farmer's land allocation problem under uncertainty. It considers allocating land between wheat, corn and sugar beets to maximize expected profit given random yields. First, it models the problem assuming expected yields. It then extends the model to consider multiple scenarios of good, average and bad yields with different probabilities. The optimal solution under uncertainty has a lower expected profit than if yields were known with certainty, with the difference being the value of perfect information.

Uploaded by

林柔妏
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views8 pages

Stoch 1

The document discusses a farmer's land allocation problem under uncertainty. It considers allocating land between wheat, corn and sugar beets to maximize expected profit given random yields. First, it models the problem assuming expected yields. It then extends the model to consider multiple scenarios of good, average and bad yields with different probabilities. The optimal solution under uncertainty has a lower expected profit than if yields were known with certainty, with the difference being the value of perfect information.

Uploaded by

林柔妏
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Winter 2008 CS567 Stochastic Linear/Integer Programming

Guest Lecturer: Xu, Huan

Class 1: Some Examples on Modeling

1 Farmer’s Problem

Consider a farmer, who has 500 acres of land, and raise grain, corn and sugar beet. In winter he wants
to decide how much land he should devote for each crop in order to get maximal profit in the next
autumn.
The farmer need 200T of wheat and 240T of corn to feed his cattle. These amounts can be either
raised by himself or bought from an external wholesaler. If more than this amount is produced, the
exceeded part will be sold. Selling prices are 170$ and 150$ per ton of wheat and corn respectively.
The purchase prices are 40% more than the selling price.
Sugar beet sells at 36$ per ton. However, there is a quota on sugar beet production, any amount in
excess of the quota can be sold only at 10$ per ton. The quota this year is 6000T .
Based on past experience, the farmer knows that the mean yield on his land is roughly 2.5T , 3T and
10T per acre for wheat, corn and sugar beets, respectively. And the planting costs are 150$, 230$ and
260$ per acre respectively.

Table 1: Data for farmer’s problem

Wheat Corn Sugar Beets


Yield (T/acre) 2.5 3 20
Panting cost($/acre) 150 230 260
Selling price ($/T) 170 150 36 under 6000T
10 above 6000T
Purchase price ($/T) 238 210 -
Minimum requirement (T) 200 240 -
Total available land :500 acres

Let x1,2,3 be the acres of land devoted to wheat, corn and sugar beets respectively. w1,2 be the tones
of wheat and corn sold. y1,2 be the tons of wheat and corn purchased. w3 be the tons of sugar beets
sold at the favorable price, and w4 be the tons of sugar beets sold at the lower price. We formulate
the problem as the following Linear Program
minimize: 150x1 + 230x2 + 260x3 + 238y1 − 170w1 + 210y2 − 150w2 − 36w3 − 10w4
such that: x1 + x2 + x3 ≤ 500,
2.5x1 + y1 − w1 ≥ 200,
3x2 + y2 − w2 ≥ 240,
w3 + w4 ≤ 20x3 ,
w3 ≤ 6000,
x1 , x2 , x3 , y1 , y2 , w1 , w2 , w3 , w4 ≥ 0.

1
If we solve this LP, we get the optimal solution based on the expected yield:

Table 2: Optimal solution based on expected yields

Culture Wheat Corn Sugar Beets


Surface (acre) 120 80 300
Yield (T) 300 240 6000
Sales (T) 100 - 6000
Purchase (T) - - -
Overall Profit :$118,600

This optimal solution is easy to understand. The farmer devotes enough land to sugar beet to reach
the quota of 6000T . He then devotes enough land to wheat and corn to meet his feeding requirement.
The rest land is devoted to wheat production for selling. That is, the optimal solution follows a simple
rule according to decreasing profit per acre. In this example, the order is sugar beets at a favorable
price, wheat for feeding, corn for feeding, wheat for selling, corn for selling, and sugar beets at the
lower price.
One problem of this formulation is that we are assuming to get the expected yield with 100% proba-
bility. In fact, yields can vary above/below their mean. Now we want to study:

• does this variability affect the optimality of our solution;

• if it does, how to find the optimal solution under the variability.

We study two possible representation of this variability. One approach is a scenario based representa-
tion, and the other one is a continuous representation.

1.1 A scenario representation

Assume that the yields for different crops are correlated and all depends on the whether. Say that we
have three possible whether condition: “good”, “average” or “bad”. Here “good” and “bad” stands
for 20% beyond or below the mean yield for all crops.
The LP for the “good” scenario is

minimize: 150x1 + 230x2 + 260x3 + 238y1 − 170w1 + 210y2 − 150w2 − 36w3 − 10w4
such that: x1 + x2 + x3 ≤ 500,
3x1 + y1 − w1 ≥ 200,
3.6x2 + y2 − w2 ≥ 240,
w3 + w4 ≤ 24x3 ,
w3 ≤ 6000,
x1 , x2 , x3 , y1 , y2 , w1 , w2 , w3 , w4 ≥ 0.

And its solution is

2
Table 3: Optimal solution for the good scenario

Culture Wheat Corn Sugar Beets


Surface (acre) 183.33 66.67 250
Yield (T) 550 240 6000
Sales (T) 350 - 6000
Purchase (T) - - -
Overall Profit :$167,677

The LP for the “bad” scenario is


minimize: 150x1 + 230x2 + 260x3 + 238y1 − 170w1 + 210y2 − 150w2 − 36w3 − 10w4
such that: x1 + x2 + x3 ≤ 500,
2x1 + y1 − w1 ≥ 200,
2.4x2 + y2 − w2 ≥ 240,
w3 + w4 ≤ 16x3 ,
w3 ≤ 6000,
x1 , x2 , x3 , y1 , y2 , w1 , w2 , w3 , w4 ≥ 0.

And its solution is

Table 4: Optimal solution for the bad scenario

Culture Wheat Corn Sugar Beets


Surface (acre) 100 25 375
Yield (T) 200 60 6000
Sales (T) - - 6000
Purchase (T) - 180 -
Overall Profit :$59,950

Therefore, we see that, knowing the whether condition beforehand is very helpful for the farmer to
make his decision. Unfortunately, weather conditions can not be accurately predicted six months
ahead. The farmer must make up his mind without perfect information on yields. Assume all three
scenarios may happen with probability 1/3, and the farmer is interested in maximizing his expected
utility, let’s see how this can be done. First, we notice that among all the variables, (x1 , x2 , x3 ) have
to be chosen before realizing the weather, where the decisions on sales and purchases depend on the
yields. So we index those decision by a scenario index s = 1, 2, 3 corresponding to “good”, “average”
and “bad” weather respectively. Now the farmer’s decision can be formed as the following LP:

3
minimize: 150x1 + 230x2 + 260x3
+ 1/3(238y11 + −170w11 + 210y21 − 150w21 − 36w31 − 10w41 )
+ 1/3(238y12 + −170w12 + 210y22 − 150w22 − 36w32 − 10w42 )
+ 1/3(238y13 + −170w13 + 210y23 − 150w23 − 36w33 − 10w43 )
such that: x1 + x2 + x3 ≤ 500,
3x1 + y11 − w11 ≥ 200,
3.6x2 + y21 − w21 ≥ 240,
w31 + w41 ≤ 24x3 ,
w31 ≤ 6000,
2.4x1 + y12 − w12 ≥ 200,
3x2 + y22 − w22 ≥ 240,
w32 + w42 ≤ 20x3 ,
w32 ≤ 6000,
2x1 + y13 − w13 ≥ 200,
2.4x2 + y23 − w23 ≥ 240,
w33 + w43 ≤ 16x3 ,
w33 ≤ 6000,
x, y, w ≥ 0.

Such a model of a stochastic decision program is known as the extensive form of the stochastic program
because it explicitly describe the second stage decision variable for all scenarios. And its solution is

Table 5: Optimal solution for the bad scenario

Wheat Corn Sugar Beets


First Stage Surface (acre) 170 80 250
Good Weather Yield (T) 510 288 6000
Sales (T) 310 48 6000
Purchase (T) - - -
Average Weather Yield (T) 425 240 5000
Sales (T) 225 - 5000
Purchase (T) - - -
Bad Weather Yield (T) 340 192 4000
Sales (T) 140 - 4000
Purchase (T) - 48 -
Overall Profit :$108,390

Suppose we know the scenario before hand, the mean profit is thus 1/3($118, 600 + $167, 677 +
$59, 950) = $115, 406. Hence, we have a gap $7, 016 between the solution of knowing and not knowing
the scenario beforehand. This gap, is called the expected value of perfect information (EVPI).
Another approach the farmer may have is to assume expected yields ad allocate the optimal planting
surface according to these yields (so-called expected value solution). This will lead to an expected profit

4
$107, 240. The loss by not considering the randomness is the difference between this and the stochastic
model profit. This value, $108, 390 − $107, 240 = $1, 150 is the value of the stochastic solution (VSS).
VSS tells us whether we should take a stochastic approach, and EVPI tells us whether we should dig
more information.

1.2 General Model

This example illustrate the general formulation of a stochastic problem. We have a set of decision
to be taken without full information on some random events. These decisions are called first-stage
decisions, represented as x. Later, full information is received on the realization of some random vector
ξ. Then, second stage or corrective actions y are taken. In mathematical programming terms, this
defines the so-called two-stage stochastic program with recourse of the form

Minimize: c> x + Eξ Q(x, ξ)


Such that: Ax = b,
x ≥ 0,

where Q(x, ξ) = min{q> y|W y = h − Tx, y ≥ 0}, ξ is the vector formed by the components of q> ,
h> and T. We assumed that W is fixed (fixed recourese).
In the farmer example, the random vector is a discrete variable with only three different realizations.
The second stage problem can be written as

Q(x, s) = min{238y1 − 170w1 + 210y2 − 150w2 − 36w3 − 10w4 }


s.t. t1 (s)x1 + y1 − w1 ≥ 200,
t2 (s)x2 + y2 − w2 ≥ 240,
w3 + w4 ≤ t3 (s)x3 ,
w3 ≤ 6000,
y1 , y2 , w1 , w2 , w3 , w4 ≥ 0.

This form is called the implicit representation of the stochastic program. A more condensed implicit
representation is by defining Q(x) = Eξ Q(x, ξ) as the value function or recourse function:

Minimize: c> x + Q(x)


Such that: Ax = b.
x ≥ 0,

1.3 Continuous random variable

We now assume that the yields for different crops are independent and follows a continuous distribu-
tion. To be more detailed, assume that the yield for each crop uniformly distributed in [li , ui ] where
li is 80% of the mean, and ui is 120% of the mean.
Notice in this particular example, the recourse function is separable
3
X 3
X
Eξ Q(x, ξ) = Eξ Qi (xi , ξ) = Qi (xi ),
i=1 i=1

5
where Qi (xi , ξ) is the optimal second-stage value of purchases and sales of crop i.
Considering Sugar beets:

Q3 (x3 , ξ) = min{ − 36w3 (ξ) − 10w4 (ξ)}


s.t. w3 (ξ) + w4 (ξ) ≤ t3 (ξ)x3 ,
w3 (ξ) ≤ 6000,
w3 (ξ), w4 (ξ) ≥ 0.

The optimal solution here is

w3 (ξ) = min[6000, t3 (ξ)x3]


w4 = max[t3 (ξ)x3 − 6000, 0].

Therefore, we have

Q3 (x3 , ξ) = −36 min[6000, t3 (ξ)x3] − 10 max[t3 (ξ)x3 − 6000, 0].

If x3 is such that l3 x3 ≤ 6000 ≤ u3 x3 we have


Z 6000/x3 Z u3
Q3 (x3 ) = − 36 + x3 f (t)dt − (216000 + 10tx − 3 − 60000)f (t)dt
l3 6000/x3
13(u3 x3 − 6000)2
= −36t̄3 x3 + ,
x3 (u3 − l3 )
where t̄3 denotes the expected yield for sugar beet.
If x3 is such that l3 x3 > 6000 then

Q3 (x3 ) = −156000 − 10t̄3 x3 .

If u3 x3 < 6000 then


Q3 (x3 ) = −36t̄3 x3 .
If we plot the function, we will find it to be continuous and convex.
The recourse function for the other two crops are similarly obtained. For wheat we have

 47600 − 595x1 if x1 < 200/3
Q1 (x1 ) = 119(200 − 2x1 )2 /x1 − 85(200 − 3x1 )2 /x1 if 200/3 ≤ x1 ≤ 100

34000 − 425x1 if x1 ≥ 100,

and for corn we have



 50400 − 630x2 if x2 < 200/3
Q2 (x2 ) = 2 2
87.5(240 − 2.4x2 ) /x2 − 62.5(240 − 3.6x2 ) /x2 if 200/3 ≤ x2 ≤ 100

36000 − 450x2 if x2 ≥ 100,

The global problem is therefore

Minimize: 150x1 + 230x2 + 260x3 + Q1 (x1 ) + Q2 (x2 ) + Q3 (x3 )


Such that: x1 + x2 + x3 ≤ 500,
x1,2,3 ≥ 0

This is a non-linear program, solve the solution x1 = 135.83, x2 = 85.07 and x3 = 279.10.

6
2 News Vendor Problem

A news vendor goes to the publisher every morning and buys x newspaper at a price of c per paper.
This number is usually bounded above by some limit u. The news vendor then tries to sell as many
newspapers as he can at a price q > c. Any unsold newspaper can be returned at a price q < c.
Demand for newspapers varies over days and is described by a random variable ξ. Assume the news
vendor cannot return to the publisher to buy more newspapers during the day and readers only want
the last edition.
To formulate this problem, we use y to represent the effective sales and w to be the number of
newspapers returned. Hence, the problem can be formulated as
min cx + Q(x)
s.t. 0 ≤ x ≤ u,
where Q(x) = Eξ Q(x, ξ), and
Q(x, ξ) = min − qy(ξ) − rw(ξ)
s.t. y(ξ) ≤ ξ,
y(ξ) + w(ξ) ≤ x,
y(ξ), w(ξ) ≥ 0.
It is easy to see that the optimal solutions are y ∗ (ξ) = min(ξ, x) and w∗ (ξ) = max(x−ξ, 0). Therefore,
the second stage expected value function is
Q(x) =Eξ [−q min(ξ, x) − r max(x − ξ, 0)]
Z x Z ∞
= (−qξ − r(x − ξ))dF (ξ) + −qxdF (ξ)
−∞ x
Z x
= − (q − r) ξdF (ξ) − rxF (ξ) − qx(1 − F (x)).
−∞

Since Q(x) is convex and differentiable when ξ is a continuous random variable, the optimal x mush
satisfy  ∗
 x =0 if c + Q0 (0) > 0,
x∗ = u if c + Q0 (u) < 0,

c + Q0 (x∗ ) = 0 otherwise.

Integrating by parts, we observe that


Z x Z x
ξdF (ξ) = xF (x) − F (ξ)dξ
−∞ −∞

(under some mild technical condition on F (ξ)). It follows that


Z x
Q(x) = −qx + (q − r) F (ξ)dξ.
−∞

We hence have
Q0 (x) = −q + (q − r)F (x).
Taking derivative of cx + Q(x) we get the optimal solution
 ∗
 x =0 if (q − c)/(q − r) < F (0),
x∗ = u ¡ if (q − c)/(q − r) > F (u),
 ∗ −1 q−c ¢
x =F q−r otherwise.

7
3 Financial Planning

To provide for a child’s college education Y years from now. We currently have $b to invest in any
of I investments. After Y years, we will have a wealth that we would like to have exceed a tuition
goal $G. Suppose we can change investments every v years, so we have Y /v investment periods. Now
suppose exceeding $G would be equivalent to having an income of q% of the excess, while not meeting
the goal would lead to borrowing for a cost r% of the amount short. The return of each investment on
each period is random. We observe the return of each past period, but can not anticipate. Let I = 2
including a stock and a government security. Y = 15 and v = 5. Therefore we have 3 investment
periods. Assume we have 8 possible scenario: independent, equal likelihood of having one of the two
cases in each period :(1) 1.25 for stock and 1.14 for bound; (2) 1.06 for stock and 1.12 for bond. We
have the following program:
X X ¡
Maximize: ··· p(s1 , · · · , sH ) − rw(s1 , · · · , sH ) + gy(s1 , · · · , sH ))
sH s1
X
s.t. x(i, 1) = b
i
X X
−ξ(i, t − 1, s1, · · · , st−1 )x(i, t − 1, s1 , · · · , st−2 ) + x(i, t, s1, · · · , st−1 ) = 0,
i i
t = 2, · · · , H; ∀(s1 , · · · , st−1 );
X
−ξ(i, H, s1, · · · , sH )x(i, H, s1 , · · · , sH−1 ) − y(s1 , · · · , sH ) + w(s1 , · · · , sH ) = G
i
∀(s1 , · · · , sH ).

Let b = 55000, G = 80000, q = 1, r = 4. The resulting optimal expected value is −1.52. If we


used the expected parameter everywhere, we get a solution which invest everything in stocks in each
period, and having an expected utility −3.79. The VSS is 2.27 in this case. Besides, the probability
of achieving the goal for the stochastic formulation is 87.5% and for the expected parameter approach
is 50%.

You might also like