Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Gauss elimination vs Solution with Inverse

  1. Oct 31, 2011 #1
    1. The problem statement, all variables and given/known data
    Using Octave or Matlab solve random binary matrices(with 1s and 0s) of size N and plot them together. Draw a conclusion.

    3. The attempt at a solution
    [PLAIN]http://img703.imageshack.us/img703/7803/plotm.png [Broken]

    I was just wondering if this looks correct to you. I previously had given to my teacher this
    [PLAIN]http://img444.imageshack.us/img444/4943/lab5.png [Broken]
    where x=size of matrix and y=time in seconds and he thought it was wrong. There are two lines there btw, a blue for Gauss elimination and a green for Inverse.
    Last edited by a moderator: May 5, 2017
  2. jcsd
  3. Oct 31, 2011 #2


    User Avatar
    Science Advisor

    I have no idea what you mean by "solve random binary matrices(with 1s and 0s) of size N and plot them together." Plot what together? What information it that you are plotting? And what do you mean by "solve matrices"? Do you mean solve matrix equations?
  4. Oct 31, 2011 #3
    Sorry for being mystical. I will clarify:

    random binary matrix of size 4:
    Code (Text):

    1 0 1 1
    0 0 0 1
    1 0 1 0
    0 1 0 0
    random binary matrix of size 2:
    Code (Text):

    1 1
    0 0
    and so on.

    So i make random such binary matrices M from size 1 to N. I also make a binary vector b in the same way. Then I try to solve them following Ax=b.

    So solving this with Gauss(M/b) in Octave gives different time than with using an Inverse(A[itex]^{-1}[/itex]*b).

    Then I just save the data for the different matrix sizes and the time it took for each method. So that's what you see in the graphs. With "plot them together" I mean to have the two method results in the same graph.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook