library(matlib)
A <- matrix(data = c(2, -1, 5,
-4, 2, -10), nrow = 2, ncol = 3, byrow = T)
t1 <- matrix(data = c(2, 3), nrow = 2, ncol = 1, byrow = F)
B <- cbind(A, t1)
# Row-reduced form of B:
echelon(B)
## [,1] [,2] [,3] [,4]
## [1,] 1 -0.5 2.5 0
## [2,] 0 0.0 0.0 1
The above system is inconsistent.
t2 <- matrix(data = c(4, -8), nrow = 2, ncol = 1, byrow = F)
C <- cbind(A, t2)
# Row-reduced form of B:
echelon(C)
## [,1] [,2] [,3] [,4]
## [1,] 1 -0.5 2.5 2
## [2,] 0 0.0 0.0 0
From the above we see that the solution is of the form v1 + v2 + v3 where
\[ {v1} = \left[\begin{array} {rrr} 2\\ 0\\ 0 \end{array}\right] \]
\[ {v2} = k1\left[\begin{array} {rrr} 0.5\\ 1\\ 0 \end{array}\right] \]
\[ {v3} = k2\left[\begin{array} {rrr} -2.5\\ 0\\ 1 \end{array}\right] \]
and k1, k2 are independent variables.