Solutions to Homework 4

advertisement
Solutions to Homework 4
Section 6.1
8d) The solution is (13.5, −11.5, 23.75, 121.5, 97.75)t . See the matlab output.
10) The determinant of the matrix A in this system of equations is 1 − α2 . If the determinant is not
zero, we know there is a unique solution. So the possible values for α so that there are no solutions
or infintely many solutions are α = ±1.
(a) If α = 1, we have the following sequence of matrices via Gaussian elimination






1 −1
1 −2
1 −1 1 −2
1 −1 1 −2
 −1
2 −1
3 → 0
1 0
1 → 0
1 0
1 .
1
1
1
2
0
2 0
4
0
0 0
2
The last row of the final matrix requires x3 to satisfy the equation 0x3 = 2 which is of course
impossible. Therefore, if α = 1 there is no solution to the system.
(b) If α = −1, we have the following sequence of matrices via Gaussian elimination




1 −1 −1 −2
1 −1 −1 −2
 −1
2
1
3 → 0
1
0
1 .
−1
1
1
2
0
0
0
0
The last row of the final matrix requires x3 to satisfy the equation 0x3 = 0 which is true for any
choice of x3 . The second row requires x2 = 1. Finally, we have x1 = −2 + x2 + x3 = x3 − 1.
Therefore, if α = −1 there are infintely many solutions (y − 1, 1, y)t for any y ∈ R.
(c) If α 6= ±1, then a unique solution exists. Gaussian elimination provides the following
sequence of matrices:






1 −1 α −2
1 −1
α
−2
1 −1
α
−2
 −1 2 −α 3  →  0
→ 0 1
1
0
1
0
1 .
2
2
α
1
1
2
0 1 + α 1 − α 2(1 + α)
0 0 1−α 1+α
−1
1 t
, 1, 1−α
).
Backward substituion provides the solution ( 1−α
Section 6.2.
18b) The solution is (1, 0.5, −1)t . See the matlab output.
Section 6.3
1 6
6 2
3 −1
−1
3
. Then A and B are both symmetric but AB =
6) (a) Let A =
and B =
3 17
is not symmetric since (AB)12 6= (AB)21 .
16 0
(b) If a matrix is nonsingular, its inverse exists and is automatically nonsingular. Thus we only
need to show that the inverse of a symmetric matrix is also symmetric. Suppose (*) is true and
that A is symmetric. Then
t
t
t
I = I t = AA−1 = A−1 At = A−1 A
1
where the third equality is from (*) and the last equality is due to A being symmetric. Multiplying
t
this equation by A−1 on the right we have A−1 = A−1 and therefore A−1 is symmetric whenever
A is symmetric and nonsingular.
(*) This is a proof of the fact we all know that (AB)t = B t At : We denote the entry in the ith
row and jth column of A as (A)ij = aij and of At as (At )ij = atij . By definition, atij = aji . Let A
and B be n × n matrices. Then we have the following
t
BA
t
ij
=
=
=
n
X
k=1
n
X
k=1
n
X
btik atkj
(1)
bki ajk
(2)
ajk bki
(3)
k=1
= (AB)ji
= [AB]t ij .
(4)
(5)
with the equalities due to (1) the definition of matrix multiplication, (2) the definition of the
transpose, (3) the commutative property of multiplication of scalars, (4) the definition of matrix
multiplication, and (5) the definition of the transpose. Since every entry of the matrix B t At is
identical to every entry of the matrix [AB]t , then [AB]t = B t At .
t
Using
A and B from part (a), we know that (AB) =
is false. (We know (*) is true.)
(c) This
3 17
3 16
. So (AB)t 6= At B t .
. However, At B t = AB =
16 0
17 0
Section 6.4
12) (a) Using Cramer’s rule, we compute the derivatives of the following four matrices from the
equation Ax = b:




4
3 −1
2
3 −1
1 
1 
B1 =  6 −2
A =  1 −2
10 −12
5
1 −12
5




2 4 −1
2
3 4
1 
B2 =  1 6
B3 =  1 −2 6 
1 10
5
1 −12 10
Then we have D = det(A) = 2, D1 = det(B1 ) = 0, D2 = det(B2 ) = 20, and D3 = det(B3 ) = 52.
Therefore x1 = DD1 = 0, x2 = DD2 = 10, and x3 = DD3 = 26.
(b) The change in A results in D = 0 thus there is no unique solution since A is singular and we
can not find a solution via Cramer’s rule. There are no soltions since performing the elementary
operations (2E1 − 4E2 ) → E2 and (E3 + E2 ) → E3 results in two equations with no solution:
14x2 − 6x3 = −16 and 14x2 − 6x3 = −15.
Section 6.5
2
2b) To solve the equation LU x = b
  



4
1 0 0
1 2 −3
x1
 2 1 0  0 1
2   x2  =  6 
8
−3 2 0
0 0
1
x3
we make the substitution y = U x and

1
 2
−3
So y1 = 4, y2 = 6 − 2(4) = −2, and

1
 0
0
solve Ly = b.
  

