Sei sulla pagina 1di 8

CO 250 Assignment 1 Spring 2016

Solutions

Problem 1: Linear Algebra Review


Parts (a),(b),(c) each have a statement. Either prove that the statement is true, or provide a counterexample that shows that the statement is false.
(a) (True/False) Let v, w be vectors such that v w holds, and let x, y be vectors such that x y
holds. Then v + x w + y holds.
Solution: TRUE. For every coordinate j we have vj wj and xj yj , and this implies vj + xj
wj + yj . Hence, v + x w + y holds.
(b) (True/False) Let A be an m n matrix and let y Rm be a non-zero vector such that y T A = 0
(y T A is the zero vector in Rn ). Then the columns of A are linearly dependent.
 
 
1
1
. Then y T A = 0. However, since A has only one
and y :=
Solution: FALSE. Let A :=
1
1
column, and it is non-zero, the columns of A are not linearly dependent.
(c) (True/False) Let A be a 3 2 matrix, let b R3 be a vector, and suppose that Ax = b has a
unique solution. Let d R3 be another vector. Then Ax = d has a unique solution.

1 0
Solution: FALSE. Consider A = 0 1, b = [1, 0, 0]T and d = [0, 0, 1]T .
0 0
(d) Consider the system of equations Ax = b, where A is an m n matrix and b Rm is a vector.
Suppose there exists a vector y (of the appropriate dimension) such that y T A = 0 and y T b 6= 0.
Prove: Then Ax = b has no solution.
(Note: Such a vector y is called a certificate of infeasibility for Ax = b.)
Solution: PROOF: By way of contradiction, suppose that x satisfies Ax = b. Then, (left)
multiplying both sides by y T , we get y T Ax = y T b. Moreover, the LHS is zero, because (y T A)x =
[0, . . . , 0]x = 0, whereas the RHS is nonzero. Thus, we get a contradiction (0 = y T b 6= 0), and hence,
we conclude that there is no solution for Ax = b.

4 7 7 9
10
(e) Let A = 3 5 4 5 , and let b = 7 .
2 4 6 8
4
Use the vector y = [2, 2, 1]T to show that there is no solution for the system of equations Ax = b.
Solution: See the solution to part (d). The system Ax = b is infeasible; the vector y = [2, 2, 1]T is
a certificate of infeasibility because y T A = [0, 0, 0, 0] whereas y T b = 20 + 14 + 4 = 2 6= 0.
Marking Comments: [ TOTAL: 10 POINTS
(+2) Each question.
Zero points if no justification given.
]
1

Problem 2: LP formulations WatWood


WatWood produces dolls, toy cars, and toy trains. Producing each of these three products uses two
resources, namely, wood and skilled labour. The resource requirements and the selling price for an
unfinished unit of each of the products are given in the following table:

Product
Cars
Dolls
Trains

Resources
Wood (square ft) Skilled
20
40
80

Selling Price ($)


Labour (h)
2
3
4

100
150
200

Wood may be purchased at a cost of $1 per square ft, and 10,000 square ft of wood are available for
purchase. A total of 5,000h of skilled labour are available (and have already been paid for).
WatWood also has the option to finish an unfinished product. The finishing process requires skilled
labour. The following table lists the number of additional hours of skilled labour needed to finish an
unfinished product, as well the selling price for each finished product:
Product
Cars
Dolls
Trains

Skilled labour for finishing (h)


5
6
7

Selling Price ($)


300
310
320

Formulate an LP (linear program) that can be used to find a profit-maximizing production plan for
WatWood.
Solution:
Introduce variables x1 , x2 and x3 for the number of unfinished cars, dolls, and trains to be produced.
Let y1 , y2 and y3 be variables for the number of finished cars, dolls, and trains, respectively. Let w be a
variable for the total number of square ft of wood needed in production. The LP is

max
s.t.

100(x1 y1 ) + 150(x2 y2 ) + 200(x3 y3 ) + 300y1 + 310y2 + 320y3 w


2x1 + 3x2 + 4x3 + 5y1 + 6y2 + 7y3 5000
w = 20x1 + 40x2 + 80x3
w 10, 000
y1 x 1 ,

y2 x2 ,

y3 x3

x1 , x2 , x3 , y1 , y2 , y3 , w 0
Marking Comments: [TOTAL: 10 POINTS
1. (+4) If the objective function is correct.
2. (+2)3 If each constraint (Skilled hours, amount of wood and non-negativity ) is correct.
]

Problem 3: LP Formulations CrudeCo


CrudeCo produces crude oil at three oil wells and ships it to three customers. The production cost per
ton of the crude oil, and the production capacity in tons for each oil well are as follows:
Oil well
1
2
3

Production cost ($)


50
60
70

Capacity (t)
120
130
140

CrudeCo has 3 customers, and each has a demand for a certain number of tons of crude oil:
Customer 1
100

Customer 2
50

Customer 3
200

The cost of shipping a ton of crude oil from an oil well to each customer is given in the following table:

Oil well
1
2
3

