### 11.9.7 Row reduction to echelon form in ℤ/pℤ

In Xcas mode, Rref is simply the inert form of rref; namely, it returns rref without evaluating it (see Section 15.7.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 A, a matrix with elements in ℤ/pℤ.
- Rref(A) returns the reduced row echelon form of A.

#### Example

Solve in ℤ/13ℤ:

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

Input in Xcas mode:

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

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

To actually get the reduced echelon form, enter:

eval(ans())

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

Input in Maple mode:

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

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

In both cases you conclude that x=3%13 and y=3%13.