a <- matrix(c(34,-14,-9,-14,56,3),2,3,byrow=T)
show(a) [,1] [,2] [,3]
[1,] 34 -14 -9
[2,] -14 56 3
Sam Hutchins
October 10, 2023
Well, I assumed I was off to a semi-okay start, but now it seems I may have to take a step back. What that means is I need to refresh myself on linear algebra before moving forward. I realized this as I started to delve into (Nielsen and Chuang 2010), considered the Mike&Ike reference for Quantum Mechanics.
The method I will attempt is to tie into the following electronics problem for a more real-world application of matrices, as I also have done in The Matrix post. Suppose we have a somewhat trivial circuit which we must determine the current flow and direction. Such a circuit is depicted below.

We are only dealing with voltages and resistances here, although it is trivial to determine individual voltage drops and current for each resistance and determine total circuit resistance. However, here we wish to determine the direction and value of current for each circuit branch. This is a function of simultaneous equations, where we will enter the values into a matrix. We can use two methods, one where a matrix and a vector are multiplied, or where the augmented matrix is directly solved. Firstly, we show the two equations we wish to solve.
\[\begin{equation} \begin{split} +34 -14 = -9 \\ -14 +56 = +3 \end{split} \end{equation}\]
where the matrix representation is such
\[\begin{bmatrix} 34& -14& -9 \\ -14& 56& 3 \end{bmatrix}\]
I will use the R library, matlib, for this as that is exactly what it was designed for. This will save a bit of time. Some commands to do this could be as follows.
We could have done the matrix and vector separately, as so,
but the first example is more to the point, I think. The matlib function, Solve() shows the equivalent result, so the method used is just personal preference.
As can be seen, the actual current flow is reversed from the arrows1. Basically, what Solve() does is what’s called a Reduced Row Echelon Format (RREF), and displays the result, which in this case is shown above, and plotted below. The left is the first method, the second on the right. As you see, both are identical.
34*x[1] - 14*x[2] = -9
-14*x[1] + 56*x[2] = 3
34*x[1] - 14*x[2] = -9
-14*x[1] + 56*x[2] = 3

The equations with the two unknowns have a unique solution as all lines intersect to a point. This subject could also lead into vector spaces of Least Squares, another subject of which I have a very loose grasp. More studying required, for both subjects. Most likely, lots of studying.
I don’t wish to duplicate the procedures in The Matrix post, so will leave off here. Have a great day in the Lord Jesus, and may He be your personal Lord and Savior! God Bless! Until next time…
A negative value for the example shows the current loop arrows should be drawn in the opposite direction.↩︎