MATH4602 Tutorial03-Assigment (1) - Solutions
MATH4602 Tutorial03-Assigment (1) - Solutions
H = 12 31 14
1 1 1
3 4 5
by using elementary row operations and write down all elementary matrices
explicitly.
6. [Computation of eigenvectors and eigenvalues] Find the eigenvalues and associated
eigenvectors of the following matrix A
2 −3 6
A = 0 3 −4 .
0 2 −3
Did you obtain a set of three linearly independent eigenvectors?
1
7. [Positive definite matrix] Determine the values of a such that the following matrix
A is symmetric positive definite where
a 1 1 1
1 a 1 1
A= .
1 1 a 1
1 1 1 a
Lx = [1 1 1 1 1]T .
1 2 1
What did you find?
(b) Interchange the second and the third row of A and re-do the Doolittle’s LU
factorization again. What did you find this time?
10. [LU factorization and computing inverse] (a) Find the Doolittle’s LU factoriza-
tion of
4 2 1
B= 2 4 2
.
1 2 4
(b) From (a) obtain the Cholesky factorization of B.
(c) Find the inverse of A by solving the following linear systems:
11. [Inverse of tensor] Let A and B be two invertible square matrices. Show that
(A ⊗ B)−1 = A−1 ⊗ B −1 .
2
13. [For-loop and matrix-vector multiplication in MATLAB] To compute the inner prod-
uct of two n×1 vectors x and y, xT y, there are two methods. Try n = 105 , 106 , 107 , 108
and comment on the time for the following two MATLAB programs. Here Tic and
Toc are used to measure the time elapsed.
Program 1 (For-Loop)
1 2 3 15
(a) Apply the Sherman-Morrison-Woodbury Formula to obtain the new solution.
(b) Try (a) again if
13 0 0 1
2 14 0 0
à = .
1 2 14 0
−1 1 2 15
3
15. [Strassen’s Algorithm] Let
" # " # " #
A11 A12 B11 B12 C11 C12
A= B= and C =
A21 A22 B21 B22 C21 C22
Show that
" # " #
C11 C12 M1 + M4 − M5 + M7 M3 + M5
C= =
C21 C22 M2 + M4 M1 − M2 + M3 + M6 .
4
1. (a) The statement is false. The matrix S can also"be the#zero matrix.
0 0
(b) The statement is false. One can consider S = . All eigenvalues of S are
1 0
zero but S 6= 0.
2. It is easy to check that det(C1 ) = 2, det(C2 ) = 2 × 2 − 1 = 3. Now
det(Ck ) = 2 × det(Ck−1 ) + det(V )
where V is an (n − 1) × (n − 1) matrix
−1 −1 0
0 0
.. .
. ..
0 2 −1
. .
−1 . . . . 0
V =
0 .
.. ... ...
. 2 −1
0 · · · 0 −1 2
We note that det(V ) = − det(Ck−2 ). Hence we have
det(Cn ) = 2 × det(Cn−1 ) − det(Cn−2 ).
(ii) We are going to prove that det(Cn ) = n + 1. Clearly the result is true for n = 1
and 2. Suppose that det(Cn ) = n + 1 then det(Cn+1 ) = 2(n + 1) − n = n + 2.
Hence we have proved the result by the principle of M.I. The result implies that Cn
is non-singular for n = 1, 2, . . . ,.
3. Clearly when k = 1 the equality holds. We assume that
" #k " #
B C B k (B k − In )(B − In )−1 C
= .
0 In 0 In
Then, we have
" #k+1 " #k " # " #" #
B C B C B C B k (B k − In )(B − In )−1 C B C
= = .
0 In 0 In 0 In 0 In 0 In
Since
B k C+(B k −In )(B−In )−1 C = (B k (B−In )+B k −In )(B−In )−1 C = (B k+1 −In )(B−In )−1 C,
we have
" #k+1 " #
B C B k+1 (B k+1 − In )(B − In )−1 C
= .
0 In 0 In
Therefore, by the principle of M.I. we proved the result.
4. n n
A¯ij y¯j
X X
hx, Ayi = xi
i=1 j=1
n Xn
A¯ij xi y¯j
X
=
i=1 j=1
n X n
A¯ij xi y¯j
X
=
i=1 i=1
= hA∗ x, yi.
5
5.
1 1 1 1
1 0 0 1 2 3
1 0 0 1 2 3
1 0 0
1 1 1 1 1 1
−2 1 0 2
3 4
0 1 0 = 0
12 12
− 12 1 0
− 13 0 1 1
3
1
4
1
5
0 0 1 0 1
12
4
45
1
−3 0 1
1 1
− 16
1 −6 0 1 2 3
1 0 0 1 0 4 −6 0
1 1 1 1 1
0 1 0 0
12 12
−2 1 0 = 0
12 12
− 21 1 0
1 4
0 −1 1 0 12 45
− 31 0 1 0 0 1
180
1
6
−1 1
− 16
1 0 30 1 0 4 −6 0 1 0 0 9 −36 30
1 1
0 1 −15 0
12 12
− 12 1 0 =
0 1
12
0 −3 16 −15
1 1 1 1
0 0 1 0 0 180 6
−1 1 0 0 180 6
−1 1
1 0 0 1 0 0 9 −36 30 1 0 0 9 −36 30
1
0 12
0 0
12
0 −3 16 −15
= 0 1 0 −36 192 −180
1 1
0 0 180 0 0 180 6
−1 1 0 0 1 30 −180 180
0 2 −3 v3 3
v
2 − λ −3 6 v1 0
⇐⇒ 0
3−λ −4 v2 = 0
0 2 −3 − λ v
3
0
2 − λ −3 6
⇐⇒ det
0 3−λ −4 = (λ + 1)(λ − 1)(λ − 2) = 0
0 2 −3 − λ
⇐⇒ λ = −1, 1, or 2.
When λ = −1,
3 −3 6 v1 0
0 4 −4 v2 = 0
0 2 −2 v3 0
Then, v(1) = [−1 1 1]T .
When λ = 1,
1 −3 6 v1 0
0 2 −4 v2 = 0
0 2 −4 v3 0
Then, v(2) = [0 2 1]T .
When λ = 2,
3 −3 6 v1 0
0 4 −4 v2 = 0
0 2 −2 v3 0
Then, v(3) = [1 0 0]T . Yes, the set of eigenvectors {v1 , v2 , v3 } is linearly independent
by checking det([v1 v2 v3 ]) 6= 0.
6
7. Let x = [x1 , x2 , x3 , x4 ], then
xAxT = (a − 1)(x21 + x22 + x23 + x24 ) + (x1 + x2 + x3 + x4 )2 .
Hence, xAxT > 0 for all x 6= [0, 0, 0, 0] if and only if a > 1.
8. We have x1 = 1, and we proceed as follows:
1 − (1/2)x1 = 1/2
x2 =
x3 = 1 − (1/4)x1 − (1/2)x2 = 1 − 1/2 = 1/2
x4 = 1 − (1/8)x1 − (1/4)x2 − 1/2x3 = 1 − 1/8 − 1/8 − 1/4 = 1/2
x5 = 1 − (1/16)x1 − (1/8)x2 − (1/4)x3 − (1/2)x4 = 1 − 1/16 − 1/16 − 1/8 − 1/4 = 1/2
9. (a)
1 −1 0 1 0 0 1 −1 0
A = −1 1 1 = −1 1 0 0 U22 U23
.
1 2 1 1 L32 1 0 0 U33
The process breaks down when we are solving for U22 . The value of U22 = 0.
(b) After interchanging the two rows, we have
1 −1 0 1 0 0 1 −1 0
à = 1
2 1 = 1 1 0 0 3 1
.
−1 1 1 −1 0 1 0 0 1
The process is smooth.
10. (a) We skip the steps.
1 0 0 4 2 1
L = 0.50 1 0
and U = 0 3 1.5
.
0.25 0.5 1 0 0 3
(b) We have
1 0 0 4 0 0 1 0.5 0.25
B = 0.50 1 0 0 3 0 0 1 0.5
0.25 0.5 1 0 0 3 0 0 1
or
1 0 0 2 √0 0 2 √0 0 1 0.5 0.25
B = 0.50 1 0 0
3 √0 0
3 √0 0 1 0.5
.
0.25 0.5 1 0 0 3 0 0 3 0 0 1
7
11. We have
(A ⊗ B)(A−1 ⊗ B −1 ) = (A · A−1 ) ⊗ (B · B −1 ) = In ⊗ Im = Imn .
Therefore the inverse of (A ⊗ B) is (A−1 ⊗ B −1 ).
12. Let A = P −1 JA P and B = Q−1 JB Q where JA and JB are the Jordan forms of
matrices A and B, respectively. We have
A⊗B = (P −1 JA P )⊗(Q−1 JB Q) = (P −1 ⊗Q−1 )(JA ⊗JB )(P ⊗Q) = (P ⊗Q)−1 (JA ⊗JB )(P ⊗Q)
which means A ⊗ B is similar to (JA ⊗ JB ). Since JA and JB are lower triangular
matrices so is (JA ⊗ JB ). The eigenvalues of (JA ⊗ JB ) can be read from its diagonal
and they are equal to λi µj , (i = 1, . . . , n, j = 1, . . . , m).
13.
n 105 106 107 108
Programme 1 : time in second 3.0 × 10−3 5.3 × 10−3 0.0236 0.2691
Programme 2 : time in second 2.2 × 10−4 9.1 × 10−4 0.0067 0.0483
Program 2 is more efficient than Program 1. We remark that the recorded times
will depend on the computing machine.
14. (a) We note that à = A + [1 1 1 1]T · [1 1 1 1] = uvT . We first check
1 + vT A−1 u = 1 + [1 1 1 1]A−1 [1 1 1 1]T = 1.2491 6= 0.
We can then apply the formula as follows:
Ae−1 b = A−1 b − A−1 u(I + vT A−1 u)−1 vT A−1 b
x̃ = x − (1.2491)−1 · A−1 uvT x
= x − 0.8006 · A−1 u · 0.0588
= x − 0.8006 · 0.0588 · [0.0714 0.0612 0.0576 0.0588]T
= [0.0681 − 0.0131 − 0.0064 − 0.0015]T .