Re: Linear Algebra Challenge



Here's a totally different approach.

I didn't get around to playing with this till a few days ago, but I
purposely did not look at any one else's solutions or methods till I
got my own result. My method is not nearly so elegant as the one
presented already, but sometimes it's nice to see another approach to a
solution. I tried my method on my 49g+, but it gave me "out of memory"
messages, so I resorted to Maxima. (Yeah, I know that defeated the
whole point, but I wanted to see if my method would actually work.)

Here's my matrix:

[[1.000049999763672,0.99998333321468,1.000016666561755,1.000049999908833]

[1.999974999990478,2.0000916666443,2.000008333243917,2.000024999843534]

[3.000000000133796,3.000000000044599,3.000099999955402,2.999999999866205]

[4.000025000277113,4.000008333444898,3.999991666666887,4.000074999888876]]

det = 2.1541106639860925E-19 dist = 9.128724506015161E-5

When I copy the matrix to the calculator, due to rounding, I get
det = -1.35600662188E-19 dist = 9.12872462812E-5

------------------------------------

And here's my brute force method:

I took the given matrix and added a variable to each term.

[[ 1.0001+a 1+b 1+c 1+d ]
[ 2+e 2.0001+f 2+g 2+h ]
[ 3+i 3+j 3.0001+k 3+l ]
[ 4+m 4+n 4+o 4.0001+p ]]

The distance between this matrix and original one will then be

dist = sqrt(a^2 + b^2 + c^2 + ... + p^2)

This dist function of 16 variables can be reduced to 15 by the
constraint that the determinant of the matrix has to be zero.

At this point, I tried using MSLV on my 49g+ to solve for the 15
variables using the 15 equations resulting from

grad(dist^2)=0

but the 49g+ gave an "out of memory" error message. This is when I
switched to Maxima. I wanted to try the same method on Maxima, but I
couldn't find any numerical multivariable solve like MSLV. (If anybody
knows how to do this with Maxima, please let me know.)

Since that didn't work I tried to minimize this dist function by
setting the square of the magnitude of the gradient of dist^2 to zero.

|grad(dist^2)|^2 = 0

To solve this hideous 15 variable expression, I wrote a multivariable
version of Newton's Method routine for Maxima. The function converged
VERY SLOWLY and it took several minutes per iteration -- it took hours
before I got a reasonable answer.

In the end the brute force method, while not elegant by any stretch of
the imagination, did work.

-wes

.



Relevant Pages

  • Re: finding minimum
    ... >I differentialted 1/2a with respect to a and set it equal to zero. ... Rewriting this, we have ... on, it should be s imple matter to check the maximum value ... maxima will be the global maximum. ...
    (sci.math)
  • Re: My problem in Maxima: The if-statement
    ... skrev i en meddelelse ... 0^0 or 0^also cause error messages in Maxima. ... again causes 'division by zero'. ...
    (sci.math)
  • Re: local maxima of a histogram
    ... James wrote: ... remove (or zero) that value, then calculate it again, down ... I have to find all the maxima, then test to see if any ... histogram data, you can use the 'max' command to tell MATLAB to find ...
    (comp.soft-sys.matlab)
  • [Maxima] Newbie question
    ... I've decided to switch to maxima. ... Is a - 1 positive, negative, or zero? ...
    (sci.math.symbolic)

Loading