Is this solution accidentally using Jacobi method instead of....

In summary, the problem asks for the first three iterations of the Gauss-Seidel iterative method to solve a system of equations. The solution provided uses the Jacobi method instead, despite the question specifically asking for the Gauss-Seidel method. The solution also includes a mistake in the labeling of the iterations.
  • #1
s3a
818
8

Homework Statement


The problem is attached.

Homework Equations


Isolating each x_i.

The Attempt at a Solution


I watched this video for the Jacobi method.:


I also watched this video for the Gauss-Seidel method.:


At least based on the videos mentioned above, it seems that the difference between the Gauss-Seidel method and the Jacobi method is that the Gauss-Seidel method always computes the the latest x_i, by using already-computed values from the current iteration, if available, unlike the Jacobi method which seems to just use values from the previous iteration, even if values from the current iteration are available.

So, am I correct in thinking that the solution is using the Jacobi method, despite the question asking for the Gauss-Seidel method to be used?

Any input would be greatly appreciated!
 

Attachments

  • 4p14.pdf
    66.8 KB · Views: 242
Physics news on Phys.org
  • #2
s3a said:

Homework Statement


The problem is attached.

Homework Equations


Isolating each x_i.

The Attempt at a Solution


I watched this video for the Jacobi method.:


I also watched this video for the Gauss-Seidel method.:


At least based on the videos mentioned above, it seems that the difference between the Gauss-Seidel method and the Jacobi method is that the Gauss-Seidel method always computes the the latest x_i, by using already-computed values from the current iteration, if available, unlike the Jacobi method which seems to just use values from the previous iteration, even if values from the current iteration are available.

So, am I correct in thinking that the solution is using the Jacobi method, despite the question asking for the Gauss-Seidel method to be used?

Any input would be greatly appreciated!


I will not watch the videos, but judging from the first frame in the second video, it is using Gauss-Seidel, not Jacobi. You can tell that by looking at the calculation of the updated ##x_2##, which does use the newly-updated value of ##x_1##, not the old value of ##x_1##. I don't know what the first video is doing, because I refuse to watch it. (The standard PF policy is for you to type everything out, not to upload videos, etc, although sometimes you may find a helper who is willing to look at updated material---diagrams excepted, of course.)
 
  • #3
Sorry; it's just that viewing uploaded PDFs is not something I see as inconvenient, so I tend to forget that not everyone feels the same.

Also, the videos were uploaded as background information; I wasn't expecting anyone to watch them in full (unless desired).

It looks better in the PDF file, but here's the problem statement and its solution, typed out.:
Problem statement:
Carry out the first three iterations of the solution of the following system of equations using the GaussSeidel iterative method. For the first guess of the solution, take the value of all the unknowns to be zero.
##8 x_1 + 2x_2 + 3x_3 = 51##
##2x_1 + 5x_2 + x_3 = 23##
##-3x_1 + x_2 + 6x_3 = 20##

Solution:
The essence of the Gauss-Seidel iterative method is given by x_1 = 1/a_(ii) [b_i - SIGMA j = 1, j != 1 to j = n of a_(ij) x_j], i = 1, 2, . . ., n

First Iteration:
Starting with [x_1^(0) x_2^(0) x_3^(0) = [0 0 0], x_1^(1) = [51 - 2(0) - 3(0)]/8 = 6.375, x_2^(1) = [23 - 2(0) - 0]/5 = 4.6, and x_3^(1) = [20 + 3(0) - 0]/6 = 3.3333.

Second Iteration:
x_1^(0) = [51 - 2(4.6) - 3(3.3333)]/8 = 3.9750, x_2^(2) = [23 - 2(6.375) - 3.3333]/5 = 6.9167, and x_3^(2 -- in the PDF this is a 1, instead of a 2, but I think that it's a mistake) = [20 + 3(6.375) - 4.6]/6 = 5.7542.

Third Iteration:
x_1^(3) = [51 - 2(6.9167) - 3(5.7542)]/8 = 2.488, x_2^(3-- in the PDF this is a 2, instead of a 3, but I think that it's a mistake) = [23 - 2(3.9750) - 5.7542]/5 = 1.8592, and x_3^(3 -- in the PDF this is a 1, instead of a 3, but I think that it's a mistake) = [20 + 3(3.9750) - 6.9167]/6 = 4.1681.

So, am I correct in thinking that the solution of the problem statement in the PDF (not a problem from a video -- the videos were just background information) is using the Jacobi method, despite the question asking for the Gauss-Seidel method to be used?
 
  • #4
s3a said:
Sorry; it's just that viewing uploaded PDFs is not something I see as inconvenient, so I tend to forget that not everyone feels the same.

Also, the videos were uploaded as background information; I wasn't expecting anyone to watch them in full (unless desired).

It looks better in the PDF file, but here's the problem statement and its solution, typed out.:
Problem statement:
Carry out the first three iterations of the solution of the following system of equations using the GaussSeidel iterative method. For the first guess of the solution, take the value of all the unknowns to be zero.
##8 x_1 + 2x_2 + 3x_3 = 51##
##2x_1 + 5x_2 + x_3 = 23##
##-3x_1 + x_2 + 6x_3 = 20##

Solution:
The essence of the Gauss-Seidel iterative method is given by x_1 = 1/a_(ii) [b_i - SIGMA j = 1, j != 1 to j = n of a_(ij) x_j], i = 1, 2, . . ., n

First Iteration:
Starting with [x_1^(0) x_2^(0) x_3^(0) = [0 0 0], x_1^(1) = [51 - 2(0) - 3(0)]/8 = 6.375, x_2^(1) = [23 - 2(0) - 0]/5 = 4.6, and x_3^(1) = [20 + 3(0) - 0]/6 = 3.3333.

Second Iteration:
x_1^(0) = [51 - 2(4.6) - 3(3.3333)]/8 = 3.9750, x_2^(2) = [23 - 2(6.375) - 3.3333]/5 = 6.9167, and x_3^(2 -- in the PDF this is a 1, instead of a 2, but I think that it's a mistake) = [20 + 3(6.375) - 4.6]/6 = 5.7542.

Third Iteration:
x_1^(3) = [51 - 2(6.9167) - 3(5.7542)]/8 = 2.488, x_2^(3-- in the PDF this is a 2, instead of a 3, but I think that it's a mistake) = [23 - 2(3.9750) - 5.7542]/5 = 1.8592, and x_3^(3 -- in the PDF this is a 1, instead of a 3, but I think that it's a mistake) = [20 + 3(3.9750) - 6.9167]/6 = 4.1681.

So, am I correct in thinking that the solution of the problem statement in the PDF (not a problem from a video -- the videos were just background information) is using the Jacobi method, despite the question asking for the Gauss-Seidel method to be used?

If that is what he/she does in the first video then yes, indeed, that is the Jacobi method.

However, as I stated clearly already, the second video looks to me like it really is using the Gauss-Seidel method, exactly as advertised. Go back and read my previous response for the reasons. Perhaps the terminology "first frame in the second video" confused you. I meant the second video, but only the beginning picture that appears on the screen almost as an icon. It can be seen without watching the video, but later frames require watching it.
 
  • Like
Likes s3a
  • #5
Actually, I understood what you had said about the video; I just wanted to be sure that I wasn't overlooking something in the PDF, while thinking that I understood something I haven't understood (and if I was, it'd be a learning opportunity).

Anyways, thanks for confirming that I was right about the PDF accidentally using the Jacobi method instead of the Gauss-Seidel method. :)
 
  • #6
s3a said:
Actually, I understood what you had said about the video; I just wanted to be sure that I wasn't overlooking something in the PDF, while thinking that I understood something I haven't understood (and if I was, it'd be a learning opportunity).

Anyways, thanks for confirming that I was right about the PDF accidentally using the Jacobi method instead of the Gauss-Seidel method. :)

No, I never said that; you are mis-quoting me! The second video shows the Gauss-Seidel method. I suspect that the first video shows the Jacobi method, if indeed what you wrote before came from the first video.

Let me repeat it one more (and very last) time: the second video shows that he/she is updating the value of ##x_2## by using the already-updated value of ##x_1##. That is how Gauss-Seidel works. It is not what we do in Jacobi.
 
  • #7
The problem statement and solution I typed is not from any of the two videos; it's from the PDF file. Basically, completely ignore the videos; imagine that I hadn't even mentioned them in this thread.

So, the PDF file's solution is using the Jacobi method, instead of the Gauss-Seidel method, right?
 
  • #8
s3a said:
The problem statement and solution I typed is not from any of the two videos; it's from the PDF file. Basically, completely ignore the videos; imagine that I hadn't even mentioned them in this thread.

So, the PDF file's solution is using the Jacobi method, instead of the Gauss-Seidel method, right?
You tell me. Is it doing "Jacobi" updating, or "Gauss-Seidel" updating?
 
  • #9
I believe it's doing Jacobi updating, because, for example, ##x_3## of the current iteration is using the values ##x_1## and ##x_2## of the previous iteration, rather than the ones just-recently computed in the same/current iteration.

So, I'm correct, right?
 

1. What is the difference between the Jacobi method and other solution methods?

The Jacobi method is a numerical method used to solve systems of linear equations. It differs from other methods, such as the Gauss-Seidel method, in that it updates all the variables at the same time instead of updating them one at a time. This can make it slower than other methods, but it is more straightforward to implement and can be used for non-symmetric matrices.

2. How do I know if my solution is using the Jacobi method?

The easiest way to determine if your solution is using the Jacobi method is to check the code or algorithm being used. The Jacobi method is usually explicitly stated or labeled in the code, so it should be easy to identify. Additionally, the Jacobi method updates all the variables simultaneously, so if your code is doing this, it is likely using the Jacobi method.

3. What are the advantages of using the Jacobi method?

One advantage of the Jacobi method is that it is relatively easy to implement and understand. It can also be used for non-symmetric matrices, which makes it more versatile than other methods. Additionally, the Jacobi method can be parallelized, allowing for faster computation on multi-core processors.

4. What are the limitations of using the Jacobi method?

One limitation of the Jacobi method is that it can be slower than other methods, such as the Gauss-Seidel method. This is because it updates all the variables simultaneously, which can be inefficient for larger systems of equations. Additionally, the Jacobi method may not converge for certain types of matrices, making it unsuitable for all types of problems.

5. How can I avoid accidentally using the Jacobi method?

To avoid accidentally using the Jacobi method, make sure to carefully read and understand the code or algorithm being used. If the code is not explicitly labeled as using the Jacobi method, it is likely using a different method. Additionally, it is helpful to familiarize yourself with other solution methods and their differences to better understand which method is being used in your solution.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
3K
  • Electrical Engineering
Replies
3
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
12
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
Back
Top