Stuck at calculating solution to matrix equation

79 Views Asked by At

enter image description here

Hello! I am super stuck about how to calculate $C$ and $D$ in the example image, I know it's something simple I just can't figure it out!

1

There are 1 best solutions below

1
On BEST ANSWER

Let's say you're given the matrix equation $Mx=b$. What does this mean? There are several ways of interpreting it, but the simplest is just as a compact way of writing a system of linear equations. For instance $$\begin{bmatrix} 1 & 3 \\ 2 & -14\end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 3 \\ -2\end{bmatrix}$$ means exactly the same thing as the system of equations $$\begin{cases} x+3y = 3 \\ 2x-14y=-2\end{cases}$$

Thus why there is an "or" in your in the first set of equations in your question.


Next we consider what type of problem this is. It's a least squares problem. That means that your original equation $$\begin{bmatrix} 1 & -2 \\ 1 & 0 \\ 1 & 2\end{bmatrix}\begin{bmatrix} C \\ D \end{bmatrix} = \begin{bmatrix} 1 \\ 2 \\ 4\end{bmatrix}$$ probably does not have an exact solution. In fact you can verify this for yourself. However, it does have something like the closest thing to a solution -- that's called the least squares solution to the equation. It is found by solving $A^TAx = A^Tb$ rather than the original $Ax=b$ equation. That's where that second matrix equation comes from.


Now how do we read off the solution to that second matrix equation? We do it by using what I said in the first section of this answer that I'm currently writing.

$$\begin{bmatrix} 3 & 0 \\ 0 & 8 \end{bmatrix} \begin{bmatrix} C \\ D\end{bmatrix} = \begin{bmatrix} 7 \\ 6 \end{bmatrix} \iff \begin{cases} 3C+0D=7 \\ 0C+8D=6\end{cases}$$

From here (by simplifying), it's clear that $C=\frac 73$ and $D=\frac 68 = \frac 34$.

This is the least squares solution to your original matrix equation. You can confirm for yourself that this doesn't actually solve your original equation -- because there is no solution to the original one -- but this is, in a sense, the closest one can get to a solution.