# 213 - A4.5 - Undetermined Systems

## 1535 days ago by Professor213

John Travis

Mississippi College

These are some transportation problems from Lay's Linear Algebra text.

var('o1,o2,o3,o4,i1,i2,i3,i4,m') assume(o1+o2+o3+o4==i1+i2+i3+i4) a=matrix([[1, 1, 0, 0, 0, 0, o1+o2], [0, -1, 1, 0, 0, 0, m], [0, 0, -1, 1, 0, 0, o3-i1], [0, 0, 0, -1, 1, 0, o4-i2], [0, 0, 0, 0, -1, 1, -1*m], [-1, 0, 0, 0, 0, -1, -1*i3-i4]]); print a print show(a.echelon_form())
 [ 1 1 0 0 0 0 o1 + o2] [ 0 -1 1 0 0 0 m] [ 0 0 -1 1 0 0 -i1 + o3] [ 0 0 0 -1 1 0 -i2 + o4] [ 0 0 0 0 -1 1 -m] [ -1 0 0 0 0 -1 -i3 - i4]  [ 1 1 0 0 0 0 o1 + o2] [ 0 -1 1 0 0 0 m] [ 0 0 -1 1 0 0 -i1 + o3] [ 0 0 0 -1 1 0 -i2 + o4] [ 0 0 0 0 -1 1 -m] [ -1 0 0 0 0 -1 -i3 - i4] 
var('o1,o2,o3,o4,i1,i2,i3,i4,m') a=matrix([[1, 1, 0, 0, 0, 0, 850], [0, -1, 1, 0, 0, 0, 400], [0, 0, -1, 1, 0, 0, 850], [0, 0, 0, -1, 1, 0, 1150], [0, 0, 0, 0, -1, 1, -400], [-1, 0, 0, 0, 0, -1, -2850]]); print a print show(a.echelon_form())
 [ 1 1 0 0 0 0 850] [ 0 -1 1 0 0 0 400] [ 0 0 -1 1 0 0 850] [ 0 0 0 -1 1 0 1150] [ 0 0 0 0 -1 1 -400] [ -1 0 0 0 0 -1 -2850]  [ 1 1 0 0 0 0 850] [ 0 -1 1 0 0 0 400] [ 0 0 -1 1 0 0 850] [ 0 0 0 -1 1 0 1150] [ 0 0 0 0 -1 1 -400] [ -1 0 0 0 0 -1 -2850] 
var('a,b,c') a=5 b=6 c=3 A=matrix([[2,2,a], [-2,1,b], [1,-1,c]]); print A print show(A.echelon_form())
 [ 2 2 5] [-2 1 6] [ 1 -1 3]  [ 2 2 5] [-2 1 6] [ 1 -1 3] 
m=matrix(QQ,2,3,[1,2,3,4,5,6]); m; m.parent()
 [1 2 3] [4 5 6] Full MatrixSpace of 2 by 3 dense matrices over Rational Field [1 2 3] [4 5 6] Full MatrixSpace of 2 by 3 dense matrices over Rational Field
m=matrix(QQ,2,2,1); m; m.parent()
 [1 0] [0 1] Full MatrixSpace of 2 by 2 dense matrices over Rational Field [1 0] [0 1] Full MatrixSpace of 2 by 2 dense matrices over Rational Field
# vandermonde matrix x = [2,4,5,-1] n = len(x) m = matrix(QQ, n, n, lambda i, j: x[i]^j) show(m)
len(x)
 4 4