Linear Solver

Alex Schaefer, Matt Miller

Enter the information for the system MX=b here and execute the cell.
"n" is the number of unknowns you are working with. "M" is the matrix of equations, in the format {{eqn},{eqn},{eqn}...}. "b" is what each of the equations is equal to.

n = 3
M = {{-1, 1, 1}, {-1, 0, 1}}
b = {7, 5}

Execute this cell to see if there is a solution. An output of {x[1],x[2],...} means that no solution could be found.

X = Array[x, n]; 
X /. FindInstance[M . X == b && Min[X] > 1, X, 
        Integers]

The above corresponds to solving the system -x+y+z=7, -x+z=5, and returns the smallest integer solution with the property that each unknown is at least 2.