# 6.1 - Matrices and Systems of Equations

## Definition of a Matrix

• Rectangular array of real numbers
• m rows by n columns
• Named using capital letters
• First subscript is row, second subscript is column

## Terminology

• A matrix with m rows and n columns is called a matrix of order m x n.
• A square matrix is a matrix with an equal number of rows and columns. Since the number of rows and columns are the same, it is said to have order n.
• The main diagonal of a square matrix are the elements from the upper left to the lower right of the matrix.
• A row matrix is a matrix that has only one row.
• A column matrix is a matrix that has only one column.
• A matrix with only one row or one column is called a vector.

## Converting Systems of Linear Equations to Matrices

Each equation in the system becomes a row. Each variable in the system becomes a column. The variables are dropped and the coefficients are placed into a matrix. If the right hand side is included, it's called an augmented matrix. If the right hand side isn't included, it's called a coefficient matrix.

The system of linear equations ...

``` x +  y -  z = 1
3x - 2y +  z = 3
4x +  y - 2z = 9```

becomes the augmented matrix ...

x y z rhs 1 1 -1 1 3 -2 1 3 4 1 -2 9

## Elementary Row Operations

Elementary Row Operations are operations that can be performed on a matrix that will produce a row-equivalent matrix. If the matrix is an augmented matrix, constructed from a system of linear equations, then the row-equivalent matrix will have the same solution set as the original matrix.

When working with systems of linear equations, there were three operations you could perform which would not change the solution set.

1. Interchange two equations.
2. Multiply an equation by a non-zero constant.
3. Multiply an equation by a non-zero constant and add it to another equation, replacing that equation.

When a system of linear equations is converted to an augmented matrix, each equation becomes a row. So, there are now three elementary row operations which will produce a row-equivalent matrix.

1. Interchange two rows
2. Multiply a row by a non-zero constant
3. Multiply a row by a non-zero constant and add it to another row, replacing that row.

## Row-Echelon and Reduced Row-Echelon Forms

These are Row-equivalent forms of a matrix. One can easily solve a system of linear equations when matrices are in one of these forms.

### Row-Echelon Form

A matrix is in row-echelon form when the following conditions are met.

1. If there is a row of all zeros, then it is at the bottom of the matrix.
2. The first non-zero element of any row is a one. That element is called the leading one.
3. The leading one of any row is to the right of the leading one of the previous row.

#### Notes

• The leading one of a row does not have to be to the immediate right of the leading one of the previous row.
• A matrix in row-echelon form will have zeros below the leading ones.
• Gaussian Elimination places a matrix into row-echelon form, and then back substitution is required to finish finding the solutions to the system.
• The row-echelon form of a matrix is not necessarily unique.

### Reduced Row-Echelon Form

A matrix is in reduced row-echelon form when all of the conditions of row-echelon form are met and all elements above, as well as below, the leading ones are zero.

1. If there is a row of all zeros, then it is at the bottom of the matrix.
2. The first non-zero element of any row is a one. That element is called the leading one.
3. The leading one of any row is to the right of the leading one of the previous row.
4. All elements above and below a leading one are zero.

#### Notes

• The leading one of a row does not have to be to the immediate right of the leading one of the previous row.
• A matrix in row-echelon form will have zeros both above and below the leading ones.
• Gauss-Jordan Elimination places a matrix into reduced row-echelon form.
• No back substitution is required to finish finding the solutions to the system.
• The reduced row-echelon form of a matrix is unique.

## Gaussian Elimination

• Write a system of linear equations as an augmented matrix
• Perform the elementary row operations to put the matrix into row-echelon form
• Convert the matrix back into a system of linear equations
• Use back substitution to obtain all the answers

### Gauss-Jordan Elimination

• Write a system of linear equations as an augmented matrix
• Perform the elementary row operations to put the matrix into reduced row-echelon form
• Convert the matrix back into a system of linear equations
• No back substitution is necessary

### Pivoting

• Pivoting is a process which automates the row operations necessary to place a matrix into row-echelon or reduced row-echelon form
• In particular, pivoting makes the elements above or below a leading one into zeros

## Types of Solutions

There are three types of solutions which are possible when solving a system of linear equations

### Independent

• Consistent
• Unique Solution
• A row-reduced matrix has the same number of non-zero rows as variables
• The left hand side is usually the identity matrix, but not necessarily
• There must be at least as many equations as variables to get an independent solution.
x y z rhs 1 0 0 3 0 1 0 1 0 0 1 2

When you convert the augmented matrix back into equation form, you get x=3, y=1, and z=2.

### Dependent

• Consistent
• Many solutions
• Write answer in parametric form
• A row-reduced matrix has more variables than non-zero rows
• There doesn't have to be a row of zeros, but there usually is.
• This could also happen when there are less equations than variables.
x y z rhs 1 0 3 4 0 1 -2 3 0 0 0 0

The first equation will be x + 3z = 4. Solving for x gives x = 4 - 3z.

The second equation will be y - 2z = 3. Solving for y gives y = 3 + 2z.

The z column is not cleared out (all zeros except for one number) so the other variables will be defined in terms of z. Therefore, z will be the parameter t and the solution is ...

x = 4 - 3t, y = 3 + 2t, z = t

### Inconsistent

• No Solution
• A row-reduced matrix has a row of zeros on the left side, but the right hand side isn't zero.
x y z rhs 1 0 3 4 0 1 -2 3 0 0 0 2

There is no solution here. You can write that as the null set Ø, the empty set {}, or no solution.