Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Math 3607: Homework 9

2021

TOTAL: 30 points

•  Problems marked with  are to be done by hand; those marked with  are to be solved using a computer.

•  Important note. Do not use Symbolic Math Toolbox. Any work done using sym or syms will receive NO credit.

•  Another important note.  When asked write a MATLAB function, write one at the end of your live script.

1.  (Low-rank approximation using SVD; image compression)  Load hubble_gray.jpg, which is a grayscale image taken by the Hubble Space Telescope, convert it to a matrix of floating point pixel intensities, and then display the image in MATLAB by

A  =  imread(’hubble_gray . jpg’);

imshow(A);

Following the demo in Lecture 28 as a guide,

(a) Plot the singular values σ 1 , σ2 , . . . , σn  of A on a log scale (using semilogy).

(b) Plot the accumulation of singular values of A.

(c) Compute the best approximations of A of rank 2, 20, and 120 and display the corresponding images using subplot.

 

Figure 1: NGC 3603         (Hubble Space Telescope).

104

103

102

101

1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

Accumulation of singular values

100               200               300               400               500               600               700               800               900              1000

matrix rank

Figure 2: Example outputs for part (a) on the left and part (b) on the right.

rank = 2, ratio = 0.004

 

rank = 20, ratio = 0.037

 

rank = 120, ratio = 0.219

 

Figure 3: Example output for part (c)

2.  (Annuity with fzero; FNC 4.1.4)  A basic type of investment is an annuity: One makes monthly deposits of size P for n months at a fixed annual interest rate r, and at maturity collects the amount

 ˜ ˆ1 ` ˙´ 1¸ .

Say you want to create an annuity for a term of 300 months and final value of $1,000,000. Using fzero, make a table of the interst rate you will need to get for each of the different contribution values P “ 500, 550, . . . , 1000.

3.  (Lambert’s W function; FNC 4.1.6)  Lambert’s W function is defined as the inverse of xex .  That is, y “ W pxq if and only if x “ yey .  Write a function y  =  lambertW(x) that computes W using fzero. Make a plot of W pxq for 0 ď x ď 4.

4.  (Fixed-point iteration; adapted from FNC 4.2.1 and 4.2.2.) In each case below,

 gpxq  ´x ` ¯ , r “ 3.

• gpxq “ π `  sinpxq, r “ π .

• gpxq “ x ` 1 ´ tanpx{4q, r “ π .

(a)      Show that the given gpxq has a fixed point at the given r and that fixed point iteration can converge to it.

(b)       Apply fixed point iteration in MATLAB and use a log-linear graph (using semilogy) of the error to verify (linear) convergence.  Then use numerical values of the error to determine an approximate value for the rate σ .

5.  (Convergence of Newton’s method)  Answer the following questions by hand, without using MATLAB.

(a) Discuss what happens when Newton’s method is applied to find a root of fpxq signpxqa|x|,

starting at x0  ‰ 0. 1

1 sign pxq is 1 if x ą 0, ´1 if x ă 0, and 0 if x “ 0.

(b) In the case of a multiple root, where f prq “ f1 prq “ 0, the derivation of the quadratic error convergence is invalid. Redo the derivation to show that in this circumstance and with f2 prq ‰ 0 the error converges only linearly.