Just to avoid the apparent confusion about the earlier thread, I'm not describing a problem I'm having and asking for help. This is more of a challenge, but it's not exactly that, either. I'm trying to show methods for dealing with these systems, and it will be more interesting if people play along with me.

But, in particular, I'm trying to show just how capable the HP48G and descendants are for linear algebra problems. Any of these techniques can be done on Matlab or Mathematica or Maple, but that's not what this forum is about.

I'm going to demonstrate techniques that only such a powerful calculator, our well beloved HP48G can do so easily. The lesser calculators won't be able to do some of these with only a few keystrokes, but with a lot of programming, in theory they could follow along.

It's a kind of mirabile dictu sort of thing. If you don't speak Latin, look it up on the web.

I gave a linear system in another thread.

Previously, we had A:

[[ 4. 2. 3. 3. ]

[ 5. 2. 6. 6. ]

[ 9. 2. 5. 3. ]

[ 4. 9. 4. 9. ]]and B:

[[ 22.1743265837 ]

[ 33.8228271732 ]

[ 34.6819580525 ]

[ 51.0426400707 ]]

I asked the reader to solve the system A*X=B

This system has an infinite number of solutions, but there is one solution with the smallest Euclidean norm, which gives a measure of the "size" or "length" of the solution vector. I will use the Euclidean norm whenever I speak of the norm of a solution, the residual of the solution, or the distance between two matrices or vectors. The ABS function on the HP50 calculates this norm. It is the square root of the sum of the squares of the elements. If I use another norm, I will distinguish it.

The LSQ function on the HP50 can find this solution (with flag -54 cleared):

[[ 2.01952510743 ]

[ 2.23362533599 ]

[ 1.20500296581 ]

[ 2.00465552820 ]]

Now, to move on, consider a slight perturbation of the A matrix. Change the (2,1) element from 5. to 5.00001. The system is no longer rank deficient (singular), and it now has a single exact solution. But it does have a high condition number, about 50 million or so, depending on how you calculate it. This means that a solution calculated with a standard linear solver (SLS), (which as I do it consists of putting B on level of the stack, A on level 1 and pressing the divide key), will incur errors sufficient to lose about 8 to 9 digits of accuracy in the solution.

My HP50 gets:

[[ 1.997894004E-5 ]

[ 5.26288302879 ]

[ 6.25376578705 ]

[ -2.37093891693 ]]

This is very much different from the minimum norm solution for the unperturbed system.

The LSQ command gets essentially the same solution, with some differences due to the high condition number.

This doesn't seem desireable (for reasons I will give later), that there should be such drastic changes in the solution for such a small perturbation.

Let me emphasize that the mathematically exact solution is essentially the same as the one we got (shown above) for the perturbed system. I'm not saying that it isn't, or that it shouldn't be, this different. After all, the perturbed system is no longer rank deficient, and therefore *has* an exact solution; the exact solution is what it is.

But, perhaps there is an approximate solution with certain more favorable properties.

I have to go now, but I'll be back.

In the meantime, play with the numbers. In particular, see what happens if you add 1% random noise to the A matrix elements and re-solve the system. Test what happens to the residual norm when noise is added to the A matrix, and to the B matrix.