From: Saturn rising on
Previously...

Solving 'A*X=B' via LSQ for

[[ 1 1 0 0 0 -1 ]
[ 1 0 -1 0 1 0 ]
[ 0 1 1 1 0 0 ]
[ 0 0 0 1 1 1 ]] 'A' STO

[[ 4 ]
[ 8 ]
[ 12 ]
[ 16 ]] 'B' STO

Although this case is labeled "under-determined,"
the rows of [A] are linearly dependent
(row4 = row2 + row3 - row1),
hence there do not exist "solutions" for an arbitrary [B],
even though there are "solutions" for this particular [B],
with the "minimum-norm solution" being:

[[ 3 ]
[ 4 ]
[ 1 ]
[ 7 ]
[ 6 ]
[ 3 ]]

In response to my slightly altering 'B'
(so that no "solutions" exist) and recalculating,
Rodger Rosenbaum said:

> Try this experiment:
> Perturb the last element of the B matrix more and more;
> let it become 16.000000001, 16.00000001, 16.0000001, 16.000001, etc.
> Repeatedly solve the system A*X=B with LSQ, where B is
> incrementally perturbed. Look at what the solutions are doing.

Okay, I've incrementally perturbed until "16" has become "17,"
and the result of B A LSQ is now... still wrong (Rodger's "bug"),
but using B B + A A + LSQ gets the right result, which is:

[[ 3 ]
[ 4 ]
[ 1 ]
[ 7.25 ]
[ 6.25 ]
[ 3.25 ]] 'X' STO

In which case 'A*X' is:

[[ 3.75 ]
[ 8.25 ]
[ 12.25 ]
[ 16.75 ]]

And "residual" 'B-A*X' is:

[[ .25 ]
[ -.25 ]
[ -.25 ]
[ .25 ]]

Now that we have the "right answers,"
there still remains the question:

What did LSQ minimize?

It did not "minimize the length of X
over all solutions [i.e. where 'A*X=B']
of the 'under-determined' system,"
because there are no such "solutions," not even approximately,
so what does this result really mean?

> Certainly there are no "exact solutions,"
> but there are "approximate solutions,"
> and there is only one minimum norm approximate solution.
> And that is what LSQ is supposed to find.

The AUR actually says the right thing,
which seems to be that no matter what the input,
LSQ may be said to solve the following two consecutive problems:

1. First find the "minimum-norm" possible residual ('B-A*X'), then
2. Find the "minimum norm" X giving that value of the residual.

The misleading words "over-determined," "under-determined," and "solution"
should probably not be used in the description of LSQ.

Meanwhile, it remains a mystery why, in this particular case
which Rodger discovered, B A LSQ flies off into absurd results,
while B B + A A + LSQ gets the right result.

As Rodger's relentless detective work uncovered,
this previously undiscovered flaw
existed even in the original HP48G[X],
as well as persisting in the HP49/50 series -- we already know
to have "no confidence" in answers given by the modern HP49/50,
but now even the reputation of Wickes' original team is spoiled,
which unfortunately mimics many situations in history and politics :)

-=-=-=-