Chapter 2 - Matrix Algebra
Chapter 2 - Matrix Algebra
CHAPTER TWO
Introduction
A matrix is simply a rectangular arrangement of real numbers and characterized by
its elements, orders and rules applied for it. Matrices are widely applied in the
representation of linear equation and systems of linear equation, solving systems of
linear equations, input out put analysis, markov chain analysis, and so forth,
What is matrix?
A matrix (plural matrices) is a rectangular array of real numbers, which is
enclosed by large bracket [] or brasses ( ) subject to certain rules of
operation.
The real numbers which form the array are called the entries or elements of
the matrix. The elements in any horizontal line form a row and those in any
vertical line form a column of the matrix.
A matrix is farther characterized by its dimension. The dimension or order
indicates the number of rows and the number of columns contained with in
the matrix.
If a matrix has m rows and n columns, it’s said to have dimension :
m x n, which is real “m by n”.
Consider the following matrix which has dimension 5x3, or it’s a “5 by 3” matrix
75 82 86
Example: 91 95 100
65 70 68
59 80 99
75 76 74
General form:-
A matrix a containing elements aij has the general form
This generalized matrix is represented as having m rows and n columns, then it is said to
be of size m x n (read m by n).
The subscripts on an element aij indicates that the element is located at the intersection of
row i and column j of the matrix. For example, a21 is located at the intersection of row 2
and column 1 the elements a35 would located in row 3 and column 5 of the matrix.
Special types of matrices.
a. Vectors: A matrix having only one row or one column.
I. Row Vector (matrix) having only one row
II. Column Vector (matrix) having only one column
b. Square Matrices
- A matrix having the same number of rows and columns
- If the dimension of a matrix is an m x n square matrix is such that m = n
c. Identity matrix
- Also called a unit matrix
- Is a square matrix for which the elements along the primary diagonal all
equal 1 while all other elements equal 0
d. Transpose of a matrix
- There are times when the data elements in a matrix need to be arranged
- One arrangement is to form the transpose of a matrix.
Example: - A= 3 2
4 0
1 -2
- Given the (m x n) matrix, A, with elements aij, the transpose of A denoted by At
is an (n x m) matrix which contains elements.
at ij = aji so, At = 3 4 1
2 0 -2
x1 - x2 + x 3 = 1
2x2 - x3 = 1
2x1 + 3x2 = 1
1 −1 1 x1 1
Let A = 0 2 − 1 , X = x2 , B = 1
2 3 0 x3 1
Now our matrix equation is: AX = B
• if A-1 exists
• we can do some algebra with our matrix equation
• much like solving ordinary linear equations:
AX = B
A-1AX = A-1B (mult both sides on the left by A-1)
IX = A-1B
X = A-1B
Good news: once we have A-1, we can easily solve the system for any B –– just multiply
B on the left by A-1 !!!
Operations on matrices
1 3 − 5 0 −1 − 2 1 2 − 7
+ =
2 1 3 3 0 1 __ __ __
If dimensions are different, addition and subtraction are undefined
Scalar multiplication
1 3 − 5 3 9 __
3 =
2 1 3 __ __ __
Example 1 2 3 -2 1 2
Given A= 4 5 6 and B= 3 2 1
2 1 4 1 3 2
Solution:
Here A and B are both of size 3 x 3, thus AB and BA are both defined and
both have size (3 x 3)
1 2 3 -2 1 2
AB = 4 5 6 3 2 1
2 1 4 1 3 2
7 14 10
Given AB = 13 32 25
3 16 13
Calculate for BA =?
Example:-
Suppose that a firm manufactures two products: I and II, by using different amounts
of the three raw materials, P,Q, and R. let the units of row materials used for the two
products be given by the following matrix.
Raw materials
P Q R
Product I 3 2 4 =A
II 2 5 1
(3 5 -4) X1
X2
X3
- Where the raw vector contains the coefficients for each variable in the expression
and the column vector contains the variables. Multiply the two vectors to verify that
the inner product does result in the original expression.
- To represent the equation 3x1+ 2x2 – 4x3 =25 , we can equate the inner product with
a (1X1) matrix containing the right – side constant ,
- or
(3 5 -4) x1 = (25)
x2
X3
- Remember that for two matrices to be equal, they must have the same dimension.
The inner product always results in a (1x1) matrix, which in this case contains one
element expression 3x1+ 2x2 – 4x3
- A linear equation of the form a1x1 + a2x2 + a3x3+ …… + anxn = b can be
represented in matrix form as: (a1 a2 ……….. an ) x1 = b
x2
x3
Matrix Representation of system of linear Equations.
- Where as single equations may be represented using the inner product ,a system of
equations can be represented using matrix multiplications consider, for example:-
2x – 3y = 7
4x + y = 21
2x – 3y = 7
4x + y 21
There fore, 2 -3 x = 7
4 1 y 21
A= 2 -3 X= x and B = 7
4 1 y 21
Example:-
Solution: 2 3 4 x 7
0 4 -5 Y = 2
-2 0 3 z -6
Solution: 1 -2 0 3 1 X1 100
A= 2 0 -3 1 0 X= X2 and B = 60
0 4 -1 2 1 X3 125
X4
AX = B X5
Solution: 1 -2 0 3 1 X1 100
A= 2 0 -3 1 0 X= X2 and B = 60
0 4 -1 2 1 X3 125
X4
X5
Example III:- A dealer of colour television sets has five 26 inch sets , eight 20 inch sets,
four 19 inch sets, and Ten 12 inch sets. The 26 inch sets is sold for $ 650 each, the 20
inch sets is sold for $ 500 casch , the 18 inch sets is sold for $ 300 each , and the 12 inch
set 5 is sold for $ 300 each express the total selling price for his television stock as the
product of two matrices.
Solution:
650
Total seling price = (8 5 4 10) 550 = $ 12,650
500
300
a1X1 + b1 X2 = C1
a2X1 + b2 X2 = C2
X1 = V1
X2 = V2 [(V1V2 )] is the solution set
Gauss-Jordan Elimination
GAUSS-JORDAN ELIMINATION:
A. If you get a row of all zeros, use row op 1 to make it the last row
B. If you get a row with all zeros to the left of the line, and a non-zero on the right, STOP
(no solution).
Example:
2 − 2 1 3
3 1 −1 7 R3 R1
1 − 3 2 0
1 − 3 2 0
3 1 −1 7 - 3R 1 + R 2 → R 2
- 2R 1 + R 3 → R 3
2 − 2 1 3
1 − 3 2 0
0 10 − 7 7 1
R R2
10 2
0 4 − 3 3
1 − 3 2 0
3R2 + R1 R1
0 1 − 7 7 -4R2 + R3 R3
10 10
− 3 3
0 4
1 21
1 0 −
10 10
0 7 7
1 − -5R3 R3
10 10
1 1
0 0 −
5 5
By: Zelalem L. Page 15
Rift Valley University College
1 21
1 0 − 1
10 10 R3 + R1 R1
0 7 7 10
1 −
10 10 7
R3 + R2 R2
0 0 1 −1 10
1 0 0 2
0 1 0 0
0 0 1 − 1
Answer: x1 = 2, x2 = 0, x3 = -1
1 2 3
0 1 2 No solution
4
0 0
1 0 1 − 3/ 7
8 / 7
Infinitely many solutions
0 1 −2
• when there are infinitely many solutions
• we state "the solution" parametrically.
• above reduced form corresponds to the system:
x1 + x3 = -3/7
x2 - 2x3 = 8/7
The variables x1 and x2 on the left appear nowhere else. The variable (or variables) on
the right can be chosen arbitrarily to be any real numbers (we use “t” for this)
2. State your solution parametrically:
(Since there are infinitely many real numbers t to choose from, this represents infinitely
many solutions)
Now note:
a b 1 0 1 0 a b a b
= =
c d 0 1 0 1 c d c d
so the system of 2 × 2 matrices also has an identity element, called the identity
matrix, denoted by “I”
In fact, the system of 3 × 3 matrices has its own identity matrix, also denoted by I.
When I is mentioned, its dimension must be inferred from context.
Multiplicative inverse
Q: does every square matrix A have a multiplicative inverse? That is, a matrix A-1
such that AA-1 = A-1A = I ?
A: Some do, some don’t.
Our job:
a b
• given matrix A = (or any square matrix)
c d
-1
c d
• find, if possible, a matrix A = such that
e f
a b c d c d a b 1 0
= =
c d e f e f c d 0 1
Here’s how!
1 −1 1
-1
Example: find A for A = 0 2 − 1
2 3 0
The procedure:
(1) start with:
1 −1 1 1 0 0
0 2 −1 0 1 0
2 3 0 0 0 1
(2) Do row operations to put the left matrix in reduced form
(3) If the left matrix is I, the right matrix will be A-1
(4) If the left matrix is not I, A has no inverse.
Here goes:
1 −1 1 1 0 0
0 2 −1 0 1 0 -2R1 + R3 R3
2 3 0 0 0 1
1 −1 1 1 0 0
0 2 −1 0 1 0 ½ R2 R2
0 5 −2 −2 0 1
1 −1 1 1 0 0 R + R
2 R1
1 1 1
0 1 − 0 0 -5R2 + R3 R3
2 2
0 5 −2 −2 0 1
1 1
1 0
2
1
2
0
1 1
0 1 − 0 0 2R3 R3
2 2
1 5
0 0 −2 − 1
2 2
1 1
1 0
2
1
2
0
1 1
0 1 − 0 0 2R3 R3
2 2
1 5
0 0 −2 − 1
2 2
1 1
1 0
2
1
2
0
-½ R3 + R1 R1
1 1
0 1 − 0 0 ½ R3 + R2 R2
2 2
0 0 1 −4 −5 2
1 0 0 3 3 − 1
0 1 0 −2 −2 1
0 0 1 −4 −5 2
Left matrix is I, so
3 3 − 1
-1
A = − 2 −2 1
− 4 −5 2
Check it out!