Solutions of Test 1.
Problem 1. Prove the following statements:
a) If the product of two symmetric matrices A and B of the same size is symmetric then AB=BA.
b)Conversely, if A and B are symmetric matrices of the same size and AB=BA then AB is symmetric.
a) Suppose that AB is symmetric. This means that (AB)T=(AB). We know from a theorem about transposes that (AB)T=BTAT. Therefore we have that BTAT=AB. But A and B are symmetric matrices, so AT=A, BT=B. Therefore: BA=AB. QED
b) Suppose that A and B are symmetric and AB=BA. Then (AB)T=BTAT (by a theorem about transposes). Since BT=B, AT=A, we have: (AB)T=BA. Since BA=AB, we conclude
that (AB)T=AB, so AB is symmetric.
Problem 2. For which values of the parameter a
the following system of equations has a) exactly one solution, b) no solutions, c) infinitely many solutions:
ax + (a+1)y + (a+2)z + t = 1
2ax + ay + 2az + 3t = a+1
3x + 4y + 5z + t = a-2
x + ay + z + t = 5
This system has the following matrix of coefficients:
> with(linalg):A:=matrix([[a,a+1,a+2,1],[2*a,a,2*a,3],[3,4,5,1], [1,a,1,1]]);
A := |
[ a |
a+1 |
a+2 |
1 ] |
[ 2a |
a |
2a |
3 ] |
[ 3 |
4 |
5 |
1 ] |
[ 1 |
a |
1 |
1 ] |
The determinant of this matrix is
> d1:=det(A);
- 8 a2 + 30 a - 18
Find a for which det(A) is equal to 0:
> di:=(-30)^2-4*(-18)*(-8);
di := 324
> a1:=(-30+sqrt(324))/(-16);
a1 := 3/4
> a2:=(-30-sqrt(324))/(-16);
a2 := 3
So if a is not 3 or 3/4 then det(A) is not 0 and the system has unique solution. Now let a=3/4. Then the augmented matrix of our system has the following form:
> with(linalg):A:=matrix([[3/4,3/4+1,3/4+2,1,1],[2*3/4,3/4,2*3/4,3,3/4+1],[3,4,5,1,3/4-2], [1,3/4,1,1,5]]);
A := |
[ 3/4 |
7/4 |
11/4 |
1 |
1 ] |
[ 3/2 |
3/4 |
3/2 |
3 |
7/4 ] |
[ 3 |
4 |
5 |
1 |
-5/4 ] |
[ 1 |
3/4 |
1 |
1 |
5 ] |
Let us do the Gauss-Jordan procedure:
> gaussjord(A);
[ 1 |
0 |
0 |
3/2 |
0 ] |
[ 0 |
1 |
0 |
-4 |
0 ] |
[ 0 |
0 |
1 |
5/2 |
0 ] |
[ 0 |
0 |
0 |
0 |
1 ] |
So the system does not have solutions. Finally let a=3. Then the augmented matrix has the form
> with(linalg):A:=matrix([[3,3+1,3+2,1,1],[2*3,3,2*3,3,3+1],[3,4,5,1,3-2], [1,3,1,1,5]]);
A := |
[ 3 |
4 |
5 |
1 |
1 ] |
[ 6 |
3 |
6 |
3 |
4 ] |
[ 3 |
4 |
5 |
1 |
1 ] |
[ 1 |
3 |
1 |
1 |
5 ] |
Solve using the Gauss-Jordan procedure:
> gaussjord(A);
[ 1 |
0 |
0 |
9/10 |
37/15 ] |
[ 0 |
1 |
0 |
1/5 |
26/15 ] |
[ 0 |
0 |
1 |
-1/2 |
-8/3 ] |
[ 0 |
0 |
0 |
0 |
0 ] |
The system with this augmented matrix has infinitely many solutions since it has a free unknown (t). Thus if a=3/4 the system does not have solutions, if a=3, it has infnitely many solutions and in all other cases it has just one solution.
Problem 3. Find the determinant of the following n by n matrix:
[ 1 |
n |
n |
n |
... |
n ] |
[ n |
2 |
n |
n |
... |
n ] |
[ n |
n |
3 |
n |
... |
n ] |
................. |
[ n |
n |
n |
n |
... |
n ] |
Subtract the last row from all other rows:
[ 1-n |
0 |
0 |
0 |
... |
0 |
0 |
0 ] |
[ 0 |
2-n |
0 |
0 |
... |
0 |
0 |
0 ] |
[ 0 |
0 |
3-n |
0 |
... |
0 |
0 |
0 ] |
.................... |
[ 0 |
0 |
0 |
0 |
... |
0 |
-1 |
0 ] |
[ n |
n |
n |
n |
... |
n |
n |
n ] |
This is a lower triangular matrix. The determinant of it is the product of its diagonal entries, so it is equal to (1-n)(2-n)...(-1)n=(-1)n-1*n!.
Problem 4. Find all values of a such that in the solution of the following system of equations, x*y=z2.
ax + y + z = a
x + ay + z = a + 1
x + y + az = a + 2
Use the Cramer rule:
> x:=det(matrix([[a,1,1],[a+1,a,1],[a+2,1,a]]))/det(matrix([[a,1,1],[1,a,1],[1,1,a]]));
a3 - 2 a - 2 a2 + 3
x := -------------------
a3 - 3 a + 2
> y:=det(matrix([[a,a,1],[1,a+1,1],[1,a+2,a]]))/det(matrix([[a,1,1],[1,a,1],[1,1,a]]));
a3 - a - a2 + 1
y := ---------------
a3 - 3 a + 2
> z:=det(matrix([[a,1,a],[1,a,a+1],[1,1,a+2]]))/det(matrix([[a,1,1],[1,a,1],[1,1,a]]));
a3 - 1
z := ------------
a3 - 3 a + 2
Now solve the equation: x*y=z2
> solve(x*y=z^2,a);
- 1/6 - 1/6 131/2 , - 1/6 + 1/6 131/2