Example 4
In[17]:=
Clear[g,h]
g={{2,1,1,-2},{3,-2,1,-6},{1,1,-1,-1},{6,0,1,-9},{5,-1,2,-8}};
h={{1},{-2},{-1},{-2},{3}};
MatrixForm[g]
MatrixForm[h]
Out[17]=
2 1 1 -2 3 -2 1 -6 1 1 -1 -1 6 0 1 -9 5 -1 2 -8
Out[18]=
1 -2 -1 -2 3
In[19]:=
gh=AppendRows[g,h];
MatrixForm[gh]
Out[19]=
2 1 1 -2 1 3 -2 1 -6 -2 1 1 -1 -1 -1 6 0 1 -9 -2 5 -1 2 -8 3
In[20]:=
MatrixForm[RowReduce[gh]]
Out[20]=
17
-(--)
1 0 0 11 0
9
--
0 1 0 11 0
3
--
0 0 1 11 0
0 0 0 0 1
0 0 0 0 0
The last row of zeros presents no problems. The second last row is troublesome. It says
0x1+0x2+0x3+0x4=1, which is impossible. This system has no solutions.
Notice that the last column is a pivot column!!!
I do not want to leave you with the impression that the size of the matrix determines whether or not we have a solution or the number of solutions. Consider the following: