Please note that the program is not 100% complete. It has a few small bugs and missing pieces:
1. RREF
In the Gaussian Elimination (Reduced Row Echelon) calculator, it works for many different matrices except for some. Here's an example of a matrix that will not work:
2 4 6 8
0 0 1 4
0 0 0 1
When this matrix is used as an input for Reduced Row Echelon, it will produce this result which is incorrect:
1 2 1 -5
0 0 1 3
0 0 0 1
Many of the calculators rely on a matrix that is in its reduced form, therefore, if the example matrix above is used in calculators that calculates with a reduced matrix, the results will most likely be incorrect as well
2. Floating Point Values & Negative Zero
Negative zeros will sometimes appear as a result in some of the calculations. That's because floating point numbers are used in code to calculate. This also means that if some fractions appear as a result, it'll be in decimal form instead of Rational form. Furthermore, the numbers in the result will have one decimal place, even if they are whole numbers.
3. Eigenvalues and Diagonalization
The Eigenvalues and Diagonalization calculators were supposed to be in the program, but they are taken out due to their complexity. However, these calculators will be added in the future once a proper algorithm for them is figured out.
Addition
Subtraction
Multiplication
Row Echelon
Reduced Row Echelon
Inverse
Transpose
Determinant
Null Space
Column Space
Row Space
Rank
Addition functions like addition. What is needed for the addition calculator to work is having both matrices be the same size. When two mxn matrices gets added together the numbers in each cell in one matrix gets added by the corresponding cells of the second matrix. For example if the user inputted these two matrices:
1 2 3 2 4 6
4 5 6 8 0 2
The result will be:
3 6 9
12 5 8
Subtraction function the same way as the Addtion calculator except that we're subtracting the numbers in each cell, not adding them
Multiplication between matrices doesn't function the same way as Addition and Subtraction. In order for Multiplication to work, an nxm matrix must be multiplied with an mxk matrix. In other words, the number of columns on the first matrix must be the same as the number of rows on the second matrix.
Another difference about matrix mutliplication is that it doesn't work like regular multiplication. Matrix multiplication is not commmutative, meaning if there exist matrices A and B, A*B =/= B*A
One of the reasons is because if we multiply an nxm matrix with an mxk matrix, the result will be an nxk matrix. In other words, the product matrix will have the same number of rows as the 1st matrix and the same number of columns as the 2nd matrix. Another reason is that the formula for matrix multiplication is that nxm matrix A will be multiplied by ALL of the columns of mxk matrix B. Specifically, A*B = [A*b_1, A*b_2 . . . A*b_k] where b represents the columns of B. Therefore, B*A = [B*a_1, B*a_2 . . . B*a_m] which proves that A*B =/= B*A
Here's an example: If a user inputted these two matrices where A is 2x3 and B is 3x2:
1 2 3 1 0
4 5 6 2 4
3 3
The result will be a 2x2 matrix:
14 17
32 38
A matrix is in Row Echelon form if:
1. In pivot columns, there are zeros below every pivot
2. The pivots can be 1 or any other number but the pivots cannot be 0. Zeros can never be pivots
In this matrix calculator, the pivots in row echelon form are always 1.
Different operations are performed when getting the form. Swapping Rows to make the matrix be in echelon form, Scaling Rows when the pivots are not 1, and Row Replacement to get zeros below the pivots in the pivot columns
Here's an example: This matrix below
2 4 6
8 0 2
4 6 8
Will have this row echelon form:
1 2 3
0 1 2
0 0 1
A matrix is in Reduced Row Echelon form if:
1. In pivot columns, there are zeros below AND above every pivot
2. ALL pivots must be 1
Different operations are performed when getting the form. Swapping Rows to make the matrix be in echelon form, Scaling Rows when the pivots are not 1, and Row Replacement to get zeros above and below the pivots in the pivot columns
Here's an example: This same matrix below
2 4 6
8 0 2
4 6 8
Will have this reduced row echelon form:
1 0 0
0 1 0
0 0 1
Compare it with its row echelon form
The Inverse calculator only works with square matrices (nxn matrices), because only linearly independent square matrices are invertible. The Inverse Calculator creates an identity matrix that is the same size as the inputted nxm matrix and join the two matrices together, creating a joint matrix m rows and n*2 columns. For example, if a user inputs this matrix:
1 2 4
2 0 2
2 0 0
The calculator will create this joint matrix
1 2 4 | 1 0 0
2 0 2 | 0 1 0
2 0 0 | 0 0 1
And row reduce it by using the RREF calculator
1 0 0 | 0 0 0.5
0 1 0 | 0.5 -1 0.75
0 0 1 | 0 0.5 -0.5
The second half of the matrix is the INVERSE matrix
0 0 0.5
0.5 -1 0.75
0 0.5 -0.5
Note that the Inverse calculator can tell if a nxn matrix is invertible by checking if there are pivots = n. If a matrix is NOT invertible then it will not display any result and say that the matrix is not invertible.
The transpose of a matrix is when the columns of the matrix becomes the rows and the rows becomes the columns. To get a clear picture of it, here's an example:
2 4 6 1
8 0 2 2
4 6 8 3
The transpose of the matrix is:
2 8 4
4 0 6
6 2 8
1 2 3
The Determinant can only work for square matrices (nxn matrices). There are different ways to find the determinant but in this calculator, the determinant is calculated during reduced row reduction. The reduced row reduction formula for the determinant is as follows:
Row Swapping -If a row is swapped, the determinant will be negative. If the row swap occurs an even number of times, then the determinant will stay positive.
Scaling -When a row is multiplied by a scalar c, the determinant is ALSO multiplied by c.
Row Replacement -When row replacement occurs, nothing happens to the determinant
Once the matrix is in its reduced form, the calculator checks if the matrix's columns are linearly independent meaning, if there is a pivot in every column(and row). If the matrix is NOT linearly independent, then the determinant is 0. If the matrix IS linearly independent then the determinant is the reciprocal of the product of scalars and is negative depending on how many times Row Swapping occured.
For example, if the user inputted this matrix below:
2 4 6
8 0 2
4 6 8
The calculator will display the determinant value which is 40. Why 40? During the row reduction, the rows has been swapped an even number of times and the scalars, (1/2), (1/16), and (4/5) were all multipied together to get (1/40). The reciprocal of (1/40) is 40. The reciprocal occurs because the matrix in its reduced form is linearly independent, therefore the determinant cannot be 0.
The Null Space calculator doesn't produce a matrix nor a value. It produces a basis or a set of vectors. The Null Space is calculated by putting the matrix in reduced row echelon form. After the matrix is in reduced form, the calculator checks if there are free columns. Free Columns are columns that doesn't have a pivot. If all of the matrix's columns are linearly independent, then the Null Space is an empty set.
If there are free columns, then free variables exist and the Null Space is not empty. Usually we put the matrix in parametric vector form and get add the parametric vectors into the Null Space basis, but in this calculator, it uses a different algorithm. It NEGATES the numbers in the free column and add a 1 to the nth spot in the nth column. The vectors in the Null Space has the same number of elements as the number of columns.
For example, if a user inputted this matrix below:
2 4 6 8
0 0 0 0
0 1 2 4
The reduced matrix will look like this:
1 0 -1 -4
0 1 2 4
0 0 0 0
There are free columns on columns 3 and 4 of the reduced matrix. Column 3 has [-1, 2 0]. The 1 must be added on the 3rd spot which will produce [-1, 2, 1, 0]. The elements (except the added 1) must also be negated which will produce [1, -2, 1, 0], and this vector will be added to the Null Space. The same goes with Column 4 which is [-4, 4, 0]. The 1 must be added on the 4th spot which will produce [-4, 4, 0, 1] and the elements (except the added 1) must be negated which will produce [4, -4, 0, 1]. This vector is also added in the Null Space, hence the Null Space is { [1,-2,1,0], [4,-4,0,1] }
The Column Space calculator produces a basis or a set of vectors. A matrix in reduced form is needed to calculate the Column Space because the calculator will check which columns are pivot columns. If there are no pivot columns then the Column Space is empty. Pivot columns are added to the Column Space but the pivot columns in the basis are NOT reduced.
For example, if a user inputted this matrix below:
2 4 6 8
0 0 0 0
0 1 2 4
The Column Space will be {[2,0,0], [4,0,1]}, which is the first two columns of the matrix. This is because in the matrix's reduced form only the first 2 columns are pivot columns.
The Row Space calculator functions like Column Space except that it produces a set of pivot rows in reduced form. If there are no pivot rows then the Row Space is empty.
For example, if a user inputted this matrix below:
2 4 6 8
0 0 0 0
0 1 2 4
The Row Space will be {(1, 0, -1, -4), (0, 1, 2, 4)} because these are the pivot rows in the reduced form of that matrix:
1 0 -1 -4
0 1 2 4
0 0 0 0
The Rank of a matrix is the number of pivot columns in a matrix, or in other words, the dimension of Column Space or Row Space. The dimension of a basis is the number of elements in that basis. Since Column Space consist of all pivot columns, then the dimension of Column Space is the number of pivots. The number of pivots represents the Rank.
For example if a user inputted this matrix:
2 4 6
8 0 2
4 6 8
The Rank will be 3 because the matrix in reduced form has 3 pivot columns.