Professional Documents
Culture Documents
Activity 4 Application of Matrix Operations GROUP 1
Activity 4 Application of Matrix Operations GROUP 1
Activity 4 Application of Matrix Operations GROUP 1
1.1 To identify matrix as the product of a lower triangular matrix L and an upper triangular matrix U.
1.2 To factor a matrix into a product of elementary matrices.
1.3 To find and use an LU – factorization of a matrix to solve a system of linear equations.
1.4 To use matrix multiplication to encode and decode messages.
1.5 To find the least squares regression line for a set of data.
3. Discussion:
Another general approach to solve Ax = b is known as the method of LU – Factorization, which provides
new insights into matrix algebra and has many theoretical and practical uses. Efficient computer algorithms
for handling practical problems can be developed from it.
The symbols L and U denote lower triangular matrix and upper triangular matrices, respectively.
By writing AX = Lux and letting Ux = y, variable x can be solved in two stages. First, solve Ly = b for y;
then solve Ux = y for x. Each system is easy to solve because the coefficient matrices are triangular. In
particular, neither system requires any row operations. A cryptogram is a message written according to
a secret code (the Greek word kryptos means “hidden”). The following describes a method of using
matrix multiplication to encode and decode messages.
space – 0 D–4 H–8 L – 12 P – 16 T – 20 X – 24
A–1 E–5 I –9 M – 13 Q – 17 U – 21 Y – 25
B–2 F–6 J – 10 N – 14 R – 18 V – 22 Z – 26
C–3 G–7 K – 11 O – 15 S – 19 W – 23
Matrix form a linear regression model y = Ax + E the coefficient of the least square regression line is
given by the matrix equation A = (XT X) –1(XT Y)
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE
4. Procedure:
Activity 1. Determine the sequence of elementary matrices and corresponding inverse of each
elementary
1 5 3 1 0 0
matrix of 𝐴 = [3 4 2] using the identity matrix 𝐼 = [0 1 0]
2 1 5 0 0 1
Using the solution on solving lower triangular matrix of A, fill up all the elementary matrices and its
inverse by row operation on each step.
elementary matrix inverse of elementary matrix
1 5 3 1 0 0 1 0 0
[3 4 2] −3𝑅1 + 𝑅2 𝐸1 = [ -3 1 0 ] 𝐸1 [3
−1 1 1 ]
2 1 5 0 0 1 0 0 1
1 5 3 1 0 0 1 0 0
[0 −11 −7] 𝐸2 = [0 1 0 ] 𝐸2 −1 [0 1 0 ]
2 1 5 −2𝑅1 + 𝑅3 -2 0 1 2 0 1
1 5 3 1 1 0 0 1 0 0
[0 𝑅
-11 -7] - 11 2 𝐸 3 =[0 -1/11 0] 𝐸3 −1 [ -11 1 0 ]
0 −9 −1 0 0 1 0 0 1
1 5 3 1 0 0 1 0 0
[0 1 7/11] 𝐸 4 =[0 1 0] 𝐸4−1 [0 1 0 ]
0 −9 −1 9𝑅2 + 𝑅3 0 9 1 0 -9 1
1 5 3 1 0 0 1 0 0
[0 1 7/11] 11 𝐸5 =[ 0 1 0] 𝐸5−1 [ 0 1 0 ]
0 0 52/11 52 𝑅3 0 0 11/52 1 0 52/11
1 5 3
U= [ 0 1 7/11]
0 0 1
1. Find the product of “E5E4E3E2E1A” using MATLAB
1 5 3
Answer in fraction; 0 1 7/11
0 0 1
2. Is the answer in number 1 the same as the upper triangular matrix? YES, it’s the same.
3. Determine the lower triangle matrix by multiplying all inverse of
elementary matrix “ E1–1 E2–1 E3–1 E4–1 E5–1 “ using MATLAB
answer in fraction
1 0 0
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE
3 -11 0
2 -9 52/11
Is the product of lower and upper triangular matrix equal to matrix A ( LU = A ) ?
L U A
1 0 0 1 5 3 1 5 3
[3 -11 0 0 1 7/11 = 3 4 2
2 -9 52/11 0 0 1 2 1 5
Explain: A=[1 5 3;3 4 2;2 1 5] and type [L,U]=lu(A) and multiply L*U then swap by R1 ↔ R2
Solving a linear equation system Ax = b. First, we can express the coefficient matrix A in the form of the LU –
Factorization. Then we may solve the linear system by the following procedure.
Example 1
1 0 0 -1 2 1
L = [ -8 1 0] U= [ 0 16 14]
2 -1/4 1 0 0 13/2
L y = b
1 1 0 𝑦1 0
[ -8 1 0] [𝑦2] = [ 10]
2 -1/4 1 𝑦3 −11
𝑦1 = 0 𝑦2 = 10 𝑦3 = -17/2
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE
2. Solve Ux = y
U x = y
_ -1 2 1 𝑥1 0
[_ 0 16 14 ] [𝑥2] = [10]
_0 0 13/2 𝑥3 -17/2
1 1 1
𝐵 = [4 5 3] to decode the cryptograph using MATLAB
5 6 3
example on MATLAB encode: [55 63 40] * [inv(B)] = answer ( decoded row matrix )
𝖥1 1⎤ 0 ⎤
⎢1 2⎥ 0 ⎥
⎢1 3⎥ 0 ⎥
X = ⎢1 3⎥ Y= 1 ⎥
⎢1 4⎥ 1 ⎥
⎢1 4⎥ 2 ⎥
⎢1 5⎥ 2 ⎥
⎣1 6⎦ 2 ⎦
answer: y=-3/4 + ½ x
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE
Exercises
𝑥1 =51/2 𝑥2 = -9 𝑥3 = 2
1 0 2
2. Decode the following Filipino riddles and answer it, using matrix C = [2 −1 1]
0 1 2
a.) 10 24 67 29 –14 16 16 –1 29 37 –9 47 13 10 45 1 2 6
43 –10 55 13 –1 23 28 –7 35 44 –10 47 23 –10 15
b.) 23 4 43 2 24 51 26 –12 15 25 11 72 19 –7 15 23 –6 27
14 11 50 39 –18 23 15 –1 27 41 –15 37 13 7 39 49 –20 38
21 0 41 14 0 28
the message is: KUNG KAILAN MO PINATAY SAKA PA HUMABA ANG BUHAY
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE
3. A notebook manufacturing company has experience the following costs ( in P1000 ) for the
first half of the year.
𝖥 1 3⎤ 219 ⎤
⎢1 3.4⎥ 221 ⎥
⎢1 2.8⎥ 216 ⎥
X =⎢1 3.3⎥ Y= 225 ⎥
⎢1 3⎥ 218 ⎥
⎢1 3.5⎥ 223 ⎥
a.) Find the least squares regression line for the cost from January to June.
y=259/25 x + 375/2
b.) If the company produce a 3.8 notebook, predict the cost of the company.
y=226.868
c.) If the company produce a 5.35 notebook, predict the cost of the company.
y=242.926
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE
Conclusion:
We concluded that in LU factorization we can solve the variable x. Applying these
techniques to a certain matrix, we can decode the matrices into a message. The
letter's equivalent number can be obtained by multiplying the inverse by the matrix.
Using least square regression, we may predict the costs in a specific organization
based on the information given. We can easily compute and get results faster by using
MATLAB.
Proprietary Clause
Property of the Technological Institute of the Philippines (T.I.P.). No part of the materials made
and uploaded in this learning management system by T.I.P. may be copied, photographed, printed,
reproduced, shared, transmitted, translated or reduced to any electronic medium or medium-
readable form, in whole or in part, without prior consent of T.I.P.
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE