# Student exercise for Week 2¶

## Get the mth309 module¶

http://blue.math.buffalo.edu/309/mth309.py

To find out where Jupyter is keeping the notebook files you can type "pwd".

Use Shift-Enter to execute a cell.

In [1]:
pwd

Out[1]:
'/home/ringland/public_html/309'

## Row echelon forms¶

First import everything from the mth309 module:

In [2]:
from mth309 import *


If you didn't get an error message, then that worked!

The mth309 module contains functions to create a matrix of rational numbers, and to obtain a row echelon form and the reduced row echelon form of such a matrix.

In [3]:
A = Matrix( [[1,2,3,4,5],[9,8,7,6,1],[1,1,1,1,1]] )
A

Out[3]:
 1 2 3 4 5
9 8 7 6 1
1 1 1 1 1

In [4]:
re(A)

Out[4]:
 1 2 3 4    5
0 1 2 3 22/5
0 0 0 0    1


(The re function in mth309 scales the rows of the row echelon form to make the leading entries 1, though this is not officially required.)

In [5]:
rre(A)

Out[5]:
 1 0 -1 -2 0
0 1  2  3 0
0 0  0  0 1


It's that simple!

In [ ]: