Test 1, Group

advertisement
Test 1, Group
Name
SA305 Spring 2013
Directions: EVERY response you provide on this test MUST BE JUSTIFIED! Write clearly, points will be
taken off for poorly written solutions or arguments. Partial credit will be awarded, the amount for each problem is
listed next to its number, and the total points possible is 100.
1. (25 pts) You are consulting for the Perfect Stack Company, which builds two types of wooden bookcases:
standard and deluxe. The bookcases are assembled from three components: regular shelves, long shelves, and side
pieces. Each standard bookcase consists of 3 regular shelves and 4 side pieces, and takes 0.25 hours to assemble.
Each deluxe bookcase consists of 5 long shelves and 8 side pieces, and takes 0.30 hours to assemble. The
components need to be fabricated before being used to assemble a bookcase: it takes 0.005 hours to fabricate a
regular shelf, 0.007 hours to fabricate a long shelf, and 0.002 hours to fabricate a side piece. Perfect Stack has 200
hours of assembly time and 40 hours of fabrication time available. Standard bookcases are sold at a profit of $5
each, and deluxe bookcases are sold at a profit of $7 each. Perfect Stack would like to maximize its profits,
assuming all bookcases assembled are sold. Write a linear program for this problem, ignoring integrality concerns.
(You do not need to write the ampl scripts.)
Let
xs = (number of standard book cases built)
xd = (number of delux book cases built).
The objective function is
5xs + 7xd .
The assembly constraint is
.25xs + .3xd ≤ 200.
The fabrication constraint is
.005(3xs ) + .007(5xd ) + .002(4xs + 8xd ) ≤ 40.
Plus nonnegativity. So the LP is
max
subject to
5xs + 7xd
∀i ∈ {1, 2}, xi ≥ 0
.25xs + .3xd ≤ 200
.005(3xs ) + .007(5xd ) + .002(4xs + 8xd ) ≤ 40
2. (20 pts) The Hessian Hat Company must decide how to send bowler hats from its set of factories F = {A, B, C}
to its set of retailers R = {1, 2, . . . , 10}. Each factory i ∈ F has a supply of si hats, and each retailer j ∈ R has a
demand of dj hats. It costs cij to send one hat from factory i to retailer j, for all i ∈ F and j ∈ R.
Define the decision variables
xij = number of hats sent from factory i to retailer j
for i ∈ F and j ∈ R.
Using the sets, parameters, and variables defined above, formulate a linear constraint for each of the following
requirements as compactly as possible using mathematical notation, using summation notation and ‘for all’
statements if necessary.
a. (5 pts) The number of hats sent from factory B cannot exceed the supply available at factory B.
X
xBj ≤ sB
j∈R
b. (5 pts) The number of hats sent to each retailer should equal the demand at that retailer.
X
∀j ∈ R,
xij = dj
i∈F
c. (5 pts) The cost of sending hats from each factory cannot exceed 5000.
X
∀i ∈ F,
cij xij ≤ 5000
j∈R
(5 pts) Then write the objective function that minimizes cost, again as compactly as possible using mathematical
notation.
X
cij xij
i∈F
j∈R
Answers in RED
3. Multiple choice 2 pts each. Circle all choices (a, b, etc.) that can be answers.
y
3x + y = 4
4
3
x + 2y = 4
2
1
B
C
−x + 2y = 1
x
D
A
1
2
3
4
I. Which region is the feasible region for the constraints that include nonegativity and
x + 2y ≤ 4
3x + y ≥ 4
2y − x ≥ 1
(a) A
(b) B
(c) C
(d) D
(e) both B and C
(f) both A and D
(g) none of the above
II. If the feasible region is D and the objective function is
3x + 6y
then which points are optimal solutions:
(a) (1,1)
(b) (1.3,0)
(c) (4,0)
(d) (1.5,1.25)
(e) non of the above
(f) all points on the line −x + 2y = 1
(g) all points on the line x + 2y = 4
III. Which of the following constraints when added to
x + 2y ≤ 4
2y − x ≤ 1
would create an infeasible problem?
(a) x ≤ y
(b) y = 1
(c) y − 13000000x ≥ 0
(d) x + y ≥ 4
(e) none of the above
(f) all of the above
(g) no constraint ever could make this an infeasible problem
IV. Suppose you are given the following constraints
a11 x1
a21 x1
a31 x1
a41 x1
+
+
+
+
a12 x2
a22 x2
a32 x2
a42 x2
+
+
+
+
a13 x3
a23 x3
a33 x3
a43 x3
≥ b1
≥ b2
≥ b3
≥ b4
Set S1 = {1, 2, 3, 4} and S2 = {1, 2, 3}. Which of the following correctly encodes these in mathematical language?
(a)
X
∀i ∈ S1 ,
aij xj ≥ bi
j∈S2
(b)
∀j ∈ S1 ,
X
aji xi ≤ bj
i∈S2
(c)
∀i ∈ S2 ,
X
aij xj ≥ bi
j∈S1
(d)
∀i ∈ S2 ,
X
aji xi ≥ bi
j∈S1
(e)
∀j ∈ S1 ,
X
i∈S2
(f) all of the above
(g) none of the above
aji xj ≥ bj
V. Suppose you want to put the constraints
5xA + 6xB + xC ≤ 25
2xA + 3xB + 4xC ≤ 100
into AMPL code. Which of the following will work?
(a)
in the .mod file
in the .dat file
set S;
param p {S};
param b {S};
var x {S};
subject to constraint
sum{j in S} p[j]*x[j] <= b[i];
(b)
in the .mod file
set S;
set T;
param p {S,T};
param b {T};
var x {S};
subject to constraint {i in T}:
sum{j in S} p[j,i]*x[j] <= b[i];
(c)
in the .mod file
set S;
set T;
param p {S,T};
param b {T};
var x {S};
subject to constraint {j in S}:
sum{i in T} p[i,j]*x[i] <= b[j];
(d)
in the .mod file
set S;
set T;
param p {S,T};
param b {T};
var x {S};
subject to constraint {j in T}:
sum{i in S} p[i,j]*x[i] <= b[j];
(e) none of the above
set S:= A B C;
param p : A B C :=
5 6 1
2 3 4 ;
param b :=25 100;
in the .dat file
set S:= A B C;
set T:= eq1 eq2;
param p : A B C :=
eq1 5 6 1
eq2 2 3 4 ;
param b :=25 100;
in the .dat file
set S:= A B C;
set T:= eq1 eq2;
param p : A B C :=
eq1 5 6 1
eq2 2 3 4 ;
param b :=25 100;
in the .dat file
set S:= A B C;
set T:= eq1 eq2;
param p : A B C :=
eq1 5 6 1
eq2 2 3 4 ;
param b :=25 100;
Download