Results 1 to 5 of 5

Thread: matrix help please =(

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2009
    Posts
    1

    matrix help please =(

    hello guys i am having quite a problem trying to solve this, i am doing something wrong.
    4x + 3y - 4z= -7
    5x - 2y + 3z= 13
    6x + 4y - 3z= -4

    these were my 1st attempts, but they went wrong i know the answer should be 1 -1 2.
    http://img237.imageshack.us/img237/4216/maths10001.jpg
    http://img64.imageshack.us/img64/5191/maths10002.jpg

    please help me =(

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: matrix help please =(

    Welcome to VB Forums!

    You don't need to post links to images, in fact we'd prefer that you didn't. Instead you can use the Manage Attachments button that you'll find in the frame below the one where you are creating a post.

  3. #3
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: matrix help please =(

    You don't really seem to understand how matrices work, judging from your attempts.

    You have three equations, which can be represented in matrix form by this:
    Code:
    ┌           ┐┌   ┐   ┌    ┐
    │ 4   3  -4 ││ x │   │ -7 │
    │ 5  -2   3 ││ y │ = │ 13 │
    │ 6   4  -3 ││ z │   │ -4 │
    └           ┘└   ┘   └    ┘
    And not by this (which is what you're writing)
    Code:
    ┌           ┐   ┌   ┐   ┌    ┐
    │ 4   3  -4 │   │ x │   │ -7 │
    │ 5  -2   3 │ = │ y │ = │ 13 │
    │ 6   4  -3 │   │ z │   │ -4 │
    └           ┘   └   ┘   └    ┘
    Now, you can solve the equations by simply solving them line by line. For example, if you start with the first one, you may get an expression for x in terms of y and z. Then, you can substitute that expression for x for the x that appears in the second and third equations. Now, you have eliminated the variable x. You can do the same for y, using the second line, and finally you can do the same for z, in which case you have found a value for z. Then, you can substitute that back into the expression for y (which only depends on z), and you get a value for y. Finally, you can substitute both the y and z you've found back into the expression for x, and you have all three values. Solved!

    However, that may get very messy, so clever people have come up with a different way of solving this: by using matrix and vector multiplication.
    Code:
    ┌           ┐┌   ┐   ┌    ┐
    │ 4   3  -4 ││ x │   │ -7 │
    │ 5  -2   3 ││ y │ = │ 13 │
    │ 6   4  -3 ││ z │   │ -4 │
    └           ┘└   ┘   └    ┘
          A        x   =    b
    A is the matrix, x is the vector (x, y, z) which you have to solve, and b is the vector representing the right-hand-sides of the three equations.

    To solve this equation for x, you can do a so-called Gaussian elimination. I think it's also often called 'sweeping' the matrix.

    If you know how to do gaussian elimination, then you're basically done: apply it to the matrix and you'll get your answer. If you don't, I suggest you read your textbook (if you have one) again, or ask your teacher, because I'm sure it has been explained.

    Basically, you start with this matrix (which is just A and b pasted together)
    Code:
    ┌                ┐
    │ 4   3  -4 │ -7 │
    │ 5  -2   3 │ 13 │
    │ 6   4  -3 │ -4 │
    └                ┘
    And you manipulate the rows and columns until you arrive at this form
    Code:
    ┌                ┐
    │ 1   0   0 │ u  │
    │ 0   1   0 │ v  │
    │ 0   0   1 │ w  │
    └                ┘
    The values for u, v and w are then your x, y and z.

  4. #4
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: matrix help please =(

    i actually never learned this because i could see the results right away and somehow i passed with the highest grades in maths in 9th grade finished school with top in maths and i can't even figure out how to calculate this, the results just popped up in my head... just like marius he knows the result but can't figure it out... and welcome to the forums by the way

  5. #5
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: matrix help please =(

    I'd like to fill in a small detail based on Nick's post. Your original system of equations can be rewritten as 1 equation (i.e. 1 = sign), instead of 3, as Nick did. If you're pedantic, this uses definitions 1.3.Equality and 1.5.Multiplication [of a Matrix] by a Column Vector of my Guide to Linear Algebra.

    Code:
    4x + 3y - 4z= -7
    5x - 2y + 3z= 13
    6x + 4y - 3z= -4
    
    becomes
    
    ┌              ┐   ┌    ┐
    │ 4x + 3y - 4z │   │ -7 │
    │ 5x - 2y + 3z │ = │ 13 │
    │ 6x + 4y - 3z │   │ -4 │
    └              ┘   └    ┘
    
    which is, through reversed matrix multiplication,
    
    ┌           ┐┌   ┐   ┌    ┐
    │ 4   3  -4 ││ x │   │ -7 │
    │ 5  -2   3 ││ y │ = │ 13 │
    │ 6   4  -3 ││ z │   │ -4 │
    └           ┘└   ┘   └    ┘
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width