Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #10018

Re: Sumbrero puzzle solver

From David Kuehling <dvdkhlng@gmx.de>
Newsgroups comp.lang.forth
Subject Re: Sumbrero puzzle solver
Date 2012-03-11 22:35 +0100
Message-ID <87d38ies83.fsf@snail.Pool> (permalink)
References <17111793008435@frunobulax.edu> <m0qj5d.8n9@spenarnc.xs4all.nl>

Show all headers | View raw


>>>>> "Albert" == Albert van der Horst <albert@spenarnc.xs4all.nl> writes:
>> 
>> x = [a b c d e f g]'; b = [8 14 13 3 16 16 8 11 16]'; A * x = b; A^t
>> * A * x = A^t * b x = (A^t * A)^-1 * A^t * b
>> 
>> This doesn't work: A'*A is not invertible (quadruple eigenvalue)

> This look like the Java syndrome, killing a flie with a cannon.  The
> problem can be solved in less operations then needed to calculate A'*A
> leave alone inspecting it.

Maybe less operations, but it might take more code :)

In Octave (matlab, too?) you have the reverse division operator '\' for
solving systems of equations without explicitely inverting the matrix A:
to solve Ax=b you write x=A\b . (which is probably implemented via
LR-decomposition of A, then forward/backward substitution to find x).

BTW even if you save some operations, asymptotic complexity is still
O(n^3), so inversion doesn't hurt that much.

cheers,

David
-- 
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-10 18:24 +0200
  Re: Sumbrero puzzle solver David Kuehling <dvdkhlng@gmx.de> - 2012-03-11 00:30 +0100
    Re: Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-11 01:25 +0200
      Re: Sumbrero puzzle solver David Kuehling <dvdkhlng@gmx.de> - 2012-03-11 23:27 +0100
        Re: Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-19 00:00 +0200
          Re: Sumbrero puzzle solver "A. K." <akk@nospam.org> - 2012-03-19 08:24 +0100
            Re: Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-20 20:36 +0200
              Re: Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-20 23:12 +0200
              Re: Sumbrero puzzle solver "A. K." <akk@nospam.org> - 2012-03-21 12:06 +0100
  Re: Sumbrero puzzle solver "A. K." <minforth@arcor.de> - 2012-03-11 12:10 +0100
    Re: Sumbrero puzzle solver "A. K." <akk@nospam.org> - 2012-03-12 21:51 +0100
  Re: Sumbrero puzzle solver Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-11 19:22 +0000
    Re: Sumbrero puzzle solver David Kuehling <dvdkhlng@gmx.de> - 2012-03-11 22:35 +0100
    Re: Sumbrero puzzle solver C G Montgomery <cgm@physics.utoledo.edu> - 2012-03-11 18:23 -0400

csiph-web