Activity 4 Application of Matrix Operations Group 5 PDF

Title Activity 4 Application of Matrix Operations Group 5
Author Mk Adonais
Course Linear Algebra With Matlab
Institution Technological Institute of the Philippines
Pages 12
File Size 794 KB
File Type PDF
Total Downloads 8
Total Views 191

Summary

MATLAB ACTIVITY 2 – Matrix in MATLAB
A. Write the syntax that will create the following matrices....


Description

Technological Institute of the Philippines - Manila Math & Physics Department

Course: MATH 022A ONLINE LECTURE

Laboratory Activity No. 3

Name: GROUP 5 Date Performed: 1. Objective(s):

NOVEMBER 2, 2021

Laboratory Activity No. 4 Application of Matrix Operations Section: CE21S3 Date Submitted:

NOVEMBER 4, 2021

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. 2. Intended Learning Outcomes (ILOs): The students shall be able to: 2.1 Demonstrate scientific thinking and the ability to approach scientific resources intelligently. 2.2 Utilize MATLAB software in solving linear algebra problems related to their fields of specialization. 2.3 Infer appropriate conclusions based upon the results of the activity. 2.4 Reflect on personal transformation along the T.I.P. graduate attributes, specifically, professional competence and critical thinking skills. 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 = (XTX) –1(XTY)

Technological Institute of the Philippines - Manila Math & Physics Department

Course: MATH 022A ONLINE LECTURE

4. Procedure: Activity 1. Determine the sequence of elementary matrices and corresponding inverse of each elementary

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

=

=

1 -3 0

0 1 0

0 0 1

E1-1

1 3 0

0 1 0

0 0 1

1 0 -2

0 1 0

0 0 1

E2-1

1 0 2

0 1 0

0 0 1

E3-1

1 0 0

0 - 11 0

E4-1

1 0 0

0 1 -9

E5-1

1 0 0

0 0 1 1 0 11/52

1 0 0

=

0 0 - 1/11 0 0 1

=

1 0 0

0 1 9

=

1 0 0

0 0 1 1 0 11/52

1. Find the product of “E5E4E3E2E1A” using MATLAB Answer in fraction:

1 0 0

5 1 0

inverse of elementary matrix

3 7/11 1

0 1 1

0 0 1

0 1 1

Technological Institute of the Philippines - Manila Math & Physics Department

Course: MATH 022A ONLINE LECTURE

2. Is the answer in number 1 the same as the upper triangular matrix? Yes, as we input in the MatLab the given "E5E4E3E2E1A", the answers shown were the same as the uper triangular matrix. MatLab presented us the answer of 1591/2500 with its lowest form of 7/11. 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 3 -11 0 2 -9 52/11 4. Is the product of lower and upper triangular matrix equal to matrix A (LU = A) ? L 1 0 0 3 -11 0 2 -9 52/11

1 0 0

5 1 0

U 3 7/11 1

A 1 3 2

5 4 1

3 2 5

Explain: An LU decomposition of a matrix A is the product of a lower triangular matrix and an upper triangular matrix that is equal to A.

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 Solve the system, on MATLAB [ LU ] = lu(A) Coefficient matrix A=

L=

1 0 -8 1 2 -1/4

0 0 1

-1 0 0

U=

1. Solve the system Ly = b L 1 0 0 -8 1 0 2 -1/4 1

Y1 Y2 Y3

Back substitution now yields: Y1= 0

Y2= 10

Y3= -17/2

=

yb

=

0 10 -11

-1 8 -2 2 16 0

2 0 0 1 14 13/2

1 6 5

Technological Institute of the Philippines - Manila Math & Physics Department

Course: MATH 022A ONLINE LECTURE

2. Solve Ux = y -1 0 0

U 2 16 0

x 1 14 13/2

X1 X2 X3

= y

=

0 10 -17/2 71

Back substitution now yields: X1= 29/13 X2= 23/13 X3= -17/13 Activity 2. Use the inverse of matrix B

to decode the cryptograph using MATLAB example on MATLAB encode: [55 63 40] * [inv(B)] = answer ( decoded row matrix ) 55 41 96 42 63 14

63 40 204 245 143 174 207 120 47 55 38 19 20 17 42 49 35 60 70 86 101 57 81 96 52 91 112 63 13 16 9 127 148 86 57 71 42 82 55 106 132 79 109 128 71 81 97 49 84 102 55 50 62 37 90 110 69 49 35 90 105 61 71 84 46 34 42 25 57 71 43 92 113 64 104 125 100 121 72 106 129 69 92 113 64 49 61 36 103 123 72 82 102 61 14 14

the message is : PAG TUTULUNGAN ANG KAILANGAN NG BAWAT MAMAMAYAN SA PAGKAKAISA NG PANGALAGAAN ANG ATING INANG KALIKASAN.

Activity 3.Find the least squares regression line for the points( 1, 0 ), ( 2, 0 ), ( 3, 0 ), ( 3, 1 ), ( 4, 1 ), ( 4, 2 ), ( 5, 2 ), and ( 6, 2 ) using MATLAB

X=

1 1 1 1 1 1 1 1

1 2 3 3 4 4 5 6

Y=

0 0 0 1 1 2 2 2

then, type on command window: rats[( inv( X’ * X ) ) * ( X’ * Y )] answer:

b= -3/4 m=1/2

y= mx+b y= 1/2x – 3/4

Technological Institute of the Philippines - Manila Math & Physics Department

Course: MATH 022A ONLINE LECTURE

Exercises 1. Solve the system of linear equation using LU – Factorization of the matrix Coefficient Matrix 2 6 2 1 3 1

L=

0 1 2

0 0 1

X1= 51/2

U=

X2= -9

2 0 0

6 1 0

6 4 19 12 8 14

4 0 10

X3= 2

2. Decode the following Filipino riddles and answer it, using matrix a.)10 24 67 29 –14 16 16 –1 29 37 –9 47 13 13 –1 23 28 –7 35 44 –10 47 23 –10 15

10 45

1

2 6

43

–10

the message is: NANDITO NA SI KAKA BUKAKA NG BUKAKA. Answer: GUNTING

b.) 23 4 43 2 24 51 26 –12 15 14 11 50 39 –18 23 15 –1 27 21 0 41 14 0 28

25 11 72 19 –7 15 23 –6 27 41 –15 37 13 7 39 49 –20 38

the message is: AKO AY MAY KAIBIGAN KASAMA KO KAHIT SAAN. Answer: ANINO

c.) 53 –7 41 –19 1 1 4

71 7 11 36 19 3 35 29 –14 16 43 –15 41 34 5 69 24 25 19 88 23 –10 15 32 –15 18 16 13 50 15 1 31 28 –7 35 44 –13 41 51 –25 27

the message is: KUNG KAILAN MO PINATAY SAKA PA HUMABA ANG BUHAY. Answer: KANDILA

55

Technological Institute of the Philippines - Manila Math & Physics Department

Course: MATH 022A ONLINE LECTURE

3. A notebook manufacturing company has experience the following costs ( in P1000 ) for the first half of the year.

Month

January

February

March

3

3.4

219

221

Notebook (X) Costs (Y)

X=

1 1 1 1 1 1

3 3.4 2.8 3.3 3 3.5

Y=

April

May

June

2.8

3.3

3

3.5

216

225

218

223

219 221 216 225 218 223

a.) Find the least squares regression line for the cost from January to June. b= 187. 5357 m= 10. 3571

y= mxtb y= 10.3571x + 187. 5357

b.) If the company produce a 3.8 notebook, predict the cost of the company. y= mxtb y= 10.3571x + 187. 5357 y= 10.3571(3.8) + 187.5357 y= 226. 8927

c.) If the company produce a 5.35 notebook, predict the cost of the company. y= mxtb y= 10.3571x + 187. 5357 y= 10.3571(5.35) + 187.5357 y= 242. 9462

Technological Institute of the Philippines - Manila Math & Physics Department

Course: MATH 022A ONLINE LECTURE

Conclusion Recapitulating our standpoint, MatLab helps a lot in our matrix activities and also in our usual life. As engineering students, we are more focused on solving different mathematical problems related to our fields of specialization. Matlab can be correlated to a calculator, inasmuch as you just have to be familiarized with the command of the MatLab, input the specific given and the command of the problem for it to produce an instant and accurate answer. Using Matlab in LU Factorization involves identifying the matrix as the product of the upper (U) and lower (L) triangular for us to solve linear equation problems. On the other hand, MatLab can also solve and find solutions to the cryptogram in which we can use for security purposes. This makes us to a conclusion that MatLab extraordinarily is essential for us and will make a great impact on our study.

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 mediumreadable form, in whole or in part, without prior consent of T.I.P.

Activity 1

Activity 2

Activity 3

Activity 4...


Similar Free PDFs