Chap 49 Exercises
Loading webR...
Exercise 1 The figure shows a contour plot of an objective function
- Is the path in Plot 1 a gradient ascent, a gradient descent, or neither?
question id: ape-choose-closet-1
- Is the path in Plot 2 a gradient ascent, a gradient descent, or neither?
question id: ape-choose-closet-2
- Is the path in Plot 3 a gradient ascent, a gradient descent, or neither?
question id: ape-choose-closet-3
Exercise 2 The two panels below are each contour plots of the same objective function
Solution containing functions x(t), y(t).
Solution containing functions x(t), y(t).
Solution containing functions x(t), y(t).
A. In Plot A, is the path a gradient ascent, a gradient descent, or neither?
question id: ape-choose-closet2-A
B. In Plot B, is the path a gradient ascent, a gradient descent, or neither?
question id: ape-choose-closet2-B
Exercise 3 The plot shows an objective function (contours labeled in black) and a constraint function (in orange).
- What is the constrained argmax when the constraint level is at 600? (Bold orange line.)
600
1100
(x=4, y=24.5)
1150
other
question id: rat-find-magnet-1
- What is the value of the objective function at this argmax?
question id: rat-find-magnet-2
- What is the shadow price of an increase in the level of the constraint?
question id: rat-find-magnet-
Exercise 4 Here is the gradient field of an objective function.
Where is the argmax? (Pick the closest answer.)
(x = 0, y = 0)
(x = -0.8, y = 1)
(x = -1.5, y = 2)
Canβt tell from the graph.
question id: dolphin-hang-sheet
Exercise 5 The figure shows an objective function (contour plot) with two different constraints: an inequality constraint (satified outside the blue region), and an equality constraint (brown).
- What is the min of the objective function, ignoring the constraints? (Select the closest answer.)
question id: panda-go-kayak2-1
- What is the max of the objective function, ignoring the constraints?
question id: panda-go-kayak2-2
- What is the max of the objective function, subject only to the equality constraint? Is the equality constraint active?
max: 20, active
max: 23, active
max: 24, active
max: 20, not active
max: 23, not active
max: 24, not active
question id: panda-go-kayak2-3
- What is the max of the objective function, subject only to the inequality constraint? Is the constraint active?
max: 20, active
max: 23, active
max: 24, active
max: 20, not active
max: 23, not active
max: 24, not active
question id: panda-go-kayak2-4
- Subject to both the equality and the inequality constraints, what is the min of the objective function? Are both constraints active?
max: 20, only equality constraint is active
max: 23, only equality constraint is active
max: 24, only equality constraint is active
max: 20, both constraints are active
max: 23, both constraints are active
max: 24, both constraints are active
question id: panda-go-kayak2-5
Exercise 6 Based on an extensive but fictive observation of activity and grades of college students, the model shown in the figure was constructed to give GPA as a function of the number of hours each weekday (Monday-Friday) spent studying and spent in social activity and play. (Activity during the weekend was not monitored.)
Several points in the graphic frame have been marked with red letters. Refer to these letters when answering the following questions.
According to the model, whatβs the optimal combination of Study and Play to achieve a high GPA?
F
G
H
I
question id: snake-walk-knife2-1
Which of these letters marks a place on the graph where the partial derivative of GPA with respect to Play is positive?
B
C
K
L
question id: snake-walk-knife2-2
Which if these ketters marks a place on the graph where the partial derivative of GPA with respect to Play is negative.
A
F
H
K
question id: snake-walk-knife2-3
- Where is the partial derivative with respect to Study is negative?
Nowhere.
E
F
L
question id: snake-walk-knife2-4
Study and Play are not the only activities possible. Sleep is important, too, as are meals, personal care, etc. In the study, students were observed who spent up to 22 hours per day in Study or Play. Presumably, such students crashed on the weekend.
- Suppose you decide to budget 12 hours each weekday day in activities other than Study and Play. Which letter labels the constrained optimal mix (argmax) of Study and Play.
question id: snake-walk-knife2-5
- What is the βshadow priceβ of GPA with respect to the budget for a budget constraint of 12 hours? Give both an estimated numerical value as well as units.
-0.5 gradepoints/hour
0 gradepoints/hour
0.5 gradepoints/hour
1.0 gradepoints/hour
question id: snake-walk-knife2-6
- Consider a student who budgets 22 hours per day for Study and Play. Which letter is closest to the constrained argmax with a 22-hour constraint?
A
B
C
D
question id: snake-walk-knife2-7
- What is the βshadow priceβ of GPA with respect to the budget constraint of 22 hours? Give the estimated numerical value.
-0.5 gradepoints/hour
0 gradepoints/hour
0.5 gradepoints/hour
1.0 gradepoints/hour
question id: snake-walk-knife2-8
- Based on the shadow price from the previous question, which of these is the best advice to give the student (who seeks to maximize GPA)?
Itβs hopeless. There arenβt enough hours in the day for you to get a good GPA.
Youβve got to squeeze out more effort studying. Give it your all!
Play more, study less!
Study less
Study less, play less. Sleep!
question id: snake-walk-knife2-9
Exercise 7 Weβd like to make a folded cardboard box in the most efficient way possible. As you know, cardboard boxes have four sides as well as eight flaps, four for the top and four for the bottom. The flaps are arranged to provide double coverage; you fold the flaps from one direction and then fold over them the flaps from the other direction.
The diagram depicts the box sides and flaps laid out on a flat piece of cardboard. The flaps are shaded with diagonal lines.
Suppose the height, width, and depth of the box are
- Which of these formulas gives the area of the cardboard making up the box?
question id: duck-tell-laundry-1
A common size for a box is 1.3 cubic feet. We will use feet as the units for
- The following formulas do not describe the area of the cardboard, but they are nonetheless formulas for something. Except one of them, which cannot be true. Which one? (Hint: Think about dimension.)
question id: duck-tell-laundry-2
As
To complete the problem statement we need something else. Here, that something is a constraint: We demand that the box have a volume of
Often, a constraint plays the role of a dimension reduction. With
- Plug in the above expression for
into the formula for the surface area of cardboard. Which of the following is the resulting formula in terms of , , and ?
question id: duck-tell-laundry-3
Active R chunk 1 contains the formula for the surface area
There is a broad area near the center inside the contour at area = 9.5. Towards the upper-right and lower-left corners of the plot frame are contours at higher levels of area.
- The spacing between the contours in the corners is tight, but there is no similarly spaced contour inside the region delimited by the contour at area=9.5. Why not?
We didnβt ask for contours inside 9.5.
The function shape inside the 9.5 contour is the top of a bowl, so it is pretty flat.
The function shape inside the 9.5 contour is the bottom of a bowl, so it is pretty flat.
All the points inside the 9.5 contour are at the same height.
question id: duck-tell-laundry-4
Use Active R chunk 1 to place contours at 10, 9.5, 9.4. You can do this by replacing the argument contours_at = NULL
with this:
= c(10, 9.5, 9.4)) contours_at
Add more contours to build a fence tighter and tighter around the argmin. When the fenced region is tiny, you can read off the min from the contour label. (Remember, the βargminβ is the value of the inputs
- The following are values for the output of the function where you might be able to draw a contour. Which one of the values is the smallest for which a contour appears?
9.1
9.05
9.01
9.005
9.0005
9
question id: duck-tell-laundry-5
- From your contour plot, read off the values of
and that produce the minimum surface area for a 1.3 cubic-foot box. What are they? (Hint: You may need to zoom in on the domain to get the precision needed to answer the question.)
question id: duck-tell-laundry-6
It is easy enough for a person to look at a contour plot and roughly locate the argmin. But this is not feasible if there are more than two inputs to the function being optimized. For such functions, another set of numerical techniques are used based on the gradient of the objective function. Remember that the gradient at any point is a vector that points in the uphill direction and whose length is proportional to the steepness of the slope. (Skiers, beware. In skiing what people call the gradient is the steepest downhill direction. This might account for all the mathematicians learning to ski who point their skis uphill in response to the ski instructorβs instruction!)
You can display the gradient on the plot of the area function by piping (remember |>
) the contour plot into the commented-out command in the sandbox. (Also, replace # pipe to
with |>
.)
- Which of these best describes the gradient vector at the argmin?
The gradient points due North.
The length of the gradient vector is maximal.
The length of the gradient vector is minimal.
The length of the gradient vector is zero.
question id: duck-tell-laundry-7
Occasionally, particularly in textbook problems, the argmin or argmax is found algebraically. This still involves calculating the gradient, which will be a function of the input quantities. Then, find the inputs that make all the components of the gradient vector zero.
- Which of these formulas give the gradient vector of
?
question id: duck-tell-laundry-8
- If the lengths
, , are measured in feet, what unit will be in?
feet
square feet
cubic feet
1/feet
dimensionless
question id: duck-tell-laundry-9
For those of you who are pining for algebra problems, here you go.
Taking the gradient of
- Which of these is the correct formula for the optimal
as a function of ? (Hint: You can weed out one of the choices by checking for dimensional consistency.)
question id: duck-tell-laundry-10
The solution for
Now compute the formula for the optimal value
- Which of these is the correct formula for the optimal
as a function of ?
question id: duck-tell-laundry-11
It turns out that
- Which of these is an appropriate explanation for why
is larger than or ?
People donβt like using boxes that are perfect cubes.
The flaps need to get longer as
The flap-length does not depend on
question id: duck-tell-laundry-12
Exercise 8 In this exercise, you will work with an optimization problem. First, we will ask about a mathematical solution to the problem. Next, we will show that the mathematical solution is not necessarily the best real-world solution because of multiple objectives in decision making. Then we will show you a real-world decision-making rubric that is widely accepted, at least among people who listen to the whole story with an open mind.
The graph shows the estimated number of lives saved by three different health-care related interventions β A, B, C β as a function of the amount of money spent on each.
You have $1,000,000,000 to spend altogether on these interventions. Your policy alternatives are all the different combinations of spending on (A), (B), and (C) that add up to $1B (or less).
How should you split up the money among the interventions? For example, we could spend $125M on B, $125M on C, and $750M on A. This would save an estimated 346 lives. Can we do better?
Imagine that we use
- Suppose
, , and , where units are millions of dollars. It is suggested that reducing by $1M to increase by that amount will produce a better outcome in terms of the total number of lives saved. That is, move some money from intervention A to intervention C. Is this suggestion correct? Why or why not?
Not correct. The number of lives saved by spending $750M on A is larger than the number that would be saved by spending that much on B or C.
Not correct. We will want to move the money to B instead.
Correct. The derivative
Correct. We should spend equally on all three interventions. That is, set
question id: tp1-1
A general principle is this: If spending a little more on one intervention increases the output more than the loss due to spending less on another intervention, the shift in funding is worthwhile.
. If you follow the above logic, you will continue to move money from A to C until it is no longer beneficial to do so. What will be the maximum amount of spending on A makes it not worthwhile to move additional money from A to C? (Choose the closest answer.)
$ 250M
$ 375M
$ 500M
$ 625M
question id: tpt1-2
- Imagine that you have moved all the money from A to C that it is worthwhile to do . Which of these statements is true at those values
, ?
question id: tpt1-3
We found it worthwhile to move expenditure from A to C to optimize the sum of their outputs and are operating at about
- If we were going to move a small amount of money from A or C into B, would it be better to take the money from A or from C? Why?
Take it from A, since we are spending far more on A than C.
Take it from C, since we are already spending far less on C than on A.
Take it from C. The slope
Take it from A. The slope
question id: tpt1-4
- Right now in our process, we are planning to spend $125M on B. Is it worthwhile to move money from C to B?
No, the output of B larger than the output of C at $125M.
Yes, move most of the money from C to B.
Yes, but only move a little money from C to B.
No, move money from B to C.
question id: tpt1-5
- At the optimal amount of money
spent on B and spent on C, which of these is true about the slopes and ?
There is not any fixed relationship. They are what they are.
The two slopes are equal.
The slope of B is greater than the slope of C.
The slope of C is greater than the slope of B.
question id: tpt1-6
- Is it more proper to say the βslope
β rather than the βderivative ?β (This is a general review problem for the course, not something specifically about optimization.)
Yes. A derivative is a function while a slope is a quantity.
No. Slope and derivative are the same thing.
Yes. βDerivativeβ sounds fancier than βslopeβ.
No. Slopes measure steepness from right to left, while derivatives give steepness from left to right.
question id: tpt1-7
Background: The graphs are fictitious, but letβs pretend they are:
- A Surgical treatment of congenital heart defects in newborns.
- B Treatment for hemophilia.
- C Memory-care for people with Alzheimers.
Notice that the people being affected are in different, non-overlapping groups. So moving funding from one group to another is effectively βrobbing Peter to pay Paul.β If you, as a decision maker inherited a situation where
Probably, most people would decline to make a decision comparing two lives, for instance, saving a 10-year old versus saving a 90-year old. But it is not always possible to escape such trade-offs and the people who need to take the decision need guidance about what to do. In an open society, we expect such decisions to be backed by good rationale and so we have to develop means for distinguishing between better and worse rationales.
One example comes from epidemiology and the concept of a βquality-adjusted life yearβ (QALY). A QALY is a measure of duration of life adjusted for the health condition of the person β a year of a person in good health is 1 QALY, but a year in a person in very poor health is less than 1 QALY.
QALYs do not solve the problem of optimizing health-related outcomes. They are an imperfect means of dealing with an impossible problem. Sometimes that is the best we can do.
Exercise 10
Loading webR...
You are a member of a health-care oversight committee that allocates funds for investment in health-care facilities. The committee has two proposal before it and needs to decide how best to spend the available $50M budget:
- Proposal A: Expansion of the pediatric organ transplant unit.
- Proposal B: Creation of a new rehabilitation center for traumatic injury patients.
Experts have evaluated each proposal in terms of different cost options and the impact that each will have on health outcomes. Following a standard epidemiological method, the impact is estimated in terms of βQuality Adjusted Life-Yearsβ (QALY), a measure that combines the number of people affected, the number of years of prolonged life, and the improvement in quality of life for those treated.
The expert estimates are available in the data frame QALY_impact
:
QALY Impact of the Proposals
Such estimates from experts should be taken with a grain of salt, but they are often the best information you have to inform a model.
You can turn the expertβs opinions into functions by using splines. In this case, there is good reason to think that output will increase monotonically with expenditure, so a monotonic spline is a good choice. The continuous functions are created in Active R chunk 2:
The problem is to find the best values for expenditures on Proposal A and B β call these expenditures
A simple approach is to plot out the total benefit as a function of expenditures on each of A and B, as in Active R chunk 3:
How can you confirm that the red contours in the plot genuinely represent the budget constraint at the indicated level?
- Whatβs the largest number of QALYs that can be produced from combining the two proposals with a total budget of $50M?
question id: crow-trim-laundry-1
- What is the location of the argmax from Active R chunk 3?
question id: crow-trim-laundry-2
Another way to look at the problem is to find the total QALY outcome as a function of the amount
Changing the Budget
A broader social question is whether the budget is being set at an appropriate level. One way to examine this is to look at how the QALY outcome changes as the budget changes.
For this, we will find values of
The following graphic shows the difference
Yet another constraint!
- The American Association of Allergy Activists (AAAA) has lobbied Congress to mandate that, of the 50 units of available funds, funding for A must be
. How much would this constraint reduce the overall output for the two interventions combined? (Remember, if youβre spending, say, 45 on A, you cannot spend more than the remaining 5 on B.) The challenge for you in answering this question is to pick the appropriate one of the above graphs. Once you have done that, the answer is evident.
No reduction at all.
About 10-20 QALYs.
About 40-60 QALYs.
About 100-120 QALYs.
It would increase the output.
question id: crow-trim-laundry-3
Activities
Exercise 9 The figure shows the path(s) of a ray of light traveling through three layers of an optical medium. Each layer has a different index of refraction, which reflects the speed of light in that medium compared light traveling in empty space.
At each interface between media with differing indices of refraction, the light is reflected. The proportion of light reflected at the interface 0-1 is
Similarly, at interface 1-2, a fraction
The total amount reflected in passing through both layers is approximately $R_{0,1}
The point of sandwiching optical elements in this way is to reduce reflection (or, equivalently, increase the transmission of light). Correspondingly, we will call the
Suppose that the indices of fraction
What is the optimal value of
(argmax) in the anti-reflective layer to minimize the total reflection of light passing from the left optical element into the right optical element? What proportion of light is reflected at that argmax?Suppose that there were no anti-reflective layer, that is, the
element abutted directly on the region. What fraction of light would be reflected then?There can be more than one anti-reflective layer. Imagine that the
layer were replaced with two layers, which we will call and , with indices of refraction and .- What are the optimal values for
and to maximize transmission from the medium to the medium? - Can the two-layer scheme improve transmission compaared to the 1-layer scheme?
- What are the optimal values for