1. ## Is Wikipedia wrong about Guassian elimination?

I'm currently trying to understand how to solve systems of equations using Gaussian elimination and back-substitution. I'm also trying to implement some computer algorithms that solve systems of equations using this method.

Now I know Wikipedia is not always a reliable source, but I thought it be helpful to get some sample problems from the Wikipedia entry on Guassian elimination. But, no matter how many times I try to solve it, I never get the answer specified on Wikipedia. Also, the computer algorithm I use doesn't get the Wikipedia answer either. So either I'm doing this totally wrong, or Wikipedia is wrong about it.

The wikipedia entry can be found at Gaussian elimination - Wikipedia, the free encyclopedia

Here is the system of equations:

2x + y - z = 8
-3x - y + 2z = -11
-2x + y + 2z = -3

So we get a matrix like this:

+-----------------------+
| 2 1 -1 8 |
| -3 -1 2 -11 |
| 2 1 2 -3 |
+-----------------------+

Now, the Wikipedia article gives the solution as:

x = 2
y = 3
z = -1

But the computer algorithm I implemented gets the following results:

x = -0.66
y = 5.66
z = -3.66

At first I thought it's more likely that I'm wrong than the Wikipedia article, so I tried solving the same system of equations using a professional computer algorithm, and I got the same solution. Also, when you plug in the above values for 2x + y - z = 8, you get a true statement. So it seems Wikipedia is wrong here, unless I'm totally missing something.

Can anyone confirm this? I would really appreciate it.

Thanks.

2. Originally Posted by asiler
I'm currently trying to understand how to solve systems of equations using Gaussian elimination and back-substitution. I'm also trying to implement some computer algorithms that solve systems of equations using this method.

Now I know Wikipedia is not always a reliable source, but I thought it be helpful to get some sample problems from the Wikipedia entry on Guassian elimination. But, no matter how many times I try to solve it, I never get the answer specified on Wikipedia. Also, the computer algorithm I use doesn't get the Wikipedia answer either. So either I'm doing this totally wrong, or Wikipedia is wrong about it.

The wikipedia entry can be found at Gaussian elimination - Wikipedia, the free encyclopedia

Here is the system of equations:

2x + y - z = 8
-3x - y + 2z = -11
-2x + y + 2z = -3

So we get a matrix like this:

+-----------------------+
| 2 1 -1 8 |
| -3 -1 2 -11 |
| 2 1 2 -3 |
+-----------------------+

Now, the Wikipedia article gives the solution as:

x = 2
y = 3
z = -1

But the computer algorithm I implemented gets the following results:

x = -0.66
y = 5.66
z = -3.66

At first I thought it's more likely that I'm wrong than the Wikipedia article, so I tried solving the same system of equations using a professional computer algorithm, and I got the same solution. Also, when you plug in the above values for 2x + y - z = 8, you get a true statement. So it seems Wikipedia is wrong here, unless I'm totally missing something.

Can anyone confirm this? I would really appreciate it.

Thanks.
wikipedia is correct. your algorithm is wrong. note that the solutions given by your algorithm do not work in the last equation. plug them in and check

3. Hello, asiler!

There is a simple way to find out who is right.
. . Check the answers! . . . remember?

You'll find that their answers are correct.

Your answers: . $\left(\frac{2}{3},\:\frac{17}{3},\:-\frac{11}{3}\right)$ .do not check out.

You solved a different system: . $\begin{array}{ccc}{\color{red}-}2x + y - z & = & 8 \\
{\color{red}+}3x - y + 2x & = & -11 \\
-2x + y + 2x& = & -3 \end{array}$

4. Originally Posted by Soroban
Hello, asiler!

There is a simple way to find out who is right.
. . Check the answers! . . . remember?

You'll find that their answers are correct.

Your answers: . $\left(\frac{2}{3},\:\frac{17}{3},\:-\frac{11}{3}\right)$ .do not check out.

You solved a different system: . $\begin{array}{ccc}{\color{red}-}2x + y - z & = & 8 \\
{\color{red}+}3x - y + 2x & = & -11 \\
-2x + y + 2x& = & -3 \end{array}$

Thanks!

You're right. I need to be more careful when I'm copying down equations. I was inputting a positive 2 for the last equation.