Gauss elimination vs Solution with Inverse

In summary, the conversation discusses solving random binary matrices of varying sizes and plotting them together using Octave or Matlab. The matrices are solved using the Gauss elimination and inverse methods, with the resulting time data being saved and plotted in a graph. The purpose of this exercise is to compare the efficiency of the two methods.
  • #1
Pithikos
55
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
  • #2
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?
 
  • #3
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[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.
 

1. What is the difference between Gauss elimination and solution with inverse?

Gauss elimination is a numerical method for solving systems of linear equations, while solution with inverse is a method that involves finding the inverse of a matrix and using it to solve the system.

2. Which method is more efficient for solving systems of linear equations?

In most cases, Gauss elimination is more efficient since it involves simpler calculations and does not require finding the inverse of a matrix.

3. Are there any cases where solution with inverse is preferred over Gauss elimination?

Yes, solution with inverse may be preferred when the matrix is sparse or when the system of equations is small.

4. Can Gauss elimination and solution with inverse produce different solutions for the same system of equations?

No, if both methods are implemented correctly, they should produce the same solution for the same system of equations. However, due to the use of floating point arithmetic, small differences may occur in the solutions.

5. Is one method generally considered more accurate than the other?

Both methods can produce accurate solutions, but Gauss elimination may be more prone to rounding errors due to the use of division in its calculations.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
4K
Replies
4
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Advanced Physics Homework Help
Replies
1
Views
5K
  • STEM Academic Advising
Replies
13
Views
2K
Replies
2
Views
6K
Back
Top