MACM 316 COMPUTING ASSIGNMENT #3
Submit on Crowdmark by Tuesday, June 30, 2020, 11pm
Upload one .pdf file with 2 pages: Page 1 is your typed report (your discussions, data and
figures on a single page); Page 2 is a listing of your code(s). The assignment is due at 11:00pm.
You will receive a Crowdmark link for the upload.
Matlab scripts and functions for this assignment can be downloaded from the Canvas Home-
work page. Make sure to either set your “Matlab path”, or run Matlab in the directory where
your scripts and functions are located.
This computing assignment is an exploration of condition numbers,
pertu
ations, and the numerical behaviour of random and not-so-
andom matrices.
You will need to download gendata.p from Canvas to get all the
data for the assignment, including the matrices E, H, HI, H8, and
HI8 refe
ed to below. (Note: gendata is encoded, displaying it will
show a sequence of strange characters.) Run the script, and look at
the work space or type whos to get a list of the data.
For all your computations use � = 10−6 - a variable epsilon with
the proper value is included in your data.
C1. For A = E, A = H, compare the 1-condition number κ1(A) (in Matlab simply cond(A,1))
to the observed amplification in pertu
ations as well as to the Matlab estimate rcond(A).
Note, that rcond(A) estimates the reciprocal 1/κ1(A).
1. Pertu
ations in the right-hand side.
For each of these two matrices you will solve a total of 100 systems. You pair each right
side b = B(:,j) with each pertu
ation direction d = D(:,k); note, that all column
vectors in your data have length 1 in the || · ||1 norm. Compute (simply use the Matla
“\” backslash command) the solution of
Ax = b, and Ay = b+ �d,
and compare the amplification of the relative e
ors
e =
||y−x||1
||x||1
||�d||1
||b||1
=
||y − x||1
�||x||1
to the upper bound κ1(A).
Look at the average, median, and maximum of the amplification factors. Describe you
observations (supported by a plot), and comment on your results. See the sample below
for a possible visualization.
MRT 1
MACM 316 COMPUTING ASSIGNMENT #3
2. Pertu
ations of the matrix.
For each of the two matrices E and H, solve a total of 60 linear systems to compute
amplification factors. You use the same 10 right hand sides b from the first part; to
get your pertu
ation matrices, type C=BIGC(:,:,k), for k = 1, . . . , 6. All the data
matrices have ||C||1 = 1.
Compute (simply use the Matlab “\” backslash command) the solution of
Ax = b, and (A+ �C)z = b,
and compare the amplification of the relative e
ors
e =
||z−x||1
||x||1
||�C||1
||A||1
= ||A||1
||z − x||1
�||x||1
to the upper bound κ1(A) and the Matlab estimate 1
cond(A).
Look at averages, median, and maxima of amplification factors. Plot your results, and
comment on your observations.
C2. Short (and sweet - depending on your taste). Use the Matlab command AINV=inv(A) to
find the inverse of a matrix A, and compute the inverse of this inverse, AC=inv(AINV), which
mathematically equals A (=
(
A−1
)−1. The matrix I is the identity matrix.
1. For A = E, compute ||A ∗AINV − I||1, and ||AC −A||1.
2. For A = H, compute ||A ∗ AINV − I||1, ||AC − A||1. For this matrix, also compare the
computed inverse to the exact inverse HI provided, i.e., compute ||AINV −HI||1.
3. Repeat item 2 for the matrix A = H8 with exact inverse HI8. Compute κ1(H8).
Summarize your observations and highlight anything that might seem surprising.
MRT 2
MACM 316 COMPUTING ASSIGNMENT #3
Submit on Crowdmark by Tuesday, June 30, 2020, 11pm
Upload one .pdf file with 2 pages: Page 1 is your typed report (your discussions, data and
figures on a single page); Page 2 is a listing of your code(s). The assignment is due at 11:00pm.
You will receive a Crowdmark link for the upload.
Matlab scripts and functions for this assignment can be downloaded from the Canvas Home-
work page. Make sure to either set your “Matlab path”, or run Matlab in the directory where
your scripts and functions are located.
This computing assignment is an exploration of condition numbers,
pertu
ations, and the numerical behaviour of random and not-so-
andom matrices.
You will need to download gendata.p from Canvas to get all the
data for the assignment, including the matrices E, H, HI, H8, and
HI8 refe
ed to below. (Note: gendata is encoded, displaying it will
show a sequence of strange characters.) Run the script, and look at
the work space or type whos to get a list of the data.
For all your computations use � = 10−6 - a variable epsilon with
the proper value is included in your data.
C1. For A = E, A = H, compare the 1-condition number κ1(A) (in Matlab simply cond(A,1))
to the observed amplification in pertu
ations as well as to the Matlab estimate rcond(A).
Note, that rcond(A) estimates the reciprocal 1/κ1(A).
1. Pertu
ations in the right-hand side.
For each of these two matrices you will solve a total of 100 systems. You pair each right
side b = B(:,j) with each pertu
ation direction d = D(:,k); note, that all column
vectors in your data have length 1 in the || · ||1 norm. Compute (simply use the Matla
“\” backslash command) the solution of
Ax = b, and Ay = b+ �d,
and compare the amplification of the relative e
ors
e =
||y−x||1
||x||1
||�d||1
||b||1
=
||y − x||1
�||x||1
to the upper bound κ1(A).
Look at the average, median, and maximum of the amplification factors. Describe you
observations (supported by a plot), and comment on your results. See the sample below
for a possible visualization.
MRT 1
MACM 316 COMPUTING ASSIGNMENT #3
2. Pertu
ations of the matrix.
For each of the two matrices E and H, solve a total of 60 linear systems to compute
amplification factors. You use the same 10 right hand sides b from the first part; to
get your pertu
ation matrices, type C=BIGC(:,:,k), for k = 1, . . . , 6. All the data
matrices have ||C||1 = 1.
Compute (simply use the Matlab “\” backslash command) the solution of
Ax = b, and (A+ �C)z = b,
and compare the amplification of the relative e
ors
e =
||z−x||1
||x||1
||�C||1
||A||1
= ||A||1
||z − x||1
�||x||1
to the upper bound κ1(A) and the Matlab estimate 1
cond(A).
Look at averages, median, and maxima of amplification factors. Plot your results, and
comment on your observations.
C2. Short (and sweet - depending on your taste). Use the Matlab command AINV=inv(A) to
find the inverse of a matrix A, and compute the inverse of this inverse, AC=inv(AINV), which
mathematically equals A (=
(
A−1
)−1. The matrix I is the identity matrix.
1. For A = E, compute ||A ∗AINV − I||1, and ||AC −A||1.
2. For A = H, compute ||A ∗ AINV − I||1, ||AC − A||1. For this matrix, also compare the
computed inverse to the exact inverse HI provided, i.e., compute ||AINV −HI||1.
3. Repeat item 2 for the matrix A = H8 with exact inverse HI8. Compute κ1(H8).
Summarize your observations and highlight anything that might seem surprising.
MRT 2