Linear Algebra - elimination and linear systems By given this matrix:
\begin{pmatrix}1&1&1&0\\2&3&k&1\\3&k&5&1\end{pmatrix}
I need to find, what are the values of k the system has infinity/single/no solution.
So I did elimination and I got:
\begin{pmatrix}1&1&1&0\\0&1&k-2&1\\0&k-4&4-k&0\end{pmatrix}
As one can see, for k=4 there are infinity solutions and for any k which is not 4 there is only a single solution.
But my friend told me that for k=1 there's no solution.
So what I did wrong? I have a mistake at the elimination procces?
I'd like to get some help.
Thanks.
 A: Your elimination is correct, 
For k=4 there are infinite solutions because the last row disappears. For k=1, there is no solution, because the second and third row contradict. You would get in terms of the variables $x_1,x_2,x_3$ the following:
In the second row $x_2 -x_3 = -1$ and in the third row $-3(x_2-x_3) = 0$, which shows there is no such $x_2$ and $x_3$.
A good way to answer this, is by building the determinant of the system matrix $A$. Represent your system as $Ax=b$, where 
\begin{align}
A &= \begin{pmatrix}1&1&1\\0&1&k-2\\0&k-4&4-k\end{pmatrix}\\
b &= \begin{pmatrix}0\\1\\0\end{pmatrix}.
\end{align}
Building the determinant gives you $det(A) = (4-k)-(k-4)(k-2) = (4-k)(k-1)$ and has the roots $k=1$ and $k=4$. This means for every $k\neq 1,4$ there is a solution, since your system matrix $A$ is is invertible, thus $x = A^{-1}b$. For $k=1$ and $k=4$, you have to check if the vector $b$ lies in the range of $A$, which you can do as I mentioned above.
A: Your elimination is not finished:
$$
\begin{pmatrix}1&1&1&0\\0&1&k-2&1\\0&k-4&4-k&0\end{pmatrix}
\to
\begin{pmatrix}1&1&1&0\\0&1&k-2&1\\0&0&(4-k)(k-1)&4-k\end{pmatrix}
$$
(sum to the third column the second column multiplied by $4-k$).
Now, if $k=4$ the third row is zero, so the system has infinitely many solutions; if $k=1$ the fourth row is $\begin{bmatrix}0&0&0&3\end{bmatrix}$, so the system has no solution. If $k\ne4$ and $k\ne1$ the system has unique solution.
A: You have obtained
$$\left(\begin{array}{ccc|c}
  1 & 1 & 1 & 0 \\
  0 & 1 & k-2 & 1 \\
  0 & k-4 & 4-k & 0 
\end{array}\right)$$
and correctly explained what happens for $k=4$.
Now let us have a look at the case $k\ne 4$. In this case $k-4\ne0$ and you can divide the last row by $(k-4)$:
$$\left(\begin{array}{ccc|c}
  1 & 1 & 1 & 0 \\
  0 & 1 & k-2 & 1 \\
  0 & k-4 & 4-k & 0
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
  1 & 1 & 1 & 0 \\
  0 & 1 & k-2 & 1 \\
  0 & 1 & -1 & 0
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
  1 & 1 & 1 & 0 \\
  0 & 0 & k-1 & 1 \\
  0 & 1 & -1 & 0
\end{array}\right)
$$
Now for $k=1$, the second row corresponds to the equation $0x_1+0x_2+0x_3=1$; which obviously has no solution.
For $k\ne1$ you can divide the second row by $(k-1)$ and you get unique solution. 
You can even compute the solution if you with to do so:
$$
\left(\begin{array}{ccc|c}
  1 & 1 & 1 & 0 \\
  0 & 0 & k-1 & 1 \\
  0 & 1 & -1 & 0
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
  1 & 1 & 1 & 0 \\
  0 & 0 & 1 & \frac1{k-1} \\
  0 & 1 & -1 & 0
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
  1 & 1 & 0 & -\frac1{k-1} \\
  0 & 0 & 1 & \frac1{k-1} \\
  0 & 1 & 0 & \frac1{k-1}
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
  1 & 0 & 0 & -\frac2{k-1} \\
  0 & 1 & 0 & \frac1{k-1} \\
  0 & 0 & 1 & \frac1{k-1} \\
\end{array}\right)
$$
So the unique solution (for $k\ne1,4$) is $x_1=-\frac2{k-1}$, $x_2=\frac1{k-1}$, $x_3=\frac1{k-1}$.
You can plug these values into the original system and check that $x_1+x_2+x_3=0$, $2x_1+3x_2+kx_3=\frac{-4+3+k}{k-1}=1$ and $3x_1+kx_2+5x_3=\frac{-6+k+5}{k-1}=1$; so it is indeed a solution. 
If you also want to describe the solution set for the parameter $k=4$, you have to solve this case separately.
