# Gauss elimination vs Solution with Inverse

## Homework Statement

Using Octave or Matlab solve random binary matrices(with 1s and 0s) of size N and plot them together. Draw a conclusion.

## 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:

## Answers and Replies

HallsofIvy
Science Advisor
Homework Helper
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?

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?

Sorry for being mystical. I will clarify:

random binary matrix of size 4:
Code:
1 0 1 1
0 0 0 1
1 0 1 0
0 1 0 0

random binary matrix of size 2:
Code:
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$^{-1}$*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.