# Thread: Three problems concerning Gaussian elimination

1. ## Three problems concerning Gaussian elimination

Hello everyone

I am studying linear algebra and these problems came across:

1
Solve all values on a in the equation system

$\displaystyle \left(\begin{array}{cc|c}1&a&1\\a&-1&-1\end{array}\right)$

2
If a ≠ 1 solve the equation system with n equations and $\displaystyle n$ unknown variables.

What happens if $\displaystyle a = 1$?

Ugh, I think i'll just scan this problem and upload it.

3
Solve for all values on a and b in the equation system.

Ok, what can we do?

Problem 1

We need to remove the lower-left a, so we got to multiply the first equation with a.

$\displaystyle \left(\begin{array}{cc|c}1&a&1\\a&-1&-1\end{array}\right)$

$\displaystyle \left(\begin{array}{cc|c}a&a^2&a\\a&-1&-1\end{array}\right)$

Now the a will go away but what happens with the second variable?

$\displaystyle \left(\begin{array}{cc|c}a&a^2&a\\0&???&???\end{ar ray}\right)$

Here's where it stops for me. We haven't really gone into things like this. I guess the result might be this:

Second variable: $\displaystyle -1 - 1a^2 = -2a^2$
Sum: $\displaystyle -1 - a = -(1+a)$

I think I won't toch problem 2 & 3 with a stick before getting a grasp of 1.

Thanks for all replies.

2. any linear system of equations can be represented as:

Ax = b

where A is the coefficient matrix (in our case it's 2x2 matrix), x is a column vector of the unknown variables (in this case it's a 1x2) and b is a column vector of solutions (also 1x2).

now there are several ways of solving this system of equations, one of which is gaussian elimination, here are it's details:

Gaussian elimination - Wikipedia, the free encyclopedia

[1___a___ | 1___]
[0 -1-a^2 | -1-a ]

thus x2 = (-1-a) / (-1-a^2) = (1+a) / (1+a^2)
now after substituting the solution for x2 in the first equation we get:

