quiz8.mws

MCS 320 Quiz 8 Friday 21 October 2005

> restart;

1. Give the Maple commands to create a table currency, to exchange US dollars (USD) and UK pounds: 1 USD = 0.563348 GPB and 1 GBP = 1.77510 USD.

   Illustrate the use of the currency table to convert 12.45 USD into GBP.

ANSWER :

> currency := table([USD = 0.563348*GBP,GPB = 1.77510*USD]);

currency := TABLE([GPB = 1.77510*USD, USD = .563348*GBP])

> 123.45*currency[USD];

69.54531060*GBP

2. Consider the f(x,y,z) = x^3 + y^2 + z, where (x,y,z) must satisfy g(x,y,z) = x^2 + y^2 + z^2 - 1 = 0.

   Give the Maple commands to apply the methods of Lagrange multipliers to count the number of candidate extremal values of f(x,y,z) constrained by g(x,y,z) = 0.

   How many candidate extremal values do you count?

ANSWER :

> f := x^3 + y^2 + z;

f := x^3+y^2+z

> g := x^2 + y^2 + z^2 - 1;

g := x^2+y^2+z^2-1

> s := {g,diff(g,x)-lambda*diff(f,x),diff(g,y)-lambda*diff(f,y),diff(g,z)-lambda*diff(f,z)};

s := {x^2+y^2+z^2-1, 2*x-3*lambda*x^2, 2*y-2*lambda*y, 2*z-lambda}

> gb := Groebner[gbasis]([op(sys)],plex(x,y,z,lambda));

gb := [9*lambda^7-72*lambda^5+160*lambda^3-64*lambda-9*lambda^6+72*lambda^4-160*lambda^2+64, 2*z-lambda, -y+lambda*y, 144*y^4-152*y^2+9*lambda^6-72*lambda^4+160*lambda^2-64, 8*x+12*y^2+3*lambda^3-12*l...gb := [9*lambda^7-72*lambda^5+160*lambda^3-64*lambda-9*lambda^6+72*lambda^4-160*lambda^2+64, 2*z-lambda, -y+lambda*y, 144*y^4-152*y^2+9*lambda^6-72*lambda^4+160*lambda^2-64, 8*x+12*y^2+3*lambda^3-12*l...gb := [9*lambda^7-72*lambda^5+160*lambda^3-64*lambda-9*lambda^6+72*lambda^4-160*lambda^2+64, 2*z-lambda, -y+lambda*y, 144*y^4-152*y^2+9*lambda^6-72*lambda^4+160*lambda^2-64, 8*x+12*y^2+3*lambda^3-12*l...

From the triangular structure of the lexicographic Groebner basis, we see there are seven solutions.