4
0 0
y1
1 0   y2  =  6  .
8
2 0
y3
y3 = 8 − 2(−2) − (−3)(4) = 24. Now we solve U x = y.

 

2 −3
x1
4
1
2   x2  =  −2  .
0
1
x3
24
So x3 = 24, x2 = −2 − 2(24) = −50, and x1 = 4 − (−3)(24) − 2(−50) = 176. So the solution to the
original system is x = (176, −50, 24)t .
6c) My LU factorization returns

1
0
0
 −.5
1
0


1 −.8571
1
−1 .8571 −.16
(see Matlab output):

0
2 1
0
0
 0 3.5
0 
3
0



0
0 0 3.5714
4
1
0 0
0
5.64


2
1 0
  −1
3 3
=
  2 −2 1
−2
2 2

0
0 
.
4 
5
Section 6.6
2) (a) Symmetric and strictly diagonally dominant, (b) strictly diagonally dominant, (c) symmetric
and positive definite, and (d) singular. For part (d), performing the elementary row operations
1
7 (E2 + E1 ) → E2 , (E4 − 2E3 ) → E3 , and (E4 − 3E1 ) → E4 returns the matrix


2
3
1 2
 0
1
0 1 


 0 −23 0 −2 
0 −18 0 1
which clearly has determinant 0. Since the original matrix has zero determinant if and only if a
matrix obtained by performing elementary row operations has determinant zero, then the original
matrix is singular.
4d) To obtain a factorization A = LDLt , my LDLt algorithm returns (see Matlab output):




1
0
0
0
4
0
0
0
 .25
 0 2.75

1
0
0 
0
0

.
D=
L=
 .25 −.0909



1
0
0
0
1.7273
0
.25 −.4545 .3684 1
0
0
0
2.9474
3
6.1 8d:
A8d =
1
1 -1 1 -1 2
2
2 1 -1 1 4
3
1 -3 -2 3 8
4
1 -1 4 -5 16
16 -1 1 -1 -1 32
>> gausselim(A8d)
A=
1 1 -1
0 0 3
0 -2 0
0 -3 3
0 -17 17
1
-1
-3
3
-5
6
0
-1
-17 15
2
0
2
8
0
A=
1.0000
0
0
0
0
1.0000
-2.0000
0
0
0
-1.0000
0
3.0000
3.0000
17.0000
1.0000
-5.0000
-3.0000
7.5000
25.5000
-1.0000
6.0000
3.0000
-10.0000
-36.0000
A=
1.0000 1.0000
0
-2.0000
0
0
0
0
0
0
-1.0000
0
3.0000
0
0
1.0000
-5.0000
-3.0000
10.5000
42.5000
-1.0000
6.0000
3.0000
-13.0000
-53.0000
2.0000
2.0000
0
5.0000
-17.0000
A=
1.0000
0
0
0
0
1.0000
-2.0000
0
0
0
-1.0000
0
3.0000
0
0
1.0000
-5.0000
-3.0000
10.5000
0
-1.0000
6.0000
3.0000
-13.0000
-0.3810
2.0000
2.0000
0
5.0000
-37.2381
2.0000
2.0000
0
5.0000
-17.0000
ans =
13.5000 -11.5000 23.7500 121.5000 97.7500
6.2 18b:
>> A18b=[3.3330 15920 10.333 7953;
2.2220 16.710 9.6120 .965;
-1.5611 5.1792 -1.6855 2.714]
A18b =
1.0e+004 *
0.0003 1.5920 0.0010 0.7953
0.0002 0.0017 0.0010 0.0001
-0.0002 0.0005 -0.0002 0.0003
>> scaledpivot(A18b)
A=
0.0002 1.0000 0.0006 0.4996
0.1330 1.0000 0.5752 0.0577
-0.3014 1.0000 -0.3254 0.5240
A=
-0.3014 1.0000 -0.3254 0.5240
0
1.4412 0.4317 0.2889
0
1.0007 0.0004 0.4999
A=
-0.3014 1.0000 -0.3254 0.5240
0
1.4412 0.4317 0.2889
0
0
-0.2993 0.2993
ans =
1.0000
0.5000 -1.0000
6.5 6c:
>> A6c=[2 1 0 0;-1 3 3 0;2 -2 1 4;-2 2 2 5]
A6c =
2 1
-1 3
2 -2
-2 2
0
3
1
2
0
0
4
5
>> [P,L,U]=BLAlu(A6c)
P=
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
L=
1.0000
0
0
-0.5000 1.0000
0
1.0000 -0.8571 1.0000
-1.0000 0.8571 -0.1600
0
0
0
1.0000
U=
2.0000
0
0
0
1.0000
3.5000
0
0
0
3.0000
3.5714
0
0
0
4.0000
5.6400
6.6 4d:
A4d =
4
1
1
1
1
3
0
-1
1 1
0 -1
2 1
1 4
>> [L,D]=LDLfactor(A4d)
L=
1.0000
0
0.2500 1.0000
0.2500 -0.0909
0.2500 -0.4545
0
0
1.0000
0.3684
0
0
0
1.0000
D=
4.0000
0
0
0
0
2.7500
0
0
0
0
1.7273
0
0
0
0
2.9474
Download