\[ \begin{aligned} 2x_1 +3x_2 +19x_3 −4x_4 = 2 \\ x_1 +2x_2 +12x_3 −3x_4 = 1 \\ −x_1 +2x_2 +8x_3 −5x_4 = 1 \end{aligned} \]

\[\begin{pmatrix} 2 & 3 & 19 & -4 & 2 \\ 1 & 2 & 12 & -3 & 1 \\ -1 & 2 & 8 & -5 & 1 \end{pmatrix} \\ \text {swap row1 with row2} \\ \begin{pmatrix} 1 & 2 & 12 & -3 & 1 \\ 2 & 3 & 19 & -4 & 2 \\ -1 & 2 & 8 & -5 & 1 \end{pmatrix} \\ \text {subtract 2*row1 from row2} \\ \begin{pmatrix} 1 & 2 & 12 & -3 & 1 \\ 0 & -1 & -5 & 2 & 0 \\ -1 & 2 & 8 & -5 & 1 \end{pmatrix}\\ \text {add row1 and row3} \\ \begin{pmatrix} 1 & 2 & 12 & -3 & 1 \\ 0 & -1 & -5 & 2 & 0 \\ 0 & 4 & 20 & -8 & 2 \end{pmatrix}\\ \text {add 4* row2 and row3} \\ \begin{pmatrix} 1 & 2 & 12 & -3 & 1 \\ 0 & -1 & -5 & 2 & 0 \\ 0 & 0 & 0 & 0 & 2 \end{pmatrix}\\ \text { This system does not have a solution because}\]

\[ 0x_1 + 0x_2 + 0x_3 −0x_4 = 2 \]

# The coefficient of the linear equations matrix
A <- matrix(c(2, 3, 19, -4, 1, 2, 12, -3, -1, 2, 8, -5), nrow = 3, byrow = TRUE)

# the right hand of the equations
B <- c(2, 1, 1)

# using least squares method to solve the equations.
result <- lm(B ~ A - 1)  

cat("Solution:", coef(result))
## Solution: 0.1212121 0.5454545 NA NA