Elementary operations and matrices
Recall that solving equations means manipulating augmented matrices (
|
) where each row of
represents a single equation and the corresponding entry in
is the right hand side. Denote the combined matrix as
.
Valid operations on equations which don't affect the set of solutions are of
two types
. Our aim is to build matrices which can produce the desired effect on
by left multiplication. We will denote the matrices by the same names as the operations.
First
is a shuffle (or permutation) of equations and this can be accomplished by the simplest shuffle (called a transposition)
which interchanges the
-th and the
-th equation. We define a corresponding matrix
as obtained from the identity matrix by interchanging the corresponding row of a
suitably sized identity matrix.
Note
that strictly speaking the notation should mention the
size of the identity matrix as well
, but we omit it for convenience of reading.
Example (same old equations):
> M:=matrix(3,4,[0,1,2,1,1,-1,3,3,2,1,11,1]);
> P[1,2]:=swaprow(eye(3),1,2);
> M1:=evalm(P[1,2]&*M);
Next is the operation of adding a multiple by
of one (
-th) equation to the other (
-th). We make the operation on a
suitably sized identity matrix
again and denote the resulting matrix by
.
Note
that the book omits the multiple
from its notation. Also, as above, the size of the identity matrix is omitted from the notation.
We use our own procedure emat to build these matrices. Learn it when you get to the lab.
Example (continued):
Create
.
> `E[3,1](-2)`:=emat(3,1,-2,3);
Check its use. This is the voodoo principle in action.
> M2:=evalm(`E[3,1](-2)`&*M1);
Maple operation which corresponds to
is denoted by
swaprow(M,i,j)
and the operation which corresponds to
is denoted by
addrow(M,i,j,k)
.