Matrices: CE 310: Advanced Engineering Math For CE Engr. Aldrin Bangud 12
Matrices: CE 310: Advanced Engineering Math For CE Engr. Aldrin Bangud 12
column
*For matrix E
m=4
n=3
Dimension – 4 x 3
“Matrix E is a 4 x 3 matrix”
e43 = 9
e12 = 6
1. Square Matrix
- The number of rows is equal to the number of columns (m = n)
- Example:
3 −4 0 4
A=
[
6 8 5 5
3 5 2 0
7 −1 3 −7
2. Rectangular Matrix
]
- The number of rows is not equal to the number of columns (m ≠ n)
- Example:
2 3 6
A=
3 2 1
0 2 1
3. Row Matrix
[ B=] 5 2 3
6 1 8
8 7 2
[ ]
- The number of rows is equal to one (m = 1)
- The number of columns is greater than one (n ¿ 1)
- Symbol: open-topped bracket
- Example:
B = [6 3 8 4]
B
4. Column Matrix
- The number of columns is equal to one (n = 1)
- The number of rows is greater than one (m ¿ 1)
- Symbol: { } brace
- Example:
8
C=
{C }
3
4
5
[]
Special Types of Square Matrices
1. Symmetric Matrix
- The elements are symmetric with respect to the main diagonal
- aij = aji
example: a21 = a12, a32 = a23, a31 = a13, etc.
- example:
[
A = −1 0 −2
5 2 0 ]
3. Diagonal Matrix
- All elements off the main diagonal are equal to zero
- example:
5 0 0 0
A=
[ ]
0 2 0 0
0 0 8 0
0 0 0 2
4. Identity Matrix
- A diagonal matrix where all elements on the main diagonal are equal to
one
- symbol: [ I ]
- example:
1 0 0 0
A=
[ ]
0 1 0 0
0 0 1 0
0 0 0 1
5. Upper Triangular Matrix
- All the elements below the main diagonal are zeros
- example:
5 8 2
A= 0 6 3
0 0 1[ ]
6. Lower Triangular Matrix
- All the elements above the main diagonal are zeros
- example:
5 0 0
A= 8 2 0
6 3 1[ ]
Other Types of Matrices
Equal Matrices
- the same dimension
the same number of rows
the same number of columns
- corresponding elements are equal
example, A = B, then
a11 = b11, a24 = b24, etc.
- example:
8 7 8 8 7 8
A= 6 5 9
2 3 3 [ ] ∴A=B
B= 6 5 9
2 3 3 [ ]
MATRIX OPERATIONS
1. Matrix Addition
- Matrices should have the same dimension
- Add corresponding elements of each matrix
- Example:
8 6 6 7
A=
2 4 [ ]B=
3 2 [ ]
A+B= [ 8+6
2+3
6+7
4 +2
=
14 13
] [
5 6 ]
CE 310: Advanced Engineering Math for CE Engr. Aldrin Bangud 15
Properties of Matrix Addition
1. Commutative
A+B=B+A
A+B+C=C+A+B=C+B+A
2. Associative
A + B + C + D = (A + B) + (C + D) = (A + B + C) + D = (A + C) + (D + B)
2. Matrix Subtraction
- Matrices should have the same dimension
- Subtract corresponding elements of each matrix
- Associative
A + B – C = (A + B) – C = (A – C) + B = (B – C) + A
- Example:
6 4
A=
2 3[ ]
2 8
B= [ ]
4 3
6−2 4−8 4 −4
A–B= [
2−4 3−3
=
−2 0 ] [ ]
3. Scalar Multiplication
- Scalar: positive/negative number
- Multiply every element of the matrix by the constant factor
- Example:
2 15
B=
6 0 [ ]
2 x 2 2 x 15 4 30
2B = [
2x 6 2 x0
=
12 0 ] [ ]
Properties of Scalar Multiplication
Let a = constant factor
b = another constant factor
A = matrix
B = another matrix
1. a(bA) = (ab)A
example: (7)(8A) = 56A
2. (a + b)A = aA + bA
example: (8 + 3)A = 8A + 3A
3. a(A + B) = aA + Ab
example: 3(A + B) = 3A + 3B
4. A(aB) = a(AB) = (aA)B
example: A(6B) = 6(AB) = (6A)B
5. Matrix Multiplication
- Two matrices can be multiplied only if:
The number of columns of the first matrix = the number of rows of
the second matrix
The dimension of the product is:
m = number of rows of the first matrix
n = number of columns of the second matrix
A x B = C
m1 x n1 m2 x n2 m1 x n2
n1 = m 2
-
Not commutative
AB ≠ BA
Example:
8 1 5
A=
5 0 9
3 6 7
8 4 2
For A: m = 4, n = 3
[ ] 2 9
B= 3 8
4 7 [ ]
3
2
4
For B: m = 3, n = 3
Check: Is n1 = m2?
n1 = 3, m2 = 3
Since n1 = m2, matrix multiplication can be performed.
2 9 3
[ ] 3 8 2
4 7 4
(8)(2) + (1)(3) + (5)(4) = 39
8 1 5
[ ]
5
3
8
0
6
4
9
7
2
[¿]
2 9 3
[ ] 3 8 2
4 7 4
(5)(9) + (0)(8) + (9)(7) = 108
8 1 5
[ ]
5
3
8
0
6
4
9
7
2
[¿]
[ ]
3 8 2
4 7 4
8 1 5
[ ]
5
3
8
0
6
4
9
7
2
[¿] (8)(3) + (4)(2) + (2)(4) = 40
2 9 3
[ ]
3 8 2
4 7 4
8 1 5 39 115 46
[ ] [
5
3
8
0
6
4
9
7
2
46
52
36
108
124
118
51
49
40
]
Properties of Matrix Multiplication
1. If A, B and C are of the appropriate sizes, then A(BC) = (AB)C.
2. If A, B and C are of the appropriate sizes, then A(B + C) = AB + AC.
3. If A, B and C are of the appropriate sizes, then (A + B)C = AC + BC
A B C D E F G H
1
2 8 11 12 =transpose(B7:D9)
3 A= 6 3 2 BT =
4 7 8 9
5
6 =mmult(B2:D4, B7:D9)
7 7 12 0 AB =
8 B= 5 4 3
9 6 8 9
10 =minverse(B2:D4)
11 A-1 =
After typing the formula, simultaneously press the ctrl and shift keys and after
which press the enter key. (except for finding the determinant; just press the
enter key after typing the formula)
DETERMINANTS
Determinant
- A number associated with square matrices
- The determinant of a matrix is of the same order as the matrix (A matrix
of n rows and n columns is called a square matrix of order n; 5 x 5
matrix- order 5, 6 x 6 matrix – order 6, etc.)
Second-order determinant: 2 x 2 matrices
Third-order determinant: 3 x 3 matrices
- It is customary to indicate the determinant of a matrix by enclosing the
elements of the matrix by vertical bars instead of brackets.
- Example:
3 4
−2 5 | |
Determinant of Order Two
a11 a 12
A= [
a21 a 22 ]
| A| = a11a22 – a12a21
Example:
3 4
A= [
−2 5 ]
CE 310: Advanced Engineering Math for CE Engr. Aldrin Bangud 20
| A| = (3)(5) – (4)(-2)
= 23
Example:
3 4 6 3 4
[
A = 5 −1 −7 5 −1
8 0 4 8 0 ]
3 4 6 3 4
| A| = 5 −1 −7 5 −1
8 0 4 8 0
Properties of Determinants
1
]
AT =
T
6 0 1
[
−3 2 −1 0
5 0 −5 1
| A | = -1,119
5
]
2. If matrix B results from A by interchanging two rows/two columns of A, then
|B| = - | A|.
Example:
4 6 −3 5
A=
[
5 0 2
2 1 −1 −5
−5 5 0
| A| = -1,119
0
1
]
Interchanging the first and third rows:
2 1 −1 −5
B=
[
5 0 2
4 6 −3 5
−5 5 0
|B| = 1,119
0
1
]
Interchanging the 2nd and 3rd columns:
4 −3 6 5
C=
5
[2 0 0
2 −1 1 −5
−5 0 5 1
]
|C| = 1,119
3. If two rows/two columns of A are equal, then | A| = 0.
Example:
4 6 −3 5 4
[
5 0 2 0 5
A = 2 1 −1 −5 2
5 5 0
3 −7 4
1 5
4 3
]
| A| = 0
5 0 0 5 1
5
A= 1
5
0
[ 0 −6 3
0 3
4
7 −2
0 −6 3
0 2 −5 1
4 ]
| A| = 0
5 3 5 2 2
A= 0
4
3
−1
[ 2 −1
0 0
2 −4
2 6
5 2
0 0
5 6
4 −5
]
| A| = 0
Example:
4 6 −3 5
A=
[5 0 2 −3
2 1 −1 −5
−5 5 0
| A| = -1,134
1
]
Multiplying the 2nd row by 3
4 6 −3 5
B=
[
15 0 6 −9
2 1 −1 −5
−5 5 0
|B| = -3,402
1
]
Using the property:
8 6 −3 5
C=
[ 10
4
−10
0 2 −3
1 −1 −5
5 0 1
]
|C| = -2,268
Using the property:
|C| = 2| A| = 2(-1,134) = -2,268
[
5 x 2 0 x 2 2 x 2 −3 x 2
−5
2 1
5
4
−1
0
6
−5
−3
1
5
]
[ 5
2
0
1
2
−1
−3
−5
10+−5 0+5 4+ 0 −6+ 1
]
4 6 −3 5
B=
[ 5
2
5
0 2 −3
1 −1 −5
5 4 −5
]
|B| = -1,134
Multiply the 4th column by -3 and add the results to the 2nd column:
[ 5
2
−5
0 2 (−3 ) (−3)
1 −1 (−5 )(−3 )
5 0 ( 1 ) (−3)
]
4 6 +(−15) −3 5
[ 5
2
0+9
1+15
−5 5+(−3)
2 −3
−1 −5
0 1
]
4 −9 −3 5
C=
[ 5 9 2 −3
2 16 −1 −5
−5 2 0 1
]
|C| = -1,134
[
0 −5 3 2 −6
A= 0 0 6 4 7
0 0 0 4 8
0 0 0 0 −3
]
| A| = 360
Using the property:
| A| = (1)(-5)(6)(4)(-3) = 360
0 0 0 0 3
A= 0 0
0 0
2 0
[ 0 −1 4
4
0 −8 −2 8 4
5
9 6
5 4
]
| A|= 192
Using the property:
| A| = (2)(-8)(4)(-1)(3) = 192
[
0 −5 0 0
A= 0 0 5 0
0 0 0 −6 0
0 0 0 0 −1
0
0
]
| A| = -300
Using the property:
| A| = (2)(-5)(5)(-6)(-1) = -300
1
]
1 5 9 2
B=
[
2 −8 4 5
6 2 1 −4
−8 0 3 7
|B| = 306
]
−42 −34 72 85
AB =
[
17
38
29
0
47 2
6 −22
−3 −65 −22 22
| AB| = -342,414
]
Using the property:
| AB| = | A||B| = (-1,119)(306) = -342,414
1
10. If A is nonsingular, then | A| ≠ 0 and | A−1| = .
| A|