Sie sind auf Seite 1von 4

THE UNIVERSITY OF NEW SOUTH WALES

SCHOOL OF MATHEMATICS AND STATISTICS

MATH3161 OPTIMIZATION Session 1, 2018

ASSIGNMENT
Your answers to this assignment must be given to your MATH3161 tutor in your week 13
MATH3161 tutorial.
Late assignments will not be accepted except on documented medical or compassionate grounds.
Assignments must include a signed cover sheet available from the School of Mathematics and
Statistics web site at:

http://www.maths.unsw.edu.au/sites/default/files/assignment.pdf

Marking of this Assignment


Each question on this assignment is worth 16 marks. A full mark of 32 on this
assignment is worth 8% of the total marks for MATH3161. Present your work as a self
contained, well-written report including the problem statement, solution summary,
model formulation, definition of problem variables and your computer output. State
clearly the assumptions that you make. Any Matlab files that you modify/write
should be included as an appendix.
1. Minimum Cost Pizza Problem. Using only the items given in the tables below, create
a minimum cost pizza which satisfies both the nutritional requirements of Table 1 and bounds on
item quantities given in Table 2. Use the nutritional data of Table 3 and the cost data of Table 4
in your model.
Use the MATLAB linear optimization routines linprog to solve the problem. Interpret your
results.
Table 1

Nutrient Requirement Units

Calcium 750.0 mg
Iron 12.0 mg
Protein 48.5 gram
Vitamin A 4500.0 IU
Thiamine 1.3 mg
Niacin 16.0 mg
Riboflavin 1.6 mg
Vitamin C 30.0 mg

1
Table 2
UPPER AND LOWER BOUNDS ON PIZZA ITEMS

Item Upper Bounds* Lower Bound*


Sauce 1.986 1.135
dough 5.249 4.256
cheese 2.270 1.703
pepperoni 0.993 N/A
ham 1.135 N/A
bacon 0.993 N/A
g.pepper 1.561 N/A
onion 0.993 N/A
celery 1.561 N/A
mushroom 1.135 N/A
tomato 1.703 N/A
pineapple 1.703 N/A
meat N/A 0.993
veg. N/A 0.993
fungi N/A 0.922

* Amount in hundreds of grams.

Table 3
NUTRITIONAL DECOMPOSITION OF PIZZA ITEMS*

Item Calc Iron Prot Vit A Thia Niac Ribo Vit C


cheese 517.700 .222 20.000 3000.000 .022 6.000 .244 -
Sauce 14.000 1.800 2.000 800.000 0.100 1.400 .060 6.000
dough 18.233 3.826 14.224 - .586 8.852 .628 -
pepperoni 10.000 2.500 15.000 - - 2.000 - -
ham 9.031 2.291 14.692 - .740 4.009 0.178 -
bacon 13.000 1.189 8.392 - .361 1.828 .114 -
g.pepper 9.459 .675 1.351 209.460 .081 .540 .081 127.030
onion 27.273 .545 1.818 18.182 .363 .545 .036 10.000
celery 40.000 .250 - 125.000 .025 .500 .025 10.000
mushroom 6.000 .800 3.000 - .100 4.300 .460 3.000
tomato 13.333 .533 1.333 450.000 .066 .800 .04 22.667
pineapple 12.016 .310 .387 25.194 .081 .193 .019 6.977

* Units as in Table 1

2
Table 4
COSTS OF PIZZA ITEMS
Item Cost in cents/100 grams

cheese 46.60
sauce 35.24
dough 9.63
pepperoni 44.11
ham 44.05
bacon 44.27
green pepper 25.10
onion 5.33
celery 14.14
mushrooms 31.20
tomatoes 22.03
pineapple 25.98

2. Portfolio Selection Problem. An individual with $10,000 to invest has identified three
mutual funds as attractive opportunities. Over the last five years, dividend payments (in cents per
dollar invested) have been as shown in Table 5, and the individual assumes that these payments are
indicative of what can be expected in the future. This particular individual has two requirements:
(1) the combined expected yearly return from his/her investments must be no less than $800 (the
amount $10,000 would earn at 8 percent interest) and (2) the variance in future, yearly, dividend
payments should be as small as possible. How much should this individual invest in each fund to
achieve these requirements?

Table 5
Years
1 2 3 4 5
Investment 1 10 4 12 13 6
Investment 2 6 9 6 5 9
Investment 3 17 1 11 19 2
[Hint: Let xi (i = 1, 2, 3) designate the amount of funds to be allocated to investment i, and let
xik denote the return per dollar invested from investment i during the kth time period in the past
(k = 1, 2, . . . , 5). If the past history of payments is indicative of future performance, the expected
return per dollar from investment i is
5
1X
Ei = xik .
5
k=1

The variance in future payments can be expressed as


3 X
X 3
2
f (x1 , x2 , x3 ) = σij xi xj = xT Cx,
i=1 j=1

where the covariances 2


σij are given by
5 5 5
! !
2 1X 1 X X
σij = xik xjk − 2 xik xjk . ]
5 5
k=1 k=1 k=1

3
2 ].
(a) Use the following table to calculate the covariance matrix C = [σij
Table 6

k x1k x2k x3k x21k x22k x23k x1k x2 x1k x3 x2k x3


k k k
1 10 6 17 100 36 289 60 170 102
2 4 9 1 16 81 1 36 4 9
3 12 6 11 144 36 121 72 132 66
4 13 5 19 169 25 361 65 247 95
5 6 9 2 36 81 4 54 12 18
total 45 35 50 465 259 776 287 565 290

(b) Set up a quadratic programming problem that will determine the best investment mix.
(c) Solve the problem using the MATLAB quadratic programming routine quadprog. Interpret
your results.

NOTES: Essential information for accessing files from the MATH3161/MATH5165 Course Web
page and for using Matlab.
• Matlab M-files can be obtained from Matlab Worksheets in Class Resources at the Course
Web-page, UNSW Moodle. The Matlab files for Q1, Problem Sheet-1 (ss18.m) and for Q2,
Problem Sheet-6 (qp18.m) are available at this page in the assignment folder.
• Matlab is run by typing
matlab
at the UNIX prompt. Inside Matlab use ‘help command’ to get help,
e.g.
help optim
help linprog
help quadprog

• To run a Matlab .m file from within Matlab simply type the name of the file:
ss18
This assumes the file ss18.m is in the current directory (use the UNIX command ‘ls’ to see
what files you have; if it is not there get a copy of the file from Matlab worksheets page at
the Course Web page and save it as ss18.m).
• An entire Matlab session, or a part of one, can be recorded in a user-editable file, by means
of the diary command. The recording is terminated by the command diary off. A copy of
the output produced by Matlab can be stored in the file ‘ss18.out’ by typing diary ss18.out
For example
diary ss18.txt
ss18
diary off
will save a copy of all output in the file ss18.txt
• The file ss18.out may be viewed using ‘more’ or any text editor (xedit, vi) or printed using
the ‘lpr’ command.

Das könnte Ihnen auch gefallen