I am learning about applications of systems of equations in my applied matrix theory. I am trying out some of the practice exercises around the "balancing chemical equations using systems of equations" and I am getting stuck and not really sure how.
Here are the two problems I am trying:
$$KNO_{3} + H_{2}CO_{3} \rightarrow K_{2}CO_{3} + HNO_{3} $$
and;
$$AgI + Na_{2}S \rightarrow Ag_{2}S + NaI $$
Now I know just from taking chemistry that the first equation is balanced by adding a 2 to $KNO_{3}$ and $HNO_{3}$ and for the second one adding a 2 to $AgI$ and $NaI$. But I have to be able to do it with setting up a system of equations.
I will show you the steps I took for both with the first reaction because I somehow got almost the same exact result, and it simply doesn't make sense.
Going from the first reaction we add the variables to each part of the reaction on the left and right as so;
$$xKNO_{3} + yH_{2}CO_{3} \rightarrow zK_{2}CO_{3} + wHNO_{3} $$
from here it is pretty simple to set up my system;
$$K: x=2z \rightarrow x-2z = 0$$ $$N: x=w \rightarrow x-w = 0$$ $$O: 3x + 3y=3z+3w \rightarrow 3x+3y-3z-3w=0 $$ $$H: 2y=w \rightarrow 2y-2=0$$ $$C: y=z \rightarrow y-z=0$$
resulting in the following matrix; $$\begin{bmatrix} 1 & 0 & -2 & 0 &| 0 \\ 1 & 0 & 0 & -1 &| 0 \\ 3 & 3 & -3 & -3 &| 0 \\ 0 & 2 & 0 & -1 &| 0 \\ 0 & 1 & 1 & 0 &| 0 \\ \end{bmatrix}$$
Which reduced to RREF, this is where it doesnt make sense, is;
$$\begin{bmatrix} 1 & 0 & 0 & 0 &| 0 \\ 0 & 1 & 0 & 0 &| 0 \\ 0 & 0 & 1 & 0 &| 0 \\ 0 & 0 & 0 & 1 &| 0 \\ 0 & 0 & 0 & 0 &| 0 \\ \end{bmatrix}$$
The first problem that I can tell is that I have a matrix m = 5 but only 4 variables. Secondly, this is saying that every variable is equal to 0. Which I know isn't true. The second reaction ends up the same way producing an identity matrix. I am not really sure what I am doing wrong and if I go back to the example problem in the book (https://open.umn.edu/opentextbooks/textbooks/213 , Chapter 1.2) They did the exact same thing I did but were able to get a usable RREF. I also tried REF but it had a similar issue, but i was getting more of 1/2x = 0.
Sorry for the long post, just wanted to make sure I was as clear as possible in the question and listed out everything I did in some detail as best I could. I don't have any problems with anything in my Applied Matrix Theory class except the Applied part haha. Thanks in advance for the help!