17Nov2010. Lina Class-D [This note uses mixed Maple/Math notation.]
Our goal is to compute an
Orthogonal-basis
for the (lefthand action) nullspace of matrix G.
> G := <<1 | 2 | 1 | 0 | 1>,<3 | 6 | 0 | -3 | 0>>;
Computing R := RREF(G) uses two row-subtractions, and a row-scaling:
[1 2 1 0 1] [1 2 0 -1 0]
G = [3 6 0 -3 0], R = [0 0 1 1 1]
Back-substitution gives a basis {V1,V2,V3} for Null(R), ie. for Null(G).
V1 := [-2, 1, 0, 0, 0]
V2 := [ 1, 0, -1, 1, 0]
V3 := [ 0, 0, -1, 0, 1]
[Aside: V1 is already orthogonal to V3, so we could leave them alone and
just let B2 be the part of V2 orthogonal to Span(V1,V3).]
But let's not get that clever, and just apply vanilla Gram-Schmidt.
Since V1 isn't the zero-vector, we set B1 := V1 or rather B1 := -V1,
since we want the leftmost entry to be positive.
> B1 := -V1 = [2, -1, 0, 0, 0]
Now project V2 on the line-through-B1:
> ProjOnB1ofV2 := (IP(B1,V2) / IP(B1,B1)) * B1
= [4/5, -2/5, 0, 0, 0]
Hence this subtraction gives Orth_B1(V2):
> scaledB2 := V2 - ProjOnB1ofV2 = [1/5, 2/5, -1, 1, 0]
Let's choose a B2 with integer-entries:
> B2 := 5 * scaledB2 = [1, 2, -5, 5, 0]
We now want the part of V3 that is orthogonal to Span(B1,B2), so we
seek ProjOnB1ofV3 and ProjOnB2ofV3. We observe that V3 is ortho to B1,
since
B1 = [2, -1, 0, 0, 0] and
V3 = [0, 0, -1, 0, 1] .
Thus ProjOnB1ofV3 = [0, 0, 0, 0, 0] .
Next
> ProjOnB2ofV3 := (IP(B2,V3)/IP(B2,B2)) * B2 = [1/11, 2/11, -5/11, 5/11, 0]
Subtracting off the projections yields a vector ortho to Span(B1,B2):
> scaledB3 := V3 - ProjOnB1ofV3 - ProjOnB2ofV3 = [-1/11, -2/11, -6/11, -5/11, 1]
Integer-normalizing the vector gives
> B3 := -11 * scaledB3 = [1, 2, 6, 5, -11]
Let's check that {B1, B2, B3} forms an ortho-set:
> IP(B1,B2) = 0, IP(B1,B3) = 0, IP(B2,B3) = 0.
Let's verify that Span({V1, V2, V3}) includes Span({B1, B2, B3}).
> VVecsThenBVecs := Tpose();
[-2 1 0 2 1 1]
[ 1 0 0 -1 2 2]
VVecsThenBVecs = [ 0 -1 -1 0 -5 6]
[ 0 1 0 0 5 5]
[ 0 0 1 0 0 -11]
> RREF(VVecsThenBVecs) ;
[1 0 0 -1 2 2]
[0 1 0 0 5 5]
[0 0 1 0 0 -11]
[0 0 0 0 0 0]
[0 0 0 0 0 0]
So all the pivots are in the {V1, V2, V3} part.
Now check the reverse inclusion:
> BVecsThenVVecs := Tpose();
[ 2 1 1 -2 1 0]
[-1 2 2 1 0 0]
BVecsThenVVecs = [ 0 -5 6 0 -1 -1]
[ 0 5 5 0 1 0]
[ 0 0 -11 0 0 1]
Drum roll, please:
> RREF(BVecsThenVVecs);
[1 0 0 -1 2/5 0 ]
[0 1 0 0 1/5 1/11]
[0 0 1 0 0 -1/11]
[0 0 0 0 0 0 ]
[0 0 0 0 0 0 ]
Now all the pivots are in the {B1, B2, B3} part. Yea!
So our orthogonal-basis for LeftNull(G) is
B1 = [2, -1, 0, 0, 0]
B2 = [1, 2, -5, 5, 0]
B3 = [1, 2, 6, 5, -11]
Ain't Science Wonderful!
================================================================