# Does the Least Linear Squares problem of the given matrix has solution?

Given $a_1,a_2,\gamma,b_1,b_1 \in\mathbb{R}$.

Say if the Linear Least Squares problem of the following matrix has solution and if yes how many? $$A= \begin{bmatrix} a_1 & \gamma a_1 \\ a_2 & \gamma a_1\\ \end{bmatrix}$$ $$b= \begin{bmatrix} b_1 \\ b_2 \end{bmatrix}$$

My answer is this: "According to one of the theorems if $A \in \mathbb{C}^{m\times n}$ and its range is maximum then its linear least squares problem has one solution and it is $A^*AX= A^*b$"

Now using the above theorem I said the problem of the least linear squares of the given matrix has unique solution since $\det(A)= \gamma a_1^2-\gamma a_1a_2 \neq 0$.

Is my solution correct? or should i have semplifed the above equation?

Thank you!

-
What if $a_1=0$? What if $\gamma=0$? What if $a_1=a_2$? –  Gerry Myerson Feb 14 '13 at 11:45
@GerryMyerson, Yes i should have added that condition as mentioned by Stefan Hansen below. –  tutak Feb 14 '13 at 11:55

## 1 Answer

The least squares problem has a unique solution if and only if $A$ has full rank. But since $A$ is a square matrix, then $A$ has full rank if and only if $A$ is invertible. So you're absolutely right about checking whether the determinant is non-zero. Note however, that $$\det(A)=\gamma(a_1^2-a_1a_2)$$ is indeed $0$ in any of the following cases

1. $\gamma=0$,
2. $a_1=0$,
3. $a_1=a_2$,

or any combination of these together.

-
So i should have added that the Least Linear squares problem has a unique solution provided that $\gamma\ \neg$ 0 , $a_1 \neg$ 0 and $a_1 \neg$ a_2. right? Thank you very much for the editing and answer. –  tutak Feb 14 '13 at 11:52
Yes (i take it that you meant $\neq$ three times). And you're welcome. –  Stefan Hansen Feb 14 '13 at 11:56
Yes, i meant not equal :) –  tutak Feb 14 '13 at 11:57