Docsity

Farmer - System Analysis - Exam, Exams of System Analysis and Design

Toggle sidebar
bg1
CE191 Midterm
10/24/2011
1
1. (15 points) Formulate the following problem as a linear program. Your inequalities
should be preceded by a definition of the variables in clear concise English.
Suppose that a farmer has a piece of farm land, say L km2, to be planted with either wheat
or barley or some combination of the two. The farmer has a limited amount of fertilizer,
F kilograms, and insecticide, P kilograms. Every square kilometer of wheat requires F1
kilograms of fertilizer, and P1 kilograms of insecticide, while every square kilometer of
barley requires F2 kilograms of fertilizer, and P2 kilograms of insecticide. Let S1 be the
selling price of wheat per square kilometer, and S2 be the price of barley. How many
square kilometers of the area of land should the farmer plant with wheat and barley in
order to maximize the profit?
Solution:
If we denote the area of land planted with wheat and barley by x1 and x2 respectively, this
problem can be formulated as:
max S1x1 + S2x2 – F1x1 – F2x2 – P1x1 – P2x2 (maximize the profit)
s.t. 0 ≤ x1 + x2 ≤ L (limit on total area)
0 ≤ F
1
x
1
+ F
2
x
2
≤ F
(limit on fertilizer)
0 ≤ P
1
x
1
+ P
2
x
2
≤ P
(limit on insecticide)
x
1
≥ 0, x
2
≥ 0
(cannot plant a negative area).
2. (15 points) Formulate the Knapsack Problem.
Solution:
We have n kinds of items, 1 through n. Each kind of item i has a value vi and a weight wi.
Assume that all values and weights are nonnegative. The maximum weight that we can
carry in the bag is W.
Let xi be the decision variable whether the ith item is chosen (xi = 1) or not (xi = 0). The
knapsack problem can be formulated as:
ma
x
s.t.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Farmer - System Analysis - Exam and more Exams System Analysis and Design in PDF only on Docsity!

1. (15 points) Formulate the following problem as a linear program. Your inequalities should be preceded by a definition of the variables in clear concise English.

Suppose that a farmer has a piece of farm land, say L km^2 , to be planted with either wheat or barley or some combination of the two. The farmer has a limited amount of fertilizer, F kilograms, and insecticide, P kilograms. Every square kilometer of wheat requires F 1 kilograms of fertilizer, and P 1 kilograms of insecticide, while every square kilometer of barley requires F 2 kilograms of fertilizer, and P 2 kilograms of insecticide. Let S 1 be the selling price of wheat per square kilometer, and S 2 be the price of barley. How many square kilometers of the area of land should the farmer plant with wheat and barley in order to maximize the profit?

Solution:

If we denote the area of land planted with wheat and barley by x 1 and x 2 respectively, this problem can be formulated as:

max S 1 x 1 + S 2 x 2 – F 1 x 1 – F 2 x 2 – P 1 x 1 – P 2 x 2 (maximize the profit)

s.t. 0 ≤ x 1 + x 2 ≤ L (limit on total area)

0 ≤ F 1 x 1 + F 2 x 2 ≤ F (limit on fertilizer)

0 ≤ P 1 x 1 + P 2 x 2 ≤ P (limit on insecticide)

x 1 ≥ 0, x 2 ≥ 0 (cannot plant a negative area).

2. (15 points) Formulate the Knapsack Problem.

Solution:

We have n kinds of items, 1 through n. Each kind of item i has a value v (^) i and a weight wi. Assume that all values and weights are nonnegative. The maximum weight that we can carry in the bag is W.

Let x (^) i be the decision variable whether the i th^ item is chosen ( xi = 1) or not ( x (^) i = 0). The knapsack problem can be formulated as:

max

s.t.

x

3. (50 points) Consider the following linear programming problem P1: max s. t.

J = − x 1 − 4 x 2 x 2 ≥ x 1 + 1

P1:

x 2 ≥ − x 1 + 3 x 2 ≤ 6 x 2 ≥ 0 x 1 ≤ 10

3.1. (10 points) Solve this problem graphically in Figure 1. Give the optimal cost as well as the point ( x 1 , x 2 ) at which it is obtained.

7 6 5 4 3 2 1 0

-4 -2 0 2 4 6 8 10 x

Figure 1

(Please look at “MidtermSolu3.1”, found below)

3.4. (10 points) Shade in Figure 2 the feasible set of the MILP P3 in 3.3:

x

7 6 5 4 3 2 1 0

-4 -2 0 2 4 6 8 10 x

Figure 2

(Please look at “MidtermSolu3.4,” found below)

x

3.5. (10 points) Solve the MILP P3 in 3.3. Explain your reasoning, you can illustrate on Figure 3.

7 6 5 4 3 2 1 0

-4 -2 0 2 4 6 8 10 x

Figure 3

(Please look at “MidtermSolu3.5,” found below )

Change variable back, so the maximum is 1, which is obtained at

⎢ (^) ( 2 k + (^1) )θ (^) ( 2 k + (^1) )θ ⎢ (^) π ⎢ cos^ +^ 3,^ sin^ +^2 ⎢ , where k = 0, 1, 2, ..., 7, and^ θ^ =^. ⎢ 2 2 ⎢ 4 Numerically, they are (3.9239, 2.3827) (3.3827, 2.9239) (2.6173, 2.9239) (2.0761, 2.3827) (2.0761, 1.6173) (2.6173, 1.0761) (3.3827, 1.0761) (3.9239, 1.6173)

10/24/

3. (50 points) Consider the following linear programming problem PI: max J =-xi 4x:

S.t. ;::: XI + 1

X (^) " > + PI: .r" S 6 ;::: XI s 10

3.1. (10 points) Solve this problem graphically in Figure 1. Give the optimal cost as well as the point (XI ,x::) at which it is obtained.

I

6 5·

4

3 C\Jx (^2)

1 c-

O

I

I S'J I.(.1 (

f

i "^ , \I 4-. I_

, - -4)

  • _ ....1... -4 -2 o 2 4 6 8 10 x Figure]

L' f 1 \ 'Y"\ Cl ( <' I + __ ')

(1 (^) )


J

6

7

10/

3.5. (10 points) Solve the MILP P3 in 3.3. Explain your reasoning, you can illustrate on Figure 3.

6 iI 7, /,' /'

" ,:, (/

'.< /

3^ ( lV,^ ,r,^ .?,)'~^ ,I^

(-z.., ~^ )

C\J x 2

I

~1 :. ~Le''~t: ,^1 ,.+)

0 -1 ,

i

-. I "-- .....-~ -4 -2 0 2 4 6 8 10 x Figure 3

c, I . (^) Ii JILl) ') c·, ,,," '.. '1 .' ,

  1. Q 'v 1\ 1-/'v~ - - ..L• .i I

.\ , i.">

_. -/-'' )

: ~t^ L'^ ..J.....^ Cft'l",l..tC(^ L~^ C;^ t^ '-'^ .;^ ^ ')^ i^ ,"'>^ '>

i [kl^ I^ ilL(^ l-<,^ --I^

-,

-,

ti ,.^ ') 1,-"^ )^ C(" ~ I \ l' t( LI, 1''(^ ':(. I... {^ 2. - - ~) cf -. i