]>

Naïve Gaussian elimination in matrix notation

Naïve Gaussian elimination can be implemented using matrix notation in the following way. Consider our system of peaches, apples and bananas.

[ 1 4 2 2 3 1 3 2 3 ] [ p a b ] = [ 3 2.2 3.2 ]

Rewrite this with only the numerical values as

[ 1 4 2 3 2 3 1 2.2 3 2 3 3.2 ]

Subtract 2 times row one from row two. Replace row two with the new values.

[ 1 4 2 3 0 5 3 3.8 3 2 3 3.2 ]

Subtract 3 times row one from row three. Replace row three with the new values.

[ 1 4 2 3 0 5 3 3.8 0 10 3 5.8 ]

Subtract 2 times row two from row three and replace row three with the new values.

[ 1 4 2 3 0 5 3 3.8 0 0 3 1.8 ]

This matrix is now in upper triangular form and we can easily back substitute to solve for b, then a and then p.