Solve Linear Equations Using Gauss-Jordan in C

  • Thread starter Thread starter niteshadw
  • Start date Start date
  • Tags Tags
    Matrix
Click For Summary

Homework Help Overview

The discussion revolves around solving a system of linear equations using the Gauss-Jordan elimination method in the context of programming in C. The original poster presents a system with some missing coefficients and seeks guidance on how to approach the problem.

Discussion Character

  • Exploratory, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants discuss the representation of the system in matrix form and the steps involved in applying the Gauss-Jordan elimination. There are attempts to clarify the setup of the augmented matrix and the process of row reduction. Some participants question the handling of blank spaces in the equations.

Discussion Status

There is an ongoing exploration of the row reduction process, with some participants providing partial steps and others seeking clarification on the implications of the results. While there are attempts to derive solutions, the discussion remains open with no explicit consensus on the final outcomes.

Contextual Notes

Participants note the presence of blank spaces in the original equations, which raises questions about their interpretation and how they affect the solution process. The discussion also reflects on the importance of correctly identifying the constants in the augmented matrix.

niteshadw
Messages
20
Reaction score
0
Use the Gauss-Jordan algorithm to find all solutions of the following system of linear equations in C:

x1 + x2 + x3 [] = 2
2x1 [] + 2x3 + 2x4 = 2
x1 + 2x2 + 2x3 [] = 1
2x1 + 2x2 [] + x4 = 2

[] signify a blank space in the equation. How do you even proceed to do this, I have never seen it. Any help would be appreciated. Thank you.
 
Physics news on Phys.org
In matrix-form, it looks like this:

[tex]\left( {\begin{array}{*{20}c}<br /> 1 & 1 & 1 & 0 & 2 \\<br /> 2 & 0 & 2 & 2 & 2 \\<br /> 1 & 2 & 2 & 0 & 1 \\<br /> 2 & 2 & 0 & 1 & 2 \\<br /> \end{array}} \right)[/tex]

Do you know how Gaussian elimination works?
 
How about this:

[tex]\left(<br /> \begin{array}{cccc|c}1 & 1 & 1 & 0 & 2\\<br /> 2 & 0 & 2 & 2 & 2 \\<br /> 1 & 2 & 2 & 0 & 2 \\<br /> 2 & 2 & 0 & 1 & 1 <br /> \end{array}\right)[/tex]

That's the augumented matrix Niteshadw.

So, reduce it. Here, I'll do the first part. I'll multiply the top row by -2 and then add it to the second row yielding:

[tex] \left(<br /> \begin{array}{cccc|c}1 & 1 & 1 & 0 & 2 \\<br /> 0 & -2 & 0 & 2 & -2 \\<br /> 1 & 2 & 2 & 0 & 2 \\<br /> 2 & 2 & 0 & 1 & 1 <br /> \end{array}\right)[/tex]

Can you continue doing this until you get it to row-reduced form?
 
Last edited:
Typo! The first matrix in Saltydog's response should be
[tex]\left(\begin{array}{cccc|c}1 & 1 & 1 & 0 & 2\\ 2 & 0 & 2 & 2 & 2 \\ 1 & 2 & 2 & 0 & 1 \\ 2 & 2 & 0 & 1 & 2 \end{array}\right)[/tex]

Except for separating out the "augmenting" part, that's just what TD said.
 
saltydog said:
How about this:

[tex]\left(<br /> \begin{array}{cccc|c}1 & 1 & 1 & 0 & 2\\<br /> 2 & 0 & 2 & 2 & 2 \\<br /> 1 & 2 & 2 & 0 & 2 \\<br /> 2 & 2 & 0 & 1 & 1 <br /> \end{array}\right)[/tex]

That's the augumented matrix Stunner.

So, reduce it. Here, I'll do the first part. I'll multiply the top row by -2 and then add it to the second row yielding:

[tex] \left(<br /> \begin{array}{cccc|c}1 & 1 & 1 & 0 & 2 \\<br /> 0 & -2 & 0 & 2 & -2 \\<br /> 1 & 2 & 2 & 0 & 2 \\<br /> 2 & 2 & 0 & 1 & 1 <br /> \end{array}\right)[/tex]

Can you continue doing this until you get it to row-reduced form?

Hmm..looks simple enough, just did not know what to do with those blank spots...Ok, I got this,

[tex]\left(<br /> \begin{array}{cccc|c}1 & 0 & 0 & 0 & 3\\<br /> 0 & 1 & 0 & 0 & -1 \\<br /> 0 & 0 & 1 & 0 & 0 \\<br /> 0 & 0 & 0 & 1 & -2 <br /> \end{array}\right)[/tex]

so um,
x_4 = -2x_4
x_3 = 0
x_2 = -x_2
x_1 = 3x_1

are those the solutions?
Thank you for the help thus far...
 
I think you row-reduced fine but the last column refers to the constants, not to an unknown. So the solution should be:

[tex]\left\{ \begin{array}{l}<br /> x_1 = 3 \\ <br /> x_2 = - 1 \\ <br /> x_3 = 0 \\ <br /> x_4 = - 2 \\ <br /> \end{array} \right[/tex]
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K