Gauss elimination vs Solution with Inverse

Pithikos
Messages
55
Reaction score
1

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

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
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:
Physics news on Phys.org
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?
 
HallsofIvy said:
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.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top