# Trouble understanding how to choose a free variable (linear algebra)

1. Feb 12, 2012

### danny_manny

1. The problem statement, all variables and given/known data

I just don't understand how one chooses a free variable when using Gaussian elimination and back substitution to solve linear equations

2. Relevant equations

3. The attempt at a solution

One particular example here is provided (already in row echelon form)

-2 -2 0 [] 0
0 0 0 [] 0
0 0 0 [] 0

The free variables to this particular example is x_2 and x_3. I'm lost what method does one use to arrive to this conclusion?

Thanks for the help.

2. Feb 12, 2012

### vela

Staff Emeritus
The variables corresponding to pivots are not free. The rest are.

3. Feb 12, 2012

### Ray Vickson

Your row-echelon form is shorthand for some equations; in this case they are -2x_1 - 2x_2 + 0x_3 = 0, 0x_1 + 0x_2 + 0x_3 = 0, 0x_1 + 0x_2 + 0x_3 = 0. You can choose x_3 to be anything you want; then you can choose x_2 to be anything, and determine x_1 (so x_2 and x_3 are free). However, you can also, instead, choose x_1 to be anything, then determine x_2 (so x_1 and x_3 are free).

Essentially, you just have one equation x_1 + x_2 = 0 in the three variables x_1, x_2 and x_3, so a *basic solution* (to borrow terminology from Linear Programming) is obtained by choosing one variable to be dependent (basic) and the other two non-basic (independent, or free), *provided that* the choice leads to a non-singular system to determine the dependent variables (so, for example, we cannot choose both x_1 and x_2 to be free because we cannot give them both arbitrary values).

RGV

4. Feb 12, 2012

### danny_manny

what do you mean by pivots?

5. Feb 12, 2012

### vela

Staff Emeritus
Sorry, I assumed you were familiar with row-echelon form jargon. A pivot is the first non-zero entry in a row. In this problem, the -2 at the start of the first row is a pivot, so x1 would not be free. Since there are no other non-zero rows, the remaining variables are free.

To add to what Ray said, this isn't the only way to decide which variables are free and which aren't. It's just that once you have the system in row-echelon form, it's a straightforward way to choose.

6. Feb 12, 2012

### Ray Vickson

Your description vs. mine would be a bit clearer if we had different numbers in row 1, so say we have
$$\left| \begin{array}{cccc} 1&2&0&0\\ 0&0&0&0 \\ 0&0&0&0 \end{array} \right|,$$
corresponding to listing the variables as $x_1, x_2, x_3$ from left to right.
By some definitions, that makes x_1 a "leading" variable and x_2 free (as well as x_3). That would regard x_2 as an independent variable and would correspond to writing $x_1 = -2 x_2.$ Obviously, we can let x_2 have any value under the Sun and can then determine a corresponding unique value of x_1.

However, there is nothing sacred about the ordering $x_1, x_2, x_3.$ We could re-order them as $x_2, x_1, x_3,$, giving the augmented system in which columns 1 and 2 are swapped:
$$\left| \begin{array}{cccc} 2&1&0&0\\ 0&0&0&0 \\ 0&0&0&0 \end{array} \right| .$$
Now x_2 is the "leading" variable and x_1 is free. This corresponds to writing
$x_2 = -(1/2)x_1.$ We can let x_1 be anything and then determine the value of x_2.

So, which variables are free depends on how you order the columns; most well-written numerical linear algebra codes allow for column interchanges in order to decrease roundoff errors in finite-wordlength calculations, so would not decide the free variables ahead of time.

RGV