Gauss row reduction of input Matrix
RowReduce(p, A, rows, cols, rcol, det, pdet, rank, sig, incrow, redflag)
mod p Matrix
number of rows, or range of rows to use
number of columns, or range of columns to use
number of columns that represent variables
name to use for output determinant; 0 to disable
name to use for output pseudo-determinant; 0 to disable
name to use for output rank; 0 to disable
name to use for output signature; 0 to disable
name to use for output inconsistent row count; 0 to disable
boolean or integer; indicate whether to reduce row echelon form, or for how many rows
The RowReduce function performs in-place Gauss elimination on the input mod p Matrix A. If redflag=false, it produces a row echelon form. If redflag=true, it produces a reduced row echelon form.
Generally, it is required that p be a prime, as inverses are needed, but in some cases it is possible to obtain row echelon form when p is composite. For the cases where row echelon form cannot be obtained for p composite, the function returns an error indicating that the algorithm failed because p is composite.
RowReduce can act on a sub-Matrix or augmented Matrix based on the values of rows, cols, and rcol. The parameters rows and cols can be integer values, or nonempty ranges with integer endpoints, which represent the total rows and columns (including any augmented columns) on which the row reduction should be performed. If specified as integer values, the range is assumed to start at 1.
For a standard n⁢x⁢m Matrix, augmented with two columns, specify rows=n, cols=m+2, and rcol=m. For a partially reduced n⁢x⁢n Matrix with one augmented column, where the first r rows have leading identity, the reduction of the remaining rows can be accomplished by specifying rows=r..n, cols=r..n+1, and rcol=n−r+1.
If the determinant of the Matrix being reduced is required, specify det as a name. Otherwise, specify det as the value 0. On output, the name specified for det is assigned the value of the determinant. If the input Matrix has more variable columns than rows, the determinant is computed from the square Matrix formed by removing the extra columns from the end of the Matrix. If the input Matrix has fewer variable columns than rows, an error is produced.
Note: If the determinant is not required, set det to zero to avoid unnecessary calculations.
The pseudo-determinant of a Matrix is the determinant of the Matrix formed by removing any dependent rows and parametric columns (up to sign). In cases where the input ( n⁢x⁢m ) Matrix is of full rank with respect to the first n⁢x⁢n submatrix, the determinant and pseudo-determinant are the same. Use this value for reconstruction of solutions of integer linear systems that are rank deficient or underdetermined.
If the pseudo-determinant of the Matrix being reduced is required, specify pdet as a name. Otherwise, specify pdet as the value 0. On output, the name specified for pdet is assigned the value of the pseudo-determinant. If the input Matrix has fewer variable columns than rows, an error is produced.
Note: If the pseudo-determinant is not required, set pdet to zero to avoid unnecessary calculations.
The signature of a Matrix is an integer checksum that represents the correspondence of the solving columns and corresponding rows in the row echelon or reduced row echelon form of a Matrix. If for two Matrices, the pattern of pivots (location of the leading 1 entries in each row) is the same, their signature is also the same. However, two signatures being equal does not necessarily mean the two Matrices have the same pattern of pivots. Use this value is rapidly detect bad homomorphisms for reconstruction of the solution of an integer linear system.
If the signature of the Matrix being reduced is required, specify sig as a name. Otherwise, specify sig as the value 0. On output, the name specified for sig is assigned the value of the signature.
If the rank of the Matrix being reduced is required, specify rank as a name. Otherwise, specify rank as the value 0. On output, the name specified for rank is assigned the rank of the Matrix.
Specifying incrow as a name accomplishes two things. Firstly, it indicates that the algorithm continues computation even if inconsistent rows are found, placing those rows immediately after the consistent rows in the Matrix upon completion. Secondly, it indicates that the algorithm assigns the number of inconsistent rows found to incrow upon completion. If you specify incrow=0, the algorithm halts with an error when inconsistent rows are found.
The redflag parameter controls whether the output should be a reduced row echelon form (true) or a standard row echelon form with no back-substitution (false). In addition to these all-or-nothing settings, one can specify that the first i rows of a matrix should have back-substitution performed on them if redflag is set to −i.
This command is part of the LinearAlgebra[Modular] package, so it can be used in the form RowReduce(..) only after executing the command with(LinearAlgebra[Modular]). However, it can always be used in the form LinearAlgebra[Modular][RowReduce](..).
For this basic augmented system, find the rank and determinant.
Check the determinant.
Check the solution.
Consider the system solution. Two steps looking at submatrices.
First step, working with the first two rows of B.
Work with the remaining two rows of B.
Back-substitute last two rows with entries in first two by using shortcut specification for last three columns.
Back substitution only acting on the first row
Download Help Document
What kind of issue would you like to report? (Optional)