Customers
1 2
3
5 8 11
6 9 12
7 10 13

Formulate an LP that minimizes the cost of meeting customer demands subject to the other requirements.
Solution:
Let xij represent the amount of crude-oil shipped in tons from oil-well i {1, 2, 3} to customer j
{1, 2, 3}. The constraints are similar to the constraints of the transportation model; we have a demand
constraint for each of the three customers, and we have a capacity constraint for each of the three
oil-wells; we have the non-negativity constraints. In the objective function, we have terms for the shipping
costs (similar to the transportation model), and in addition, we have terms for the production cost at
the three oil-wells.
min

50(x11 + x12 + x13 ) + 60(x21 + x22 + x23 ) + 70(x31 + x32 + x33 )


+ 5x11 + 6x21 + 7x31 + 8x12 + 9x22 + 10x32 + 11x13 + 12x23 + 13x33

s.t. x11 + x21 + x31 = 100

(customer demand)

x12 + x22 + x32 = 50


x13 + x23 + x33 = 200
x11 + x12 + x13 120

(capacity)

x21 + x22 + x23 130


x31 + x32 + x33 140
x11 , x12 , x13 , x21 , x22 , x23 , x31 , x32 , x33 0.
3

Compact solution: We can rewrite this LP compactly by introducing notation for the data in the
problem. Let pi , i {1, 2, 3} denote the production cost at oil-well i, let ui , i {1, 2, 3} denote the
production capacity at oil-well i, let dj , j {1, 2, 3} denote the demand of customer j, and let cij , i
{1, 2, 3}, j {1, 2, 3} denote shipping cost from oil-well i to customer j. Then the LP is:

min

3
X
i=1

s.t.

3
X
i=1
3
X

3
3 X
3
X
X
pi (
xij ) +
cij xij
j=1

i=1 j=1

xij = dj ,

j {1, 2, 3}

(customer demand)

xij ui ,

i {1, 2, 3}

(capacity)

j=1

xij

0,

i {1, 2, 3}, j {1, 2, 3}

Marking Comments: [TOTAL: 10 POINTS


(+2) If the objective function is correct.
(+4) If the constraints associated with customer demand are correct.
(+4) If the capacity and non-negativity constraints are correct.
]

Problem 4: LP Formulations EZ-Treats


EZ-Treats, a reputed confectioner, is planning the production and sales of Choco-bars and Gobeclairs over
the next 4 months. Choco-bars and Gobeclairs require a secret ingredient as well as cocoa-gunk. Each
Choco-bar requires 5 units of the secret ingredient and 7 units of cocoa-gunk. Each Gobeclair requires 12
units of the secret ingredient and 17 units of cocoa-gunk. Every month, EZ-Treats has 5000 units of the
secret ingredient available and 5000 units of cocoa-gunk.
The maximum amount of Choco-bars and Gobeclairs that can be sold over the next four months are
estimated to be:
Month 1 Month 2 Month 3 Month 4
Choco-bars
100
300
230
200
Gobeclairs
150
200
100
400
The profit of selling Choco-bars and Gobeclairs is, respectively, $2 and $3 per unit.
Both products can be stored from one month to the next month by paying a price of $0.10 per unit.
Initially, (at the beginning of Month 1) there are no products in storage.
(a) Formulate an LP that EZ-Treats can use to maximize profit over the next 4 months.
(b) Now, suppose that every month, EZ-Treats can dedicate up to 1000 units of the secret ingredient
(out of the 5000 available) to producing an extra amount of cocoa-gunk. Each unit of the secret
ingredient is capable of producing one extra unit of the cocoa-gunk.
Modify your LP formulation (from part (a)) to handle the new requirements. Explain all new
variables and all new constraints.
Solution:
(a) To formulate the LP, assign the index 1 to Choco-bars and the index 2 to Gobeclairs.
We define the following variables:
xij , i {1, 2}, j {1, . . . , 4}: amount of product i produced in month j.
yij , i {1, 2}, j {1, . . . , 4}: amount of product i sold in month j.
zij , i {1, 2}, j {0, . . . , 4}: amount of product i left in stock from month j to j + 1.
We can also define some notation to denote the data given in the problem:
uij , i {1, 2}, j {1, . . . , 4}: maximum amount of product i that can be sold in month j.
P
P
P P
The objective function is 2 4j=1 y1j + 3 4j=1 y2j 0.1 2i=1 4j=1 zij .
For the constraints, by the table, we have upper bounds on the amount that can be sold, and on the
amount that can be produced, thus,
yij uij ,

i {1, 2}, j {1, . . . , 4},

(1)

Secret ingredient: 5x1j + 12x2j 5000, j {1, . . . , 4},

(2)

Cocoa-gunk:

7x1j + 17x2j 5000, j {1, . . . , 4}.

We must add some constraints to handle the amount in storage. The amount at the end of month
j 1 plus the amount produced in month j must be equal to the amount that is sold in month j plus
what is left in storage at the end of month j. Thus,
zi,j1 + xij = zij + yij ,

