DSC2606 TL 203 1 2016

DSC2606/203/1/2016 Tutorial Letter 203/1/2016 Nonlinear mathematical programming DSC2606 Semester 1 Department of Deci...

0 downloads 51 Views 96KB Size
DSC2606/203/1/2016

Tutorial Letter 203/1/2016 Nonlinear mathematical programming

DSC2606 Semester 1 Department of Decision Sciences Solutions: Assignment 03 This tutorial letter contains solutions to the questions in Assignment 03.

Bar code

Learn without limits.

university of south africa

DSC2606/203/1

2

Dear Student Here are the solutions to the third compulsory assignment. You are welcome to contact your lecturer if you have any queries. Their details may be found on the module’s myUnisa page.

3

DSC2606/203/1

Solutions: Assignment 03 Second semester Answer to question 1 Let x y A C

= = = =

width of garden in meters length of garden in meters area of garden in square meters circumference of garden in meters

Maximise circumference C = 2x + 2y subject to area A = xy = 100 where x > 0; y > 0. Substitute y=

100 x

in the equation for C: C = 2x + 2 Extreme points where

dC = 0: dx



100 x



= 2x + 200x−1

dC = 2 − 200x−2 = 0 dx 200 ⇒2= 2 x 2 ⇒ x = 100 ⇒ x = 10.

(Discard negative value, i.e. x = −10.) d2 C = −2(−200)x−3 > 0 ⇒ relative maximum at x = 10. dx2 ⇒ y = 10. The corresponding optimal length is y = 10 meters. This means that the maximum circumference is obtained when the area is a square. Option [1]: The optimal width is 10 meters.

4

DSC2606/203/1

Answer to question 2 From the previous question, we know that a rectangle of given perimeter covers the largest area when it is a square. Therefore, the largest area that can be covered by a rectangle is 625 m2 , by using a square with sides of 25 m. If the garden is is circle, the cirumference is given by 2πr = 100. Therefore, r =

100 2π

= 15,9155. The area of the circle is then given by A = πr 2 = 795,7747.

Option [2]

Answer to question 3 The squared distance between the point (0; 1) and any point (x; y) on the Euclidean plane is given by the formula D 2 = (0 − x)2 + (1 − y)2 . Since y = x2 − 2x + 1, we can also write this formula as D 2 (x) = x2 + ((x2 − 2x + 1) − 1)2 = x2 + (x2 − 2x)2

= x4 − 4x3 + 5x2 .

The derivative is given by dD 2 = 4x3 − 12x2 + 10x. dx To find the extreme values, we set this equal to 0: 2x(2x2 − 6x + 5) = 0. From the above factorisation, we can immediately see that one solution is x = 0. Using the second derivative of D, we can also see that this is a minimum. If we take the corresponding y-value on the parabola, we get y = 1. Therefore, the point (0; 1) is actually on the parabola itself, and the minimum distance is 0. Option [3]: The point on the parabola y = x2 − 2x + 1 that is closest to the point (0; 1) is (0; 1).

Answer to question 4

5

DSC2606/203/1

Suppose the two numbers are represented by x and y. It is given that they add up to 10, so we have that x + y = 10. This gives us y in terms of x: y = 10 − x. We are asked to maximise the product of the two numbers. In other words, we have to maximise the function f (x,y) = xy under the constraints x + y = 10, x,y ≥ 0. Substituting y by 10 − x, we get the function f (x) = x(10 − x) = 10x − x2 . Therefore, by setting the derivative equal to 0, f ′ (x) = 10 − 2x = 0, we find that x = 5. Substituting back, we see that y = 5. It is worth noting that this is actually almost the same question as Question 1. Stating that the sum is fixed means the perimeter has a certain size, and asking for the product to be maximised is the same as asking for the area to be maximised. Option [5]

Answer to question 5 For any x > 0, eln x = x. The function then simply becomes f (x) =

x eln x = = 1. x x

f is therefore a constant function over all of the reals. Every point in its domain is then both an absolute maximum and an absolute minimum. Option [5]

Answer to question 6 The function is constant, and so the second derivative is 0 everywhere. But an inflection point is actually defined as a point where the first derivative changes sign. Since the first derivative is also 0 everywhere, it never changes sign, and there is no inflection point. Option [5]

6

DSC2606/203/1

Questions 7 to 11 relate to the following NLP problem: √ Maximise f (x) = 3x + 5 subject to 2 ≤ x ≤ 5. Using calculus to solve the problem: 1

