Professional Documents
Culture Documents
Attendance3 1
Attendance3 1
Matrix Algebra
or, [ ] [ ]
𝑎11 𝑎12 𝑎13 500 800 1300
𝐵= =
𝑎21 𝑎22 𝑎23 400 400 700
(a) Entry in 𝑖th row, 𝑗th column is 𝑎𝑖𝑗 ; for example, 𝑎23 = 700.
Also, 𝑎22 = 400 / 500 / 700 / 800.
(b) Dimension of matrix 𝐵 is number of rows, 𝑚, by number of columns, 𝑛:
𝑚 × 𝑛 = 3 × 2 / 2 × 2 / 3 × 3 / 2 × 3.
(c) Matrix square if 𝑚 = 𝑛, so matrix 𝐵 is / is not square.
(d) Matrix 𝐵 has 1 / 2 / 3 row vectors, each dimension 1×3 / 3×1 / 1×2.
(e) Matrix 𝐵 has 1 / 2 / 3 column vectors, each dimension 2×1 / 1×2/ 3×1.
33
34 Chapter 3. Matrix Algebra (LECTURE NOTES 3)
3 −2 −1 0
(a) Then ⎡ ⎤ ⎡ ⎤
6 4 2 24
4𝐴 = 4 ⎣ −2 1 3 ⎦ = ⎣
⎢ ⎥ ⎢ ⎥
⎦
3 5 1
(b) Then [ ]
𝑇 2 4 6
𝐵 =
(c) Then ⎡ ⎤
( )𝑇 2
𝐵𝑇 =⎣ 4
⎢ ⎥
⎦
6
Section 1. Matrix Addition and Applications (LECTURE NOTES 3) 35
(d) Then
⎡ ⎤ ⎡ ⎤ ⎡ ⎤
2 3 0 0
𝐵 + 0 = ⎣ 4 −1 ⎦ + ⎣ 0 0 ⎥
⎢ ⎥ ⎢
⎦=⎣
⎢ ⎥
⎦
6 4 0 0
(e) Then
[ ] [ ] [ ]
𝑇 6 4 5 2 4 6
𝐶 +𝐵 = + =
2 1 4 3 −1 4
(f) Then
[ ] [ ] [ ]
𝑇 2 4 6 6 4 5
𝐵 +𝐶 = + =
3 −1 4 2 1 4
(h) Then
[ ] [ ] [ ]
𝑇 𝑇 6 4 5 2 4 6
𝐶+𝐵 +3𝐶 = 4𝐶+𝐵 = 4 + =
2 1 4 3 −1 4
(i) Then
[ ] [ ] [ ]
𝑇 6 4 5 2 4 6
𝐶 −𝐵 = − =
2 1 4 3 −1 4
2nd MATRIX [A] EDIT ENTER 2 ENTER 3 ENTER, data: 500 ENTER 800 ENTER ... 700 ENTER.
2nd MATRIX EDIT [B] ENTER 2 ENTER 3 ENTER, data: 30 ENTER 300 ENTER ... 10 ENTER.
2nd MATRIX EDIT [C] ENTER 2 ENTER 3 ENTER, data: 400 ENTER 1000 ENTER ... 600 ENTER.
(b) Transpose
⎡ ⎤
{[ ]}𝑇
130 100 140
𝐸 𝑇 = (𝐵 + 𝑃 − 𝑆)𝑇 = =⎣
⎢ ⎥
100 100 110
⎦
(d) If [ ] [ ]
500 800 1300 450 + 𝑥 800 1300
=
400 400 700 400 400 700
500 = 450 + 𝑥 then 𝑥 = −25 / −50 / 50
(e) If [ ] [ ]
500 + 3𝑥 800 1300 450 + 𝑥 800 1300
=
400 400 700 400 400 700
500 + 3𝑥 = 450 + 𝑥 then 2𝑥 = −50 or 𝑥 = −25 / −50 / 50
A A
A
B B
B
C C
C
(b) (c)
(a)
0 0 1
And so [ ]
𝐼2 =
(a) Then ⎡ ⎤ ⎡ ⎤
6 4 2 1 0 0
𝐴 × 𝐼 = ⎣ −2 1 3 ⎦ × ⎣ 0 1 0 ⎥
⎢ ⎥ ⎢
⎦
3 5 1 0 0 1
⎡ ⎤
=⎣
⎢ ⎥
⎦
(b) Then ⎡ ⎤ ⎡ ⎤
6 4 2 6 4 2
2
𝐴 = 𝐴 × 𝐴 = ⎣ −2 1 3 ⎦ × ⎣ −2 1 3 ⎦
⎢ ⎥ ⎢ ⎥
3 5 1 3 5 1
⎡ ⎤
=⎣
⎢ ⎥
⎦
(c) Then
⎡ ⎤ ⎡ ⎤ ⎡ ⎤
6 4 2 6 4 2 6 4 2
3
𝐴 =𝐴×𝐴×𝐴=⎣
⎢
−2 1 3 ⎦×⎣
⎥ ⎢
−2 1 3 ⎦×⎣
⎥ ⎢
−2 1 3 ⎥
⎦
3 5 1 3 5 1 3 5 1
⎡ ⎤
=⎣
⎢ ⎥
⎦
(d) Then ⎡ ⎤
2 3 [ ]
6 4 5
𝐵𝐶 = 𝐵 × 𝐶 = ⎣ 4 −1 ⎦ ×
⎢ ⎥
2 1 4
6 4
⎡ ⎤
=⎣
⎢ ⎥
⎦
(e) Then ⎡ ⎤
[ ] 2 3
6 4 5
𝐶𝐵 = 𝐶 × 𝐵 = × ⎣ 4 −1 ⎥
⎢
2 1 4
⎦
6 4
[ ]
=
(f) Then ⎡ ⎤
[ ] 2 3
6 4 5
𝐶𝐵 = × ⎣ 4 −1 ⎦
⎢ ⎥
2 1 4
6 4
⎡ ⎤ ⎡ ⎤ ⎤
2 3
⎡
[ ] [ ]
⎢
⎢ 6 4 5 ⋅⎣
⎢
4 ⎥
⎦ 6 4 5 ⋅⎣
⎢
−1 ⎥ ⎥
⎦ ⎥
6 4
⎢ ⎥
⎢ ⎥
= ⎢ ⎡ ⎤ ⎡ ⎤ ⎥
⎢
⎢ [ ] 2 [ ] 3 ⎥
⎥
2 1 4 ⋅⎣ 4 2 1 4 ⋅⎣ −1
⎢ ⎢ ⎥ ⎢ ⎥ ⎥
⎣ ⎦ ⎦ ⎦
6 4
[ ] [ ]
6(2) + 4(4) + 5(6) 6(3) + 4(−1) + 5(4)
= =
2(2) + 1(4) + 4(6) 2(3) + 1(−1) + 4(4)
Each row of first matrix is multiplied by each column of second matrix.
Number of columns of first matrix must equal number of rows of second
matrix: (𝑚 × 𝑛) × (𝑛 × 𝑞) = 𝑚 × 𝑞.
(g) Then ⎤⎡ ⎡ ⎤
2 3 [ ] 6 4 2
6 4 5
𝐵𝐶𝐴 = ⎣ 4 −1 ⎦ × × ⎣ −2 1 3 ⎦
⎢ ⎥ ⎢ ⎥
2 1 4
6 4 3 5 1
⎡ ⎤
=⎢
⎣
⎥
⎦
2nd MATRIX [B] ENTER × 2nd MATRIX [C] × 2nd MATRIX [A] ENTER.
3. Cholesterol and Diets. Three patients, at beginning of first, second, third and
fourth months, had following cholesterol levels,
40 Chapter 3. Matrix Algebra (LECTURE NOTES 3)
Furthermore, cholesterol levels for four months under three different diets are
related by following matrix of factor gain per cholesterol values,
(a) Amount of cholesterol gained by three patients in four months under four
diets is ] ⎡ 2 1.7 1.9
[ ⎤
220 215 210 205
2.2 2.3 2.4
𝐴×𝐵 = 220 210 200 195 ×⎣ ⎦
2 2.7 1.6
210 205 195 190
1.8 1.3 2.4
[
220(2) + 215(2.2) + 210(2) + 205(1.8) 220(1.7) + 215(2.3) + 210(2.7) + 205(1.3)
= 220(2) + 210(2.2) + 200(2) + 195(1.8) 220(1.9) + 210(2.4) + 200(1.6) + 195(2.4)
210(1.7) + 205(2.3) + 195(2.7) + 190(1.3) 210(1.9) + 205(2.4) + 195(1.6) + 190(2.4)
4. More Properties.
[ ] [ ] [ ] [ ]
1 0 2 5 2 5 0 0
𝐴= , 𝐵= , 𝐶= , and 𝐷=
0 0 8 8 4 1 4 1
(a) Since [ ] [ ] [ ]
1 0 2 5 2 5
𝐴𝐵 = × =
0 0 8 8 0 0
and [ ] [ ] [ ]
1 0 2 5 2 5
𝐴𝐶 = × =
0 0 4 1 0 0
Section 2. Matrix Multiplication and Applications (LECTURE NOTES 3) 41
i. 𝐴𝐵 = 𝐴𝐶 but sometimes 𝐵 ∕= 𝐶
ii. 𝐴𝐵 = 𝐴𝐶 and 𝐵 = 𝐶 always
(b) Since [ ] [ ] [ ]
1 0 0 0 0 0
𝐴𝐷 = × =
0 0 4 1 0 0
i. 𝐴𝐷 = 0 but sometimes 𝐴 ∕= 0 and 𝐷 ∕= 0
ii. 𝐴𝐷 = 0 but 𝐴 = 0 and 𝐷 = 0 always
𝑥
⎡ ⎤
⎡ ⎤ ⎡ ⎤
220 215 210 205 20
⎢ 𝑦 ⎥
𝐴 = ⎣ 220 210 200 195 ⎦ , 𝑋= and 𝐵 = ⎣ −1 ⎦
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
𝑧
⎢ ⎥
210 205 195 190 30
⎣ ⎦
𝑤
and ⎡ ⎤
x
𝑋 =⎣
⎢ ⎥
⎦
and ⎡ ⎤
𝐵=⎢
⎣ −98 ⎥
⎦
42 Chapter 3. Matrix Algebra (LECTURE NOTES 3)
(a) Inverse of 𝐴
⎡ ⎤−1 ⎡ ⎤
6 4 2
𝐴−1 = ⎣ −2 1 3 ⎦ =⎣
⎢ ⎥ ⎢ ⎥
⎦
3 5 1
2nd MATRIX EDIT [A] ENTER 3 ENTER 3 ENTER, type in data, 2nd QUIT,
2nd MATRIX [A] ENTER 𝑥−1 ENTER, then to get fractional form, MATH ENTER.
(b) Inverse of 𝐵
[ ]−1 [ ]
−1 2 3
𝐵 = =
4 −1
2nd MATRIX EDIT [B] ENTER 2 ENTER 2 ENTER, type in data, 2nd QUIT,
2nd MATRIX [B] ENTER 𝑥−1 ENTER, then to get fractional form, MATH ENTER.
(a) If [ ] [ ]
𝑎 𝑏 3 7
𝐴= =
𝑐 𝑑 5 4
then inverse
[ ] [ ] [ ]
−1 1 𝑑 −𝑏 1 4 −7
𝐴 = = =
𝑎𝑑 − 𝑏𝑐 −𝑐 𝑎 (3)(4) − (7)(5) −5 3
Check: 2nd MATRIX [A] 2 ENTER 2, type in data, then 2nd MATRIX [A] ENTER 𝑥−1 ENTER,
then, for fractional form, MATH ENTER.
Inverse for larger dimension matrices solved using Gauss-Jordan.
(b) If ⎡ ⎤ ⎡ ⎤
2 4 2 −0.25 0 0.5
𝐴 = ⎣ −2 1 3 ⎦ , 𝐵 = ⎣ 0.55 −0.2 −0.5 ⎦
⎢ ⎥ ⎢ ⎥
𝐴𝐵 = ⎣ =𝐼
⎢ ⎥
⎦
so (choose two!)
i. 𝐵 is inverse of 𝐴
ii. 𝐴 is inverse of 𝐵
iii. 𝐴 is transpose of 𝐵
iv. 𝐵 is transpose of 𝐴
(c) Not all square matrices have inverses.
[ ] [ ]
𝑎 𝑏 2 −4
𝐴= =
𝑐 𝑑 −3 6
𝐴𝑋 = 𝐵
where ⎡ ⎤ ⎡ ⎤ ⎡ ⎤
2 4 2 𝑥 6
𝐴 = ⎣ −2 1 3 ⎦ , 𝑋=⎣ 𝑦 ⎦ and 𝐵=⎣ 4 ⎦
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
3 2 1 𝑧 5
44 Chapter 3. Matrix Algebra (LECTURE NOTES 3)
2nd MATRIX [A] 3 ENTER 3 ENTER, enter numbers; and 2nd MATRIX [B] 3 ENTER 1, enter numbers
intersection given by
𝑋 = 𝐴−1 𝐵
or
⎡ ⎤ ⎡ ⎤−1 ⎡ ⎤ ⎡ 5 1
⎤⎡ ⎤ ⎡ ⎤
𝑥 2 4 2 6 − 20 0 2
6
11
⎢
⎣ 𝑦 ⎦=⎣
⎥ ⎢
−2 1 3 ⎥
⎦ ⎣ 4 ⎦=⎣
⎢ ⎥ ⎢
20
− 12 ⎥
⎦⎣ 4 ⎦ = ⎣
⎢ ⎥ ⎢
0 ⎥
⎦
4 1
𝑧 3 2 1 5 10 2
5
2nd MATRIX [A] 𝑥−1 × 2nd MATRIX [B] ENTER
in other words, (𝑥, 𝑦, 𝑧) = (1, 0, 2).
3 2 1
3 2 1 0 0 1
2nd MATRIX [A] 3 ENTER 6 ENTER, then type in data
1
⎡ ⎤
1
𝑅 →𝑅1
1 2 2
0
2 1
−→ ⎣ −2 1 3 0 1 0
⎢ ⎥
⎦
3 2 1 0 0 1
1
2nd MATRIX MATH *row ( 2
, [A], 1) STO→ [B] then MATH ENTER
1
⎡ ⎤
1 2 1 2
0 0
𝑅2 +2𝑅1 →𝑅2 , 𝑅3 −3𝑅1 →𝑅3
−→ ⎣ 0 5 1 0 ⎥
⎢
⎦
0 −4 − 32 0 1
2nd MATRIX MATH *row+( 2, [B], 1, 2) STO→ [C], 2nd MATRIX MATH *row+( -3, [C], 1, 3) STO→ [D]
1
⎡ ⎤
1 1 2
𝑅 →𝑅2
1 2
0 0
5 2 1
−→ ⎣ 0 1 1 0 ⎥
⎢
5 ⎦
0 −4 −2 − 32 0 1
1
2nd MATRIX MATH *row ( 5
, [D], 2) STO→ [E] then MATH ENTER
− 25 0
⎡ ⎤
1 0 −1
𝑅1 −2𝑅2 →𝑅1 , 𝑅3 +4𝑅2 →𝑅3 1 1
−→ ⎣ 0 1 1 0 ⎥
⎢
5 5 ⎦
7 4
0 2 − 10 5
1
Section 4. More Applications of Inverses (LECTURE NOTES 3) 45
2nd MATRIX MATH *row+( -2, [E], 2, 1) STO→ [F], 2nd MATRIX MATH *row+( 4, [F], 2, 3) STO→ [G]
1
− 52
⎡ ⎤
1 1 0 −1
𝑅 →𝑅3 10
0
2 3 1 1
−→ ⎣ 0 1 1 0 ⎥
⎢
5 5 ⎦
4 1
0 0 1 − 10 2
1
2nd MATRIX MATH *row ( 2
, [G], 3) STO→ [H] then MATH ENTER
1
⎡ ⎤
1 0 0 0 2
𝑅1 +𝑅3 →𝑅1 , 𝑅2 −𝑅3 →𝑅2 11
−→ ⎣ 0 1 0
⎢
20
− 15 ⎥
⎦
7 2 1
0 0 1 − 20 5 2
2nd MATRIX MATH *row+( 1, [H], 3, 1) STO→ [I], 2nd MATRIX MATH *row+( -1, [I], 3, 2),
MATH ENTER
where inverse of matrix 𝐴 is given on right hand side of line.
and word HELLO (8, 5, 12, 12, 15) with corresponding code matrix
⎡ ⎤
8 5
𝐶=⎢
⎣ 12 12 ⎥
⎦
15 30
message is coded as
⎡ ⎤ ⎡ ⎤
8 5 [ ]
⎥ 1 −1
𝐶𝐸 = ⎣ 12 12 ⎦ =⎣
⎢ ⎢ ⎥
0 2
⎦
15 30
46 Chapter 3. Matrix Algebra (LECTURE NOTES 3)
Enter numbers in matrices [A] and [B], [A] × [B] STO→ [C] ENTER.
Message can then be decoded as
⎡ ⎤ ⎡ ⎤
8 2 [ ]−1
⎥ 1 −1
(𝐶𝐸)𝐸 −1 = 𝐶 = ⎣ 12 12 ⎦ =⎣
⎢ ⎢ ⎥
0 2
⎦
15 45
2nd MATRIX [C] × 2nd MATRIX [B] 𝑥−1 ENTER.
which, of course, is HELLO.
(b) Decode message. Using encoding matrix
⎡ ⎤
1 0 2
𝐸=⎣ 0 2 1 ⎦
⎢ ⎥
1 1 2
decode message (38, 48, 85, 2, 15, 11, 39, 58 92), which has matrix
⎡ ⎤
38 48 85
𝐶𝐸 = ⎣ 2 15 11 ⎦
⎢ ⎥
39 58 92
or more exactly
𝑋 = 𝑇𝑋 + 𝐷
where 𝑋 is total production, 𝑇 𝑋 is internal consumption, 𝐷 is consumer de-
mand and 𝑇 is input-output matrix, a matrix of proportions of sector inputs
required to produce sector outputs. Some algebra gives
𝑋 = 𝑇𝑋 + 𝐷
𝑋 − 𝑇𝑋 = 𝐷
(𝐼 − 𝑇 )𝑋 = 𝐷
𝑋 = (𝐼 − 𝑇 )−1 𝐷
where 𝐼 is identity matrix and (𝐼 − 𝑇 )−1 exists.
Section 4. More Applications of Inverses (LECTURE NOTES 3) 47
then production is
𝑋 = (𝐼 − 𝑇 )−1 𝐷
⎛⎡ ⎤ ⎡ ⎤⎞−1 ⎡ ⎤ ⎡ ⎤
1 0 0 0.3 0.2 0.1 200
= ⎝⎣
⎜⎢
0 1 0 −
⎥ ⎢
⎦ ⎣ 0.2 0.3 0.1 ⎥
⎦⎠
⎟
⎣ 100 ⎦ = ⎣
⎢ ⎥ ⎢ ⎥
⎦
0 0 1 0.4 0.2 0.3 350
Enter data in matrices [A] and [B],
then ( 2nd MATRIX MATH identity(3) − 2nd MATRIX [A] )−1 × [B] ENTER.
or more exactly
𝑋 = 𝑃𝑋 + 𝐷
where 𝑋 is total output, 𝑃 𝑋 is internal consumption, 𝐷 is external demand
and 𝑃 is parts matrix, a matrix of number of parts required by other parts in
assembly. Some algebra gives
𝑋 = 𝑃𝑋 + 𝐷
𝑋 − 𝑃𝑋 = 𝐷
(𝐼 − 𝑃 )𝑋 = 𝐷
𝑋 = (𝐼 − 𝑃 )−1 𝐷
p1 p1
2 1
2 3 2
p3 p3 p4
1 2
p2 p2
350
200
⎡ ⎤
⎢ 100 ⎥
𝐷=⎢ ⎥
350
⎢ ⎥
⎣ ⎦
100