Solving linear equation

334 Views Asked by At

I have learned how to solve linear equation with Gauss-Jordan Elimination method, but I have came across a type of equation I don't know how to solve using that method. I tried other methods but didn't go far.

For example, this equation:

0.4p1 + 0.8p2 + 0.1p3 = p1
0.3p1 + 0.2p2 + 0.3p3 = p2
0.3p1 + 0.0p2 + 0.6p3 = p3

A hint is given that p1+p2+p3 = 1. But I don't understand how to solve this, because p1, p2 and p3 are unknown.

I can use any method for linear equations, doesn't have to be Gauss-Jordan method. Any help is appreciated.

2

There are 2 best solutions below

5
On BEST ANSWER

Your equation can be written as $$ A p = p = I p \iff \\ A p - I p = (A-I) p = 0 $$ where $I$ is the identity matrix (upper left to lower right diagonal entries $1$, otherwise $0$).

In this case it turns out that the matrix $A-I$ is of rank $2$ only, this means the solution space is one-dimensional. One needs an extra equation, here $(1,1,1) p = 1$, to single out a unique solution.

You can first reduce to two rows and then add the extra equation, or add the extra equation for a $4 \times 3$ matrix and then go into row-echelon form, see below:

Example Calculation:

This is the matrix $A - I$ extended by the extra row $(1,1,1)$ for the additional equation:

B =

  -0.60000   0.80000   0.10000
   0.30000  -0.80000   0.30000
   0.30000   0.00000  -0.40000
   1.00000   1.00000   1.00000

With the following solution vector $b$ the resulting equation $B p = b$ will represent the equation $(A - I) p = 0$ in the first three rows and $(1,1,1) p = 1$ in the last row.

>> b
b =

   0
   0
   0
   1

We group $B$ and $b$ into one augmented matrix $[B\vert b]$.

>> M = [B,b]
M =

  -0.60000   0.80000   0.10000   0.00000
   0.30000  -0.80000   0.30000   0.00000
   0.30000   0.00000  -0.40000   0.00000
   1.00000   1.00000   1.00000   1.00000

On this we perform Gauss-Jordan elimination, to get the row-echelon form:

>> L = rref(M)
L =

   1.00000   0.00000   0.00000   0.41558
   0.00000   1.00000   0.00000   0.27273
   0.00000   0.00000   1.00000   0.31169
   0.00000   0.00000   0.00000   0.00000
6
On

The problem is that you don't have all the unknown variables $p_i$ on the same side of the equation, as you should for the normal $Ax=b$ equation. But you can just subtract them off to move them. When you do, you get

$$-0.6p_1+0.8p_2+0.1p_3=0 \\ 0.3p_1-0.8p_2+0.3p_3=0 \\ 0.3p_1+0p_2-0.4p_3=0.$$

You can solve this system with Gaussian elimination now.