f (x) = (3x + 5) 2 1 3 3 f ′ (x) = (3x + 5)− 2 = 1 2 2(3x + 5) 2 3 9 9 f ′′ (x) = − (3x + 5)− 2 = − 3 . 4 (3x + 5) 2

Answer to question 7 The denominator of f ′′ (x) is positive on the interval [2; 5] (and, in fact, will always be positive over its range), so the second derivative must always be negative. Option [1]

Answer to question 8 Just as the second derivative is always negative, the first derivative is always positive, which means that the function is increasing. The smallest it can be over the interval [2; 5] is therefore at x = 2. Option [4]

Answer to question 9 As in the previous question, we note that the function increases over the interval. The maximum for the problem will therefore be attained where x = 5. Option [3]

Answer to question 10 We evaluate the integral: Z

5

1

(3x + 5) 2

0



3 2 1 · (3x + 5) 2 = 3 3 3 3 2 = (20 2 − 5 2 9 = 17,3916.

Option [4]

5 0

7

DSC2606/203/1

Answer to question 11 The interval endpoints are 0, 1,25, 2,5, 3,75 and 5. Applying the trapezoidal rule, we get Z 5 5−0 f (x)dx ≈ (f (x0 ) + 2f (x1 ) + · · · 2f (xn−1 ) + f (xn )) 2n 0 5 = (f (0) + 2f (1,25) + 2f (2,5) + 2f (3,75) + f (5)) 8 p p p √  5 √ 5 + 2 8,75 + 2 12,5 + 2 16,25 + 20 = 8 = 17,3485 Option [5]

Answer to question 12 The cost function is given by a quadratic equation with a positive leading coefficient. Such a function is always a parabola with an absolute minimum (i.e. it is open at the top). Therefore, the cost function is convex. Option [4]

Answer to question 13 The profit function is given by P (x) = 200x − 500 000 − 80x − 0,003x2 = −0,003x2 + 120x − 500 000.

The derivative of the profit function is then P ′ (x) = −0,006x + 120. Setting P ′ (x) = 0, we find that x =

−120 −0,006

= 20 000.

Option [3]

Answer to question 14 The maximum profit is given by P (20 000) = −0,003(20 000)2 + 120(20 000) − 500 000 = 700 000. Option [1]

Questions 15 to 18 relate to the probability density function

8

DSC2606/203/1

1 − f (x) = √ e 2π

(x − 2)2 2

A graph of the function can be obtained through entering the following input in the program Maxima: (%i1) f(x):=(%e)^(-(x-2)^2/2)/(sqrt(2*%pi)); (%i2) plot2d([f(x)], [x,-1,11], [y,0,0.4]); As can be seen from the graph, the function f (x) is nonlinear, neither increasing nor decreasing, and neither convex nor concave on the interval (∞; ∞). In fact, it is the bell-shaped curve of the normal distribution N(µ; σ 2 ), (x − µ)2 − 1 2σ 2 f (x) = √ e σ 2π where µ is the mean and σ is the standard deviation. In this question the parameter values are µ = 2 and σ = 2.

Answer to question 15 Option [5]: The function f (x) is none of the above. The stationary points of the function 1 − f (x) = √ e 2π

(x − 2)2 2

occur where f ′ (x) = 0: 1 − f ′ (x) = √ e 2π

(x − 2)2 (−2)(x − 2) 2 · =0 2

− ⇒ x = 2, because e

(x − 2)2 2 > 0.

Second derivative test: 1 − f ′′ (x) = √ e 2π

(x − 2)2  2 (x − 2)2 − 1

Check sign of second derivative at the stationary point, i.e. where x = 2: 1 f ′′ (2) = √ e0 · (0 − 1) < 0 ⇒ relative maximum at x = 2. 2π

Answer to question 16

9

DSC2606/203/1

Option [2]: The function f (x) is maximised at x = 2. The value of the function at x = 2 is 1 1 f (2) = √ e0 = √ ≈ 0,3989. 2π 2π Inflection points occur where the second derivative is zero and changes sign. f ′′ (x) = 0 because



(x − 2)2 =1 22

(x−2)2 1 √ e− 2 > 0. 2π

From this it follows that possible inflection points are where (x − 2)2 = 1, or x − 2 = ±1, i.e. at x = 1 and x = 3. Check sign of second derivative next to possible inflection points: f ′′ (0,5) > 0 f ′′ (4) < 0 We already know that f ′′ (2) < 0. So the second derivative changes sign at x = 1 and x = 3. Therefore they are inflection points.

Answer to question 17 Option [3]: The function f (x) has an inflection point at x = 3. The total area under the curve over the interval (µ − σ; µ + σ) = (2 − 2; 2 + 2) = (0; 4) is given by the integral

Z

µ+σ

µ−σ

1 f (t)dt = √ σ 2π

Z

µ+σ

µ−σ

− e

(t − µ)2 Z 2 2σ dt ≈ 0,4

4

− e

(t − 2)2 2 dt

0

f (x)

0

1

2

3

x

10

DSC2606/203/1

Answer to question 18 The value of this integral must be determined through a numerical integration procedure, such as Romberg’s method in Maxima. (%i8) (%o8) (%i9) (%o9)

load(romberg); C:/PROGRA~1/MAXIMA~1.0/share/maxima/5.13.0/share/numeric/romberg.lisp romberg(f(x),x,3.0,7.0); 0.95449975335141 Z

µ+σ µ−σ

f (t)dt ≈ 0,95 (accurate to two decimal places).

Option [3] Note: It is a characteristic of the normal or Gauss distribution that approximately 68% of the total area under the curve is in the interval (µ − σ; µ + σ), that is, within one standard deviation from the mean.

Answer to question 19 It is given that the container has a square base, so we can take the length and breadth of the base to both be equal to x. We let y be the height of the container. The surface area of the container consists of: • a base of area x2 • 4 sides of area xy. The surface area of the container is then x2 + 4xy = 1 000. From this, we can deduce that y=

1 000 − x2 . 4x

The volume of the container is given by V (x,y) = length × breadth × height = x2 y.

Substituting the expression for y: 1 V (x) = (1 000x − x3 ). 4 The derivative of the volume is given by 3x2 dV = 250 − . dx 4

11

Setting

DSC2606/203/1

dV dx

= 0, we get x =

q 333 31 . This gives 1 000 − 333 31 q y= = 9,1287. 4 333 13

The volume will then be V = x2 y ≈ 333,3333 × 9,1287 = 3042,9031. Option [3]

12

DSC2606/203/1

Answer to question 20 The weekly revenue function is given by R(x) = xp = 1 000x − x2 . Therefore, the profit function will be P (x) = R(x) − C(x)

= 1 000x − x2 − 3 000 − 20x = −x2 + 980x − 3 000.

Option [4]

Answer to question 21 We set the derivative of the profit function equal to 0: dP = −2x + 980 = 0. dx Therefore, x = 490. Option [3]

Answer to question 22 If r is the radius of the base and h is the height of the can, the volume is given by V = πr 2 h. It is given that the volume is 500 cm3 , so we solve for h and obtain h=

500 . πr 2

The surface area of the cylinder is given by A = 2πr × h + 2πr 2. The first term in the expression for A gives the area of the side of the can and the second term gives the area of the circle at the top and the bottom. Substituting the expression for h into A, we get A = 2πr × = Taking the derivative:

500 + 2πr 2 2 πr

1 000 + 2πr 2 . r

−1 000 dA = + 4πr. dr r2

13

Setting it equal to 0:

DSC2606/203/1

−1 000 + 4πr = 0 r2

means that 4πr 3 − 1 000 = 0 and therefore r ≈ 4,3012. Option [1] Questions 23 to 25 relate to the following NLP problem: Maximise g(x) = −x5 + 80x + 32 subject to −2 ≤ x ≤ 4.

Answer to question 23 g ′ (x) = −5x4 + 80

g ′′ (x) = −20x3

Setting g ′ (x) = 0, we find extremal points at x = ±2. Substituting these into g ′′ (x): g ′′ (−2) = −20(−8) = 160 > 0

g ′′(2) = −20(8) = −160 < 0.

Therefore, a local minimum can be found at x = −2, where g(−2) = −96, and a local maximum at x = 2, where g(2) = 160. In order to make sure that x = 2 is indeed the solution to the NLP problem, we also have to check the boundary values. The one on the left has already been checked, so we only evaluate x = 4, where g(4) = −672 < g(2). The maximum over the interval [−2; 4] therefore occurs at x = 2. Option [3]

Answer to question 24 The integral can be evaluated precisely. Z 2 −x5 + 80x + 32dx 1 2  6 x 2 = − + 40x + 32x 6 1 1 32 = − + 160 + 64 + − 40 − 32 3 6 = 141,5.

14

DSC2606/203/1

The closest corresponding answer is 140. Option [3]

Answer to question 25 Because of Question 23, we know that there is a zero between x = 2 and x = 4, because g(2) > 0 and g(4) < 0. We compare this to the other values given: g(3) = 29 g(−2) = 96 g(−1) = −47 g(1) = 47

g(2) = 160. The closest approximation to 0 is therefore when x = 3. Option [5] c

UNISA 2016