Row reduction to echelon form in ℤ/pℤ: Rref

### 5.35.7 Row reduction to echelon form in ℤ/pℤ: Rref

In Xcas mode, Rref is simply the inert form of rref; namely, it returns rref without evaluating it. (See Section 5.56.3.) In Maple mode, the Rref command can additionally be used in conjunction with mod to find the reduced row echelon form of a matrix whose elements are in ℤ/pℤ.

- (In Maple mode.)
  Rref takes one argument:
  A, a matrix with elements in ℤ/pℤ.
- Rref(A) returns the reduced row echelon form of A.

#### Example

Solve in ℤ/13ℤ:

⎧ ⎨ ⎩ |
x + 2 · y | = | 9
3 · x +10 · y | = | 0

Input (in Xcas mode):

Rref([[1,2,9] mod 13,[3,10,0] mod 13])

Output:

rref | ⎛ ⎜ ⎜ ⎜ ⎝ | ⎡ ⎢ ⎢ ⎢ ⎣ |
1%13 | 2%13 |
⎛ ⎝ | −4 | ⎞ ⎠ | %13
3%13 |
⎛ ⎝ | −3 | ⎞ ⎠ | %13
| 0%13
| ⎤ ⎥ ⎥ ⎥ ⎦ | ⎞ ⎟ ⎟ ⎟ ⎠

To actually get the reduced echelon form, you can enter:
Input:

eval(ans())

Output:

⎡ ⎢ ⎣ |
1%13 | 0%13 | 3%13
0%13 | 1%13 | 3%13
| ⎤ ⎥ ⎦

and conclude that x=3%13 and y=3%13.
Input (in Maple mode):

Rref([[1,2,9],[3,10,0]] mod 13)

Output:

⎡ ⎢ ⎣ |
1 | 0 | 3
0 | 1 | 3
| ⎤ ⎥ ⎦

and again conclude that x=3%13 and y=3%13.