1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: I really hate matrices sometimes.

  1. Apr 17, 2007 #1
    1. The problem statement, all variables and given/known data

    Express the following equations in the matrix form AX=B. Determine the inverse of A and hence solve the equations.




    2. Relevant equations

    Not really applicable.

    3. The attempt at a solution

    A bit of background, this is for a piece of coursework when we were just starting to learn about matrices and their uses, which deals with solving groups of equations by changing them into matrix form and solving them that way. So it's not very advanced. It's just annoying.

    Basically I've done the entirety of the problem, I come to the end and the answers aren't right. It's a Hellishly long process and I've done it five times now and each time I get a different incorrect answer and it's driving me up the wall. I just KNOW I've got ONE sign wrong somewhere and it's throwing the whole damn thing off. I hope someone can point out where I've gone wrong.

    Oh, the answer is meant to come out, [tex]x = 3, y = 1, z = 2[/tex]; I've been getting weird fractional answers. Anyway.

    Right, so changing the equations into AX=B form:

    [tex]\left(\begin{array}{ccc}4&-3&1\\2&1&-4\\1&2&-2\end{array}\right)\left(\begin{array}{c}x\\y\\z\end{array}\right) = \left(\begin{array}{c}11\\-1\\1\end{array}\right)[/tex]

    So we know that:


    So my next aim is to calculate [tex]A^{-1}[/tex].


    [tex]det(A) = (4)\left|\begin{array}{cc}1&-4\\2&-2\end{array}\right|-(-3)\left|\begin{array}{cc}2&-4\\1&-2\end{array}\right|+(1)\left|\begin{array}{cc}2&1\\1&2\end{array}\right|[/tex]




    So that's fair enough. The determinant is 21. God knows if it actually is or not but following my calculations that's what it is. Now, the matrix of cofactors:

    [tex]C = \left(\begin{array}{ccc}\left|\begin{array}{cc}1&-4\\2&-2\end{array}\right|&-\left|\begin{array}{cc}2&-4\\1&-2\end{array}\right|&\left|\begin{array}{cc}2&1\\1&2\end{array}\right|\\\\-\left|\begin{array}{cc}-3&1\\2&-2\end{array}\right|&\left|\begin{array}{cc}4&1\\1&-2\end{array}\right|&-\left|\begin{array}{cc}4&-3\\1&2\end{array}\right|\\\\\left|\begin{array}{cc}-3&1\\1&-4\end{array}\right|&-\left|\begin{array}{cc}4&1\\2&-4\end{array}\right|&\left|\begin{array}{cc}4&-3\\2&1\end{array}\right|\end{array}\right) = \left(\begin{array}{ccc}6&0&3\\-4&-9&-11\\11&18&10\end{array}\right)[/tex]


    [tex]A^{-1} = \frac{1}{21}\left(\begin{array}{ccc}6&-4&11\\0&-9&18\\3&-11&10\end{array}\right) = \left(\begin{array}{ccc}\frac{2}{7}&-\frac{4}{21}&\frac{11}{21}\\\\0&-\frac{3}{7}&\frac{6}{7}\\\\\frac{1}{7}&-\frac{11}{21}&\frac{10}{21}\end{array}\right)[/tex]

    [tex]X=A^{-1}B = \left(\begin{array}{ccc}\frac{2}{7}&-\frac{4}{21}&\frac{11}{21}\\\\0&-\frac{3}{7}&\frac{6}{7}\\\\\frac{1}{7}&-\frac{11}{21}&\frac{10}{21}\end{array}\right)\left(\begin{array}{c}11\\-1\\1\end{array}\right)[/tex]

    Which actually gives you the answers [tex]x=\frac{27}{7}, y=\frac{9}{7}, z=\frac{58}{21}[/tex]...none of which are right, obviously.

    I know there's a lot of information above but I could really do with someone with a sharper eye than mine (bear in mind it's now nearly 6am and I've been up all night!) to find where I've made my little error leading to a grand finale of chaos! Many thanks to anyone who looks at this! I'm off to my bed for now!
    Last edited: Apr 18, 2007
  2. jcsd
  3. Apr 18, 2007 #2
    OK, so there's a sign error in the 3rd term when calculating the determinant. It should be 24 - 0 + 3 = 27
  4. Apr 18, 2007 #3
    And you know what? That solves the whole thing. I knew it. One sign off. Thanks so much for noticing, I'd never have gotten it! I need to go be dead now. :S
  5. Apr 18, 2007 #4


    User Avatar
    Science Advisor

    Is that the only way you have learned to solve a system of equations? Row reduction of the augmented matrix is much simpler (in this problem it doesn't involve any fractions!). Hopefully you will learn that soon.
  6. Apr 18, 2007 #5
    Hi, um, if "row reduction of the augmented matrix" can also be called "elementary row operations" (as I'm reading in my notes) then yes, we have learned that, but it was kind of forgotten about, being hailed as a long-winded and quite inefficient way of finding the inverses of matrices, and therefore I'm not very confident about how to do it.
  7. Apr 18, 2007 #6


    User Avatar
    Science Advisor

    "Long winded"! "Difficult"!! How dare you! It is the simplest way to find determinants, inverses, or, for that matter, just solving equations!

    In this case, you can write the "augmented" matrix as
    The first row operation I would use is to swap the first and third rows (that's not necessary but it simplifies the arithmetic):
    Now, in order to get "1 0 0" as the first column, subtract twice the first row from the second row and four times the first row from the third row:
    Divide the second row by -3 (to get a 1 at the "pivot"), subtract twice that new second row from the first row and add 11 times the new second row to the third row:
    Finally, divide the third row by 9 and add twice the third row to the first row:
    Now you can read off the solution: x= 3, y= 1, z= 2.

    We didn't have to find either the inverse matrix nor the determinant to solve that. If we did want to find the inverse matrix, we would replace that fourth column by the identity matrix. The same row operations that change the matrix A into the identity matrix change the identity matrix into A-1.

    But even finding the determinant is easy this way: just keep track of the "swaps" and "divisions". We swapped two rows: that will multiply the determinant by -1. We divided one two by -3. To "get it back", we must multiply the determinant by -3. We divided a row by 9. To "get it back", we must multiply the determinant by 9. Since the determinant of the final matrix (the identity matrix) is obviously 1, the original matrix had determinant (-1)(-3)(9)= 27.
  8. May 10, 2007 #7
    Sorry to bring back a long dead thread.
    I found HallsofIvy's method fascinating. I haven't studied agumented matrices so far, so I have a few questions regarding this method.
    1) Are operations like subtracting constant times a row from another row allowed in matrices?
    2)When we divide the second row by -3 don't we have to multipy the matrix by -3 as well (like we do in determinants)?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook