Trouble finding the values of a matrix using rref

140 Views Asked by At

I'm working on a school project in which I have to get all the values of a missing matrix. To make a small test in my program, I used a simplified example just to see if the math was right, but for some reason I can't get it working. I'm trying to get all the values of a matrix $(a,b,c,d)$ so that:

Ex 1:

$$ \begin{bmatrix}248 \\ 172\end{bmatrix} = \begin{bmatrix}2 & 4 \\ 3 & 1\end{bmatrix} \begin{bmatrix}a & b \\c & d\end{bmatrix}\begin{bmatrix}4 \\ 8\end{bmatrix} $$

Ex 2: $$ \begin{bmatrix}148 \\ 132\end{bmatrix} = \begin{bmatrix}2 & 4 \\ 3 & 1\end{bmatrix} \begin{bmatrix}a & b \\c & d\end{bmatrix}\begin{bmatrix}7 \\ 1\end{bmatrix} $$

To get those values above, I set the $a,b,c$ and $d$ to $5,3,2$ and $4$ respectively : \begin{bmatrix}5 & 3 \\ 2 & 4\end{bmatrix}

In order to solve the problem I multiply everything, which resulted in :

Ex1:

$$ \begin{bmatrix}148 \\ 132\end{bmatrix} = \begin{bmatrix}14a + 28c + 2b + 4d \\ 21a+7c+3b+1d\end{bmatrix} $$

Ex 2: $$ \begin{bmatrix}248 \\ 172\end{bmatrix} = \begin{bmatrix}16a + 32c + 8b + 16d \\ 24a+8c+12b+4d\end{bmatrix} $$

At this point the only thing I could think of, as the process above resulted in 4 equations, was creating a matrix with all the values in it, and apply the rref (Reduced row echelon form) on it :

$$ \begin{bmatrix}14a & 28c & 2b & 4d & 148 \\ 21a & 7c & 3b & 1d & 132 \\ 16a & 32c & 8b & 16d & 248\\ 24a & 8c & 12b & 4d & 172\end{bmatrix} = \begin{bmatrix}1 & 0 & 0 & 0 & 5.4 \\ 0 & 1 & 0 & 0 & 1.6 \\ 0 & 0 & 1 & 0 & 0.2\\ 0 & 0 & 0 & 1 & 6.8\end{bmatrix} $$

Why am I finding those $5.4, 1.6, 0.2$ and $6.8$ values instead of the original ones $(5,3,2,4)$?