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

Fall Semester 2022-23

DDA 3005 — Numerical Methods

Exercise Sheet 3

Problem 1 (Nonexistent LU Factorization):

Prove that the matrix

0

1

1

is nonsingular and that it does not possess a (naïve) LU factorization.

Problem 2 (Computing the LU Factorization):

Calculate the LU factorization (with pivoting) of the matrix

l 1

A =

3

2

5

3

1

1

1

1

1

0

4

1

.

0

For each step of the algorithm, clearly mark the current L and U factor and the pivot element.

State the final LU factorization and permutation matrix P .

Problem 3 (Factorizing Tridiagonal Matrices):

In this exercise, we consider special symmetric tridiagonal matrices of the form

ld1

T =

a1

d2

. . .

. . .     . . .                Rn×n .

. . .     . . .     an1

Throughout the exercise, we assume that T is positive definite.

a)  Show that T can be factorized via T = LLwhere L is a lower bidiagonal matrix, i.e.,

lf1

b1

L =

f2

. . .

 

 

. . .

bn1

 

 

 

fn

with positive diagonal entries fi   > 0 for all i =  1, . . . , n.  Briefly explain how positive definiteness of T is used in the computation/derivation of the factorization.

Hint: Mimic the derivation of the Cholesky decomposition.

b) Write a MATLAB or Python program that computes the factorization T = LLfor given input vectors d ∈ Rn  and a ∈ Rn1 .  Your algorithm should return the diagonal vectors f ∈ Rn and b ∈ Rn1 that define the matrix L. Pay attention to efficient memory allocation and usage. Compute or estimate the number of required flops of your approach!

Problem 4 (A Deblurring Problem):

The goal of this exercise is to investigate and solve linear systems of the form

TXTk  = B  (1)

where B ∈ Rn×n  and k ∈ N are given inputs and T ∈ Rn×n  is a symmetric and positive definite tridiagonal matrix. We seek to recover the matrix X ∈ Rn×n .

The problem (1) can be used to model the deblurring problem presented in one of the introductory lectures.  Specifically, the matrix X corresponds the sharp original (square) n × n image, B represents the blurry image we have observed, and the linear mapping X →f TXTk  models the blurring operation. In this exercise, we assume that T is fully given by

l 4(2)6(6)

4+6

T =

 

1

4+6 2+6

4+6

. . .

 

 

1   4+6

. . . . . .

 

 

 

. . .

. . .

1  

4+6

Rn×n ,    6 = 0.1,

1

 

i.e., every entry on the main diagonal is 4(2)6(6)  and all entries on the other two diagonals are set to 46  with 6 = 0.1. Applying the matrix T multiple times on the original image X intensifies the

 

Figure 1: Left: Original image X . Middle: Blurred image B = T5 XT5 . Right: Blurred image B = T15 XT15 .

a) The eigenvalues of the matrix T can be represented explicitly via:

λi =   cos ( )    i = 1, . . . , n,    6 = 0.1.

(You dont need to verify this result). Estimate the condition number cond ∥ · ∥2 (Tk) of Tk using the spectral norm ∥ · ∥2  as base norm. For which choices of k and n is the matrix Tk generally well- or ill-conditioned?

b)  Design and implement an algorithm in MATLAB and Python that can solve problem (1) and recover the original image X from a given blurry image B for general dimensions n ∈ N and known k ∈ N. You are allowed to use MATLAB or Python inbuilt operations such as the LU factorization, the Cholesky factorization, etc.

On BB, we have provided a test set of original and blurry images with different sizes n and blurring intensity factors k . The images are saved using the formats

n_name_original .png     and     n_name_blurry_k .mat

to indicate n and k . Download the test images and test your code on at least three different images (vary the size or blurring factor k). For each tested image report your result (i.e., plot your reconstructed image), the required cpu-time, and the relative forward error (using the Frobenius norm). What are your observations?

Hint: The test image package also contains two test files that showcase how to load, read,

and write mat and image files in MATLAB and Python.

c) Estimate the total number of flops your algorithm requires in order to solve problem (1).