You are on page 1of 3

Elementary operations:

 Interchange two rows (or columns);


 Multiply each element in a row (or column) by a non-zero number.;
 Multiply a row (or column) by a non-zero number and add the result to another row (or column).

Elementary operations notation:

Compact notation to describe elementary operations:


Operation description Notation
1. Interchange rows i and j Ri ↔ Rj
Row
2. Multiply row i by s, where s ≠ 0 sRi → Ri
operations
3. Add s times row i to row j sRi + Rj → Rj
1. Interchange columns i and j Ci ↔ Cj
Column
2. Multiply column i by s, where s ≠ 0 sCi → Ci
operations
3. Add s times columns i to columns j sCi + Cj → Cj

Elementary operators

Each type of elementary operation may be performed by matrix multiplication, using square matrices
called elementary operators.

Elementary row operations

To perform an elementary row operation on a A, an n×m matrix, take the following steps:

 To find E, the elementary row operator, apply the operation to an n×n identity matrix.
 To carry out the elementary row operation, premultiply A by E.

Illustrate this process for each of the three types of elementary row operations.

Interchange two rows

Suppose we want to interchange the first and second rows of A, a 3×2 matrix. To create the elementary row
operator E, we interchange the first and second rows of the identity matrix I3:
100010001 ⇒ 010100001
I3 E
Then, to interchange the first and second rows of A, we premultiply A by E (R1 ↔ R2):
0·4 + 1·6 + 0·20·2 + 1·7 + 0·41·4 + 0·6 + 0·21·2 + 0·7 + 0·40·4 + 0·6 +
010100001 426724 = = 674224
1·20·2 + 0·7 + 1·4
E A B

Multiply a row by a number

Suppose we want to multiply each element in the third row of Matrix A by 3. Assume A is a 3×2 matrix. To
create the elementary row operator E, we multiply each element in the third row of the identity matrix I3 by 3:
100010001 ⇒ 100010003
I3 E
Then, to multiply each element in the third row of A by 3, we premultiply A by E (3 R3 → R3):
1·4 + 0·6 + 0·21·2 + 0·7 + 0·40·4 + 1·6 + 0·20·2 + 1·7 + 0·40·4 + 0·6 +
100010003 426724 = = 4267612
3·20·2 + 0·7 + 3·4
E A B

N.B. Divide a row by a number

If we want to divide each element in some row of matrix by number n we must multiply each element of this
row by 1n.

Multiply a row and add it to another row


Assume A is a 3×2 matrix. Suppose we want to multiply each element in the first row of A by 4; and we want to
add that result to the second row of A. For this operation, creating the elementary row operator is a two-step
process. First, we multiply each element in the first row of the identity matrix I2 by 4. Next, we add the result of
that multiplication to the second row of I2 to produce E:
1001 ⇒ 100 + 4·11 + 4·0 = 1041
I2 E
Then, to multiply each element in the first row of A by 4 and add that result to the second row, we
premultiply A by E ( 4 R1 + R2 → R2):
1041 4267 = 1·4 + 0·61·2 + 0·74·4 + 1·64·2 + 1·7 = 422215
E A B

Elementary column operations

To perform an elementary column operation on a A, an n×m matrix, take the following steps:

 To find E, the elementary column operator, apply the operation to an m×m identity matrix.
 To carry out the elementary column operation, postmultiply A by E.

Examples of elementary matrix operations

Example 1.
 Use elementary row operations to convert matrix A to the upper triangular matrix
 4   2   0 
A =   1   3   2 
 -1   3   10 

Solution:
R1 ↔ R2 (interchange the first and second rows)
 4   2   0   1   3   2 
 1   3   2   ~   4   2   0   ~ 
 -1   3   10   -1   3   10 

-4 R1 + R2 → R2 (multiply 1 row by -4 and add it to 2 row); R1 + R3 → R3 (1 row add to 3 row)


 1   3   2   1   3   2 
 ~   4 + (-4)·1   2 + (-4)·3   0 + (-4)·2   ~   0   -10   -8   ~ 
 -1 + 1   3 + 3   10 + 2   0   6   12 

R2 / (-2) → R2 (divide 2 row by -2); R3 / 6 → R3 (divide 3 row by 6)


 1   3   2   1   3   2 
 ~   0   -10/(-2)   -8/(-2)   ~   0   5   4   ~ 
 0   6/6   12/6   0   1   2 

R2 ↔ R3 (interchange the 2 row and 3 row)


 1   3   2 
 ~   0   1   2   ~ 
 0   5   4 

-5 R2 + R3 → R3 (multiply 2 row by -5 and add it to 3 row);


 1   3   2   1   3   2 
 ~   0   1   2   ~   0   1   2 
 0   5 + (-5)·1   4 + (-5)·2   0   0   -6 
Solving System of Linear Equation Using MATLAB
MATLAB can be used to solve system of linear equation using the  following:

1. Finding that a matrix is non-singular you can use the syntax A^-1 or inv (A) where A is any n x n
matrix.
2. To solve a linear system using inverse you can use the syntax x = inv(A) *b

where A is the coefficient of the linear system form into matrix A , b is the constant in the linear system form
into a matrix.

3. To solve  a linear system using Gauss-Jordan or Gaussian  elimination you can use the syntax rref
([A b]). Concatenated the matrix A and b , where A is the coefficient of the linear system form into
matrix A , b is the constant in the linear system form into a matrix.
4. To Solve a linear system using LU- factorization use the following syntax

>> [L U P]= lu(A)


>> y=rref([ P*L b]
>> x=rref([U y])

You might also like