# Simplest solver for linear equation systems

Normally, this boards sees a lot of traffic about the most efficient and most powerful solvers for huge linear equation systems. But this time, I have the opposite problem:

I need to implement a solver for a linear equation system in a very limited programming system that offers only basic array functionality and no linear algebra whatsoever. Efficiency and scalability is not an issue as the systems have a single-digit number of unknowns. What is way more important is that it's easy to implement and to fully understand with the most basic linear algebra knowledge.

So I'm looking for the simplest algorithm for:

• Direct solution of the system Ax = b with a full rank A
• Iterative solution of the system Ax = b with A not necessarily full rank, but with a good initial guess for x.
• If your system is single-digit small (less than 10 x 10), closed-form expressions (the way you would do it by hand) for the matrix inverse, followed by a matrix-vector product are good enough. This is as simple as you're going to get. In fact, many sophisticated libraries (e.g. Eigen) do this for small fixed sizes such as 4x4, as it is also the fastest method. – Charlie S Apr 8 at 14:15
• There's no point in using an iterative method on a system of equations with fewer than 10 unknowns. – Brian Borchers Apr 8 at 15:45