At least the 2nd and 3rd solutions are correct. Your design matrix has dependent variables. For example the third column can be expressed in terms of the first two columns $x_3 = 0.15 + 0.45 x_2$ and the equation can also be expressed as $$\begin{array}{} -0.2 + 0.4 x_ 1 + 1.2 x_3 &=& -0.2 + 0.4 x_ 1 + 1.2 (0.15 + 0.45 x_2) \\ &=& -0.2 + 0.4 x_ 1 + 1.2 (0.15 + 0.45 x_2)\\ &=& -0.02 + 0.94 x_1 \end{array}$$ This right hand side is the solution given by the 2nd and 3rd methods which probably drop one of the columns. In R you get the same behavior when we use the function `lm` which gives as output > lm(y~X+0) Call: lm(formula = y ~ X + 0) Coefficients: X1 X2 X3 -0.02 0.94 NA The last column is ignored when you give a computer the task to solve the equation. Your 1st method probably attempts to inverse the (non-invertible) matrix anyway and gives some output that is close but not exact (possibly due to round of errors). $-254.4 + 1696\cdot 0.15 \approx 0$ and $-762.3 + 1696*0.45 = 0.9$