i {1, 2}, j {1, . . . , 4},


5

(3)

We also need constraints for the initial amount in storage, and non-negativity:
zi,0 = 0 i {1, 2},

(4)

x, y, z 0

(5)

Our final LP is:


max

4
X

y1j + 3

j=1

4
X

y2j 0.1

j=1

2 X
4
X

zij

i=1 j=1

constraints (1) (5)

s.t.

(b) For each month j, j {1, 2, 3, 4}, let the variable sj denote the amount of secret ingredient that is
transformed into cocoa-gunk.
Then we have new constraints
sj 1000,

j {1, . . . , 4}.

(6)

Moreover, the resource constraints in the above LP (in part(a)) are modified as follows:

Secret ingredient: 5x1j + 12x2j 5000 sj , j {1, . . . , 4},


Cocoa-gunk:

7x1j + 17x2j 5000 + sj , j {1, . . . , 4}.

Marking Comments: [TOTAL: 15 POINTS


(a)

(+3) If the objective function is correct.


(+2) If the constraints related to the stock of cocoa-gunk and secret ingredient are correct.
(+5) If the constraint related to the handling of stored items is correct.
(+2) Constraints on initial stock and non-negativity.

(b) (+3) For correct constraints.


]

(7)

Problem 5: LP Formulations WatPOST


Waterloo post office requires at least the following number of workers on the different days of the week.
(The post office can operate with more than the required number of workers, but cannot operate with
less.)
Day
Mon Tue Wed Thu Fri Sat Sun
Number of workers
11
12
13
14
5
6
7
(a) The post-office may hire regular workers, who work for 5 consecutive days and take the next two days
off. The cost of hiring a regular worker is $200 (for 5 days on, 2 days off).
Formulate an LP to find a schedule (that is, how many regular workers should start working on each
day of the week) that meets the post-offices requirements and minimizes its total cost.
(b) In this part, suppose that the post-office may hire two types of workers:
(i) regular workers, who work for 5 consecutive days and take the next two days off,
(ii) temp workers, who are available on a daily contract every day of the week.
The cost of hiring a regular worker is $200 (for 5 days), and the cost of hiring a temp worker is $50
per day for MonFri and $30 per day for SatSun.
The rest of the data is the same as in part (a). Formulate an LP to find a schedule (that is, how
many regular workers, and how many temp workers should start working on each day of the week)
that meets the post-offices requirements and minimizes its total cost.
Solution:
(a) Introduce a variable xi for i {1, . . . , 7} that denotes the number of workers who start work on day
i of the week, where Monday is day 1 and Sunday is day 7. A worker that starts work on day i of
the week will work on that day together with the next four days, and then take the next two days
off. Since the goal is to minimize the cost of hiring the workers, the objective function is
min

7
X

200xi .

i=1

We now need to ensure that there are enough workers for each day of the week. We start with
Mondays. A worker will work on Mondays if he starts work on Thu, Fri, Sat, Sun or Mon. Therefore
the constraint for Mondays reads as follows
x4 + x5 + x6 + x7 + x1 11
A worker will work on Tuesdays if he starts work on Fri, Sat, Sun, Mon or Tue. Therefore the
constraint for Tuesdays reads as follows
x5 + x6 + x7 + x1 + x2 12

Completing the constraints for the remaining days of the week similarly, we arrive at the following
LP
7
X

min

200xi

i=1

x4 + x5 + x6 + x7 + x1 11

st

x5 + x6 + x7 + x1 + x2 12
x6 + x7 + x1 + x2 + x3 13
x7 + x1 + x2 + x3 + x4 14
x1 + x2 + x3 + x4 + x5 5
x2 + x3 + x4 + x5 + x6 6
x3 + x4 + x5 + x6 + x7 7
x 0.
(b) Introduce additional variables wi for i {1, . . . , 7}, that denote the number of daily contract workers
who start work on day i of the week. Incorporating the cost of hiring the temp workers we obtain
the new objective function

min

7
X

200xi +

5
X

i=1

50wi +

i=1

7
X

30wi

i=6

The workers that are now working on Mondays are the following
regular workers who start work on Thu, Fri, Sat, Sun or Mon
temp workers who are hired to work on Mondays
Therefore the new constraint for Mondays becomes
x4 + x5 + x6 + x7 + x1 + w1 11
Completing the constraints for the remaining days of the week similarly, we arrive at the new LP
min

7
X

200xi +

i=1

st

5
X
i=1

50wi +

7
X

30wi

i=6

x4 + x5 + x6 + x7 + x1 + w1 11
x5 + x6 + x7 + x1 + x2 + w2 12
x6 + x7 + x1 + x2 + x3 + w3 13
x7 + x1 + x2 + x3 + x4 + w4 14
x 1 + x 2 + x 3 + x 4 + x 5 + w5 5
x2 + x3 + x4 + x5 + x6 + w6 6
x3 + x4 + x5 + x6 + x7 + w8 7
x 0.

Marking Comments: [NOT GRADED.]

Potrebbero piacerti anche