代写 algorithm math theory Applied Mathematics 4615a/9563a

Applied Mathematics 4615a/9563a
Assignment 3 & 4
Due Date: 22 November 2019
Please submit your answers electronically as Maple worksheets.
1. During the laboratory sessions, we started to write a Maple proc() that implemented the Euclidean algorithm. Complete the program and modify as below.
(a) Add the calculation of the extended algorithm. That is, given integers a, b, compute s, t, g so that sa+tb = g. A copy of the extended algorithm taken from Geddes et al is attached to this file. Note that the algorithm is more general than you need. n(a) is their notation for |a|, and u(a) is the sign of a, usually denoted sgna. You can assume a,b > 0 and ignore this notation.
(b) Since you are assuming a, b > 0, make sure your program tests the inputs and throws an error if the arguments are not positive integers.
(c) Write a maple program to test the following conjecture. For positive integers a, b, let the EEA be sa + tb = g. We always have |s| < b/g and |t| < a/g. Test this conjecture for a, b < 50. When writing your program, DO NOT PRINT OUT EVERY CASE; that will WASTE screen space and annoy me. Use your program to test the conjecture and only print out cases which fail the test. BE CAREFUL to include a test so that not more than 10 exceptions are printed out. For this question, you may use the Maple function igcdex. 2. Use the LinearAlgebra package to implement a bivariate Newton iteration. The problem is f(x,y) = 0 , g(x, y) = 0 . Given a starting estimate (x0, y0), we want to implement the 2-variable analogue of the famous x0 − f(x0)/f′(x0). The theory is 􏰃f(x,y)􏰄 􏰃f(x0,y0)􏰄 􏰃∂f/∂x ∂f/∂y􏰄􏰃x−x0􏰄 g(x,y) ≈ g(x ,y ) + ∂g/∂x ∂g/∂y y−y . 000 Solving for x, y we obtain 􏰃x􏰄 􏰃x0􏰄 􏰃∂f/∂x ∂f/∂y􏰄−1 􏰃f(x0, y0)􏰄 y = y − ∂g/∂x ∂g/∂y g(x,y) . 000 You are asked only to perform one iteration; you do not have to loop until you find the solution. Your procedure will take arguments: 1 • the two functions, either Maple expressions or functions; for example f, g. • the two variables used to describe the functions; for example x, y. • estimates for the roots; For example x0,y0. The procedure will construct the partial derivatives, solve the matrix equation, and return the new estimates for the roots. • You should read about the Maple uses declaration at the start of a procedure to allow the proc to use the LinearAlgebra package. • You can assume that the estimates as supplied as floats, which will be contagious and make all calculations floats. • You do not need to include a loop to get the roots more accurate. 3. Use implicitplot3d to plot the surfaces given by the equations e1 = 3x2 + xz + 2y2 + z2 − 4 , (1) e2 = x2 + xy + 3y2 + 2z2 − 4 , (2) e3 = x2 − xyz + y2 − z2 − 1 . (3) Investigate the points where they intersect each other. 2