Pretest 1

1. Prove the last statement in the theorem about transposes
((AB)T = BTAT).

AB(j,i) is the product of row j of A and column i of B where j and i are between 1 and n, and by the definition of transposes AB(j,i) = ABT(i,j). So, ABT(i,j) is the product of row j of A and column i of B.

BTAT(i,j) is the product of row i of BT and column j of AT where i and j are between 1 and n, but row i of BT is column i of B and column j of AT is row j of A. So, BTAT(i,j) also equals the product of row j of A and column i of B.

(AB)T(i,j) = BTAT(i,j) for i and j from 1 to n.

The proof is complete.

2. We can find the general solution of the following system of linear equations depending on the parameter a using Gauss-Jordan elimination.
 
					ax + y +  z = 2 
					 x - y +  z = 3 
					5x + y + 3z = 7 


So, the augmented matrix, A, is
A := [ a 1 1 2 ]
[ 1 -1 1 3 ]
[ 5 1 3 7 ]

Now let us use row operations and simplify the matrix as much as possible. Notice that we cannot divide by expressions involving a unless we are sure that the expression is not 0. We also cannot multiply a row by an expression if we are not sure that this expression is not 0.

>B:=swaprow(A,1,2);
B := [ 1 -1 1 3 ]
[ a 1 1 2 ]
[ 5 1 3 7 ]

>B:=addrow(B,1,2,-a);
B := [ 1 -1 1 3 ]
[ 0 a+1 -a1 -3a+2 ]
[ 5 1 3 7 ]

>B:=addrow(B,1,3,-5);
B := [ 1 -1 1 3 ]
[ 0 a+1 -a1 -3a+2 ]
[ 0 6 -2 -8 ]

>B:=mulrow(B,3,1/6);
B := [ 1 -1 1 3 ]
[ 0 a+1 -a1 -3a+2 ]
[ 0 1 -1/3 -4/3 ]

>B:=swaprow(B,2,3);
B := [ 1 -1 1 3 ]
[ 0 1 -1/3 -4/3 ]
[ 0 a+1 -a1 -3a+2 ]

>B:=addrow(B,2,3, -a-1);
B := [ 1 -1 1 3 ]
[ 0 1 -1/3 -4/3 ]
[ 0 0 -2/3 a + 4/3 -5/3 a + 10/3 ]

>B:=addrow(B,2,1,1);
B := [ 1 0 2/3 5/3 ]
[ 0 1 -1/3 -4/3 ]
[ 0 0 -2/3 a + 4/3 -5/3 a + 10/3 ]

Now notice that the entries on the third row are both equal to 0 when a=2 and are both not equal to 0 when a is not 2. So we have two cases.

Case 1. a=2. Then matrix B has the row echelon form, x, y are leading unknowns and z is a free unknown. The general solution is:
 
					    x =  5/3 - 2/3 z 
					    y = -4/3 + 1/3 z 
					    z =            z 


Case 2. a is not 0. In this case, as we noticed before -2/3a+4/3 is not zero. So we can divide the third row by this number.

>B:=mulrow(B,3,1/(-2/3*a+4/3));
B := [ 1 0 2/3 5/3 ]
[ 0 1 -1/3 -4/3 ]
[ 0 0 1 (-5/3 a + 10/3)/(-2/3 a + 4/3) ]

We can continue the elimination process now. As you see, Maple does not simplify the expression. But we, the humans, can do it:

>B:=matrix([[1,0,2/3,5/3],[0,1,-1/3,-4/3],[0,0,1,5/2]]);
B := [ 1 0 2/3 5/3 ]
[ 0 1 -1/3 -4/3 ]
[ 0 0 1 5/2 ]

>B:=addrow(B,3,2,1/3);
B := [ 1 0 2/3 5/3 ]
[ 0 1 0 -1/2 ]
[ 0 0 1 5/2 ]

>B:=addrow(B,3,1,-2/3);
B := [ 1 0 0 0 ]
[ 0 1 0 -1/2 ]
[ 0 0 1 5/2 ]

So we have the answer (in the case when a is not 2):

x=0, y=-1/2, z=5/2


3. Find the determinant of the following n by n matrix, A, using cofactor expansion along the first row.
[ 1 2 0 ... 0 0 ]
[ -1 2 0 ... 0 0 ]
[ 0 -1 3 ... 0 0 ]
..................
[ 0 0 0 ... n-1 0 ]
[ 0 0 0 ... -1 n ]

If we expand this along the first row,
det(A) =
[ 2 0 ... 0 0 ]
[ -1 3 ... 0 0 ]
...............
[ 0 0 ... n-1 0 ]
[ 0 0 ... -1 n ]
- 2 *
[ -1 0 ... 0 0 ]
[ 0 3 ... 0 0 ]
...............
[ 0 0 ... n-1 0 ]
[ 0 0 ... -1 n ]
= n! + n! = 2n!.

4. Solve the following system of equations using Kramer's rule
 
					4x + 5y + 6z = 10 
					6x - 2y + 7z = 20 
					7x + 5y - 2z = 9 


To use Kramer's rule we need to define four matrices. A is the matrix of the coefficients on the left side of the system.
A := [ 4 5 6 ]
[ 6 -2 7 ]
[ 7 5 -2 ]

A1 is the matrix formed when we replace x's coefficients with column b.
A1 := [ 10 5 6 ]
[ 20 -2 7 ]
[ 9 5 -2 ]

A2 is the matrix formed when we replace y's coefficients with column b.
A2 := [ 4 10 6 ]
[ 6 20 7 ]
[ 7 9 -2 ]

A3 is the matrix formed when we replace z's coefficients with column b.
A3 := [ 4 5 10 ]
[ 6 -2 20 ]
[ 7 5 9 ]

So, >x:= det(A1)/det(A);

x := 913/445


>y:= det(A2)/det(A);

y := - 318/445


>z:= det(A3)/det(A);

z := 398/445