x1 + a*(1+a) / (1+a^2) = 1
<=> x1` = (1-a) / (1+a^2)

another method that I'd recommand for solving this system of equations is matrix inversion:

Ax = b

thus: x = (A^-1)b

there is a simple method for inverting a 2x2 matrix (you should memorize it as it will prove to be very useful in the future)

1. switch the two elements on the main diagonal.
2. reverse the sign of the elements on the secondary diagonal.
3. divide all the elements by the matrix determinant

A^-1 =-1/(1+a^2) *[-1 -a]
__________________[-a 1 ]

---> x = -1/(1+a^2) *[-1 -a] * [1 ] = -1/(1+a^2) *[a-1 ] =[ (1-a)/(1+a^2) ]
___________________[-a 1 ]__[-1 ]_____________[-1-a]_ [ (1+a)/(1+a^2) ]

as you can see we've got the same answer

3. Hello, λιεҗąиđ€ŗ!

1) Solve all values of $\displaystyle a$ in the equation system. . What does this mean? .**

. . . $\displaystyle \begin{pmatrix}1&a&|&1\\a&\text{-}1&|&\text{-}1\end{pmatrix}$
You started off correctly,
. . but can you do the multiplcation "mentally"?

$\displaystyle \begin{array}{c} \\ R_2-a\!\cdot\!R_1\end{array} \;\begin{pmatrix}1 & a &|& 1 \\ 0 & \text{-}1-a^2 &|& \text{-}1-a \end{pmatrix}$

$\displaystyle \begin{array}{c} \\ \text{-}\frac{1}{1+a^2}\!\cdot\!R_2\end{array}\;\begin{pm atrix}1 & a &|& 1 \\ 0 & 1 &|& \frac{1+a}{1+a^2} \end{pmatrix}$

$\displaystyle \begin{array}{c}R_1-a\!\cdot\!R_2 \\ \\ \end{array}\;\begin{pmatrix}1 & 0 &|& \frac{1-a}{1+a^2} \\ 0 & 1 &|& \frac{1+a}{1+a^2} \end{pmatrix}$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

**

How can we "solve for $\displaystyle a$" ??

The augmented matrix comes from: .$\displaystyle \begin{Bmatrix} x + ay &=& 1 \\ ax - y &=& \text{-}1 \end{Bmatrix}$

And we can solve for $\displaystyle x\text{ and }y\!:\;\;x \:=\:\frac{1-a}{1+a^2},\quad y \:=\:\frac{1+a}{1+a^2}$

I suppose we can make this observation:

. . . . $\displaystyle a\text{ can be any complex value, except }a = \pm i.$

4. Thanks for the replies Peritus & Soroban. I understand it now somewhat. I have to read Petrius post a couple of times before I understand that too.

5. Hello, λιεҗąиđ€ŗ!

Peritus' solution is the same as mine.
. . Mine just looks "prettier".

He explained how to find the inverse of a 2x2 matrix . . . instantly!

Given: .$\displaystyle A \:=\:\begin{pmatrix}a&b\\c&d\end{pmatrix}$

There are three steps to constructing this inverse.

[1] Switch the elements on the main diagonal $\displaystyle (\searrow)$

[2] Change the signs of the elements on the minor diagonal $\displaystyle (\swarrow)$
[3] Divide by the determinant of the matrix: .$\displaystyle \begin{vmatrix}a & b\\c&d\end{vmatrix} \:=\:ad-bc$

Therefore: .$\displaystyle A^{\text{-}1} \;=\; \frac{1}{ad-bc}\begin{pmatrix}d & \text{-}b \\ \text{-}c & a\end{pmatrix}$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Example: .$\displaystyle A \:=\:\begin{pmatrix}3&6\\\text{-}1&2\end{pmatrix}$

[1] "Switch" $\displaystyle (\searrow)\!:\;\;\begin{pmatrix}{\color{red}2} & 6\\\text{-}1&{\color{red}3}\end{pmatrix}$

[2] "Minus" $\displaystyle (\swarrow)\!:\;\;\begin{pmatrix}2 & {\color{red}\text{-}6} \\{\color{red}1} & 3\end{pmatrix}$

[3] Divide by: .$\displaystyle \begin{vmatrix}3&6\\\text{-}1&2\end{vmatrix} \:=\:12$

. . Therefore: .$\displaystyle A^{\text{-}1} \;=\;\frac{1}{12}\begin{pmatrix}2 & -6\\1&3\end{pmatrix} \;=\;\begin{pmatrix}\frac{1}{6} & \text{-}\frac{1}{2} \\ \frac{1}{12} & \frac{1}{4}\end{pmatrix}$ . . . . ta-DAA!

6. cheers Sobran your post looks really nice and clear, gotta install Mathtype and start using Latex myself. (I'm too lazy...)

7. Originally Posted by Peritus
cheers Sobran your post looks really nice and clear, gotta install Mathtype and start using Latex myself. (I'm too lazy...)
No need. We have one on this forum.

8. --------======== question 2 =======---------------

let's look at the first two equations:

$\displaystyle \begin{array}{l} x_1 + x_2 + x_3 + \cdots + x_n = 1 \\ ax_1 + x_2 + x_3 + \cdots + x_n = 1 \\ \end{array}$

if we subtract the first equation from the second we will get:

$\displaystyle (a - 1)x_1 = 0$

if $\displaystyle a \ne 1$ then $\displaystyle x_1$ must be equal 0.

substitute the solution for $\displaystyle x_1$ ($\displaystyle x_1=0$) in the second equation.

now look at the second and third equations:

$\displaystyle \begin{array}{l} x_2 + x_3 + \cdots + x_n = 0 \\ ax_2 + x_3 + \cdots + x_n = 0 \\ \end{array}$

after doing the same "trick", we get:

$\displaystyle (a - 1)x_2 = 0$

again we conclude that it must be that: $\displaystyle x_2=0$
we can continue in the same fashion untill we get to the last two equations namely:

$\displaystyle \begin{array}{l} x_{n - 1} + x_n = 0 \\ ax_{n - 1} + x_n = 0 \\ \end{array}$

---> $\displaystyle x_{n - 1} = 0$

after substituting the solution for $\displaystyle x_{n-1}$ in the last equation we get that $\displaystyle x_n=1$

so the final solution is: $\displaystyle \underline x = [\begin{array}{*{20}c} 0 & 0 & 0 & \cdots & 0 & 1 \\ \end{array}]$

now let's consider the case in which $\displaystyle a = 1$:

$\displaystyle \begin{array}{l} x_1 + x_2 + x_3 + \cdots + x_n = 1 \\ x_1 + x_2 + x_3 + \cdots + x_n = 1 \\ {\rm }x_2 + x_3 + \cdots + x_n = 1 \\ \vdots \\ {\rm x}_{{\rm n - 2}} + x_{n - 1} + x_n = 1 \\ {\rm x}_{{\rm n - 1}} + x_n = 1 \\ \end{array}$

we can immediately notice that the first two equations became linearly dependent, what this means to us is that now we have less constraints than unknown variables which in turn means that one of the variables can have arbitrary value, and because arbitrary value is just that any number --> we will have infinite number of solutions.

now as we look at the remaining equations we can see that every variable from $\displaystyle x_1$ to $\displaystyle x_{n-2}$ vanishes and we are left with the last equation: $\displaystyle x_{{\rm n - 1}} + x_n = 1$

thus the solution is:
$\displaystyle \underline x = [\begin{array}{*{20}c} 0 & 0 & 0 & \cdots & c & {1 - c} \\ \end{array}]$ where c can be any value.

9. ----------========= question 3 =======--------------

$\displaystyle \begin{array}{l} x_1 + {\rm }ax_2 + {\rm }bx_3 = 0 \\ ax_1 + {\rm (a}^{\rm 2} + 1)x_2 {\rm } = 0 \\ {\rm bx}_{\rm 1} {\rm + (b}^{\rm 2} - 1)x_3 = 0 \\ \end{array}$

subtract the first equation multiplied by a from the second equation, and subtract the first equation multiplied by b from the third equation:

$\displaystyle \begin{array}{l} x_1 + {\rm }ax_2 + {\rm }bx_3 = 1 \\ {\rm }x_2 {\rm - abx}_{\rm 3} = -a \\ {\rm - abx}_{\rm 2} {\rm - }x_3 = -b \\ \end{array}$

now add the second equation multiplied by ab to the third equation:

$\displaystyle \begin{array}{l} x_1 + {\rm }ax_2 + {\rm }bx_3 = 1 \\ {\rm }x_2 {\rm - abx}_{\rm 3} = - a \\ {\rm ( - 1 - a}^{\rm 2} b^2 )x_3 = - b - a^2 b \\ \end{array}$

now the system of equation is in triangular form, and can be readily solved...