Section 1.5 Generate your own matrices with prescribed properties
While you have learned that every matrix has a unique reduced row-echelon form, many times the RREF has complicated looking entries. This algorithm generates a random matrix whose RREF has integer entries. We have specified the number of non-zero rows in the RREF (=rank) and told it to try to find a matrix whose entries are no larger than 20 in absolute value. Should Sage fail to produce a matrix, increase the upper bound or remove it altogether.
xxxxxxxxxx
%display latex
latex.matrix_delimiters("[", "]")
A=random_matrix(QQ,5,7,algorithm='echelonizable', rank=4,
upper_bound=20); A
xxxxxxxxxx
A.rref()
You can keep on generating new matrices by clicking the
Evaluate (Sage)
button. Try to find one where the rref has leading ones which skip a column.