Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Solving Simultaneous Equations with Matrices

by tilly (Archbishop)
on Apr 26, 2004 at 05:01 UTC ( [id://348080]=note: print w/replies, xml ) Need Help??


in reply to Re: Solving Simultaneous Equations with Matrices
in thread Solving Simultaneous Equations with Matrices

The method that he suggested for inverting a matrix, using the determinant as described, takes n! time. Which is considerably worse than O(n**3), and furthermore with that many terms in the calculation, round-off errors can get bad, quickly.

However inverting a matrix has a O(n**3) algorithm. What you do is write [M|I] where M is the n*n matrix that you want to invert and I is the n*n identity matrix. Then through row-reduction try to turn that into [I|M']. You will succeed iff M is invertable, and M' will be the inverse of M.

To understand why this works, applying a row operation is the same as left-multiplying by a matrix. So the series of row operations that you did in the reduction is a series of matrix multiplications that turn M into I. In other words you multiplied by the inverse of M. Luckily you also recorded what happens if you start with the identity matrix and do the same sequence of multiplications. But the inverse of M times I is going to be the inverse of M.

However one would only want to go through the work of calculating an inverse if you had to solve the same system of equations for many different values.

The determinant formula for an inverse is called Cramer's rule. It has tremendous theoretical value, it is faster to calculate for 2x2 matrices, and it is about even with row reduction for 3x3 matrices. When you get to 4x4, though, row reduction wins significantly, and never looks back.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://348080]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2024-04-23 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found