Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6 Triangular Matrices Explore what happens if we add, subtract or multiply trian

ID: 2086707 • Letter: 6

Question

6 Triangular Matrices Explore what happens if we add, subtract or multiply triangular matrices? Do we get a Triangular matrix or something else? Create a 5 by 5 matrix by typing: U-round 10rand(5)). Similarly create 5 by 5 matrices B and C by typing V- round 10rand(5)) W round10 rand (5)) Type: L-tril(U) to create a lower triangular matrix from U Type: K-tril(V) to create another lower triangular matrix from V Type: J = triu(V) to create an upper triangular matrix from V Now find the following: L-K 3L +5K (Note: you need to type 3L+5 K) . LK KL Answer the following questions: a.) Explain: What type of matrix are you getting? Is it lower triangular, upper triangular, or other type that you know? b.) Is it possible that "the sum of two lower triangular matrices be non-lower triangular matrix"? Explain. c.) What do you think about "the product of scalar( number) with a lower triangular matrices should it be a lower triangular matrix" Why? Explain. d.) What do you think about dividing a lower triangular matrix by a lower triangular matrix will the result be a lower triangular matrix? Explain. e.) Generalize your findings and extend them to sum, difference, product, and scalar product of upper triangula matrices.For example: 1. Sum of two upper triangula matrices i.. 2. Product of two upper triangula matrices is Please help me with these question they are based on matlab

Explanation / Answer

MATLAB CODE:

ALSO CREATING AN UPPERTRIANGULAR MATRIX H=triu(W) FOR EXPLANATIONS.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

U=round(10*rand(5))
V=round(10*rand(5))
W=round(10*rand(5))
L=tril(U)
K=tril(V)
J=triu(V)
H=triu(W)
disp('L-K=')
L-K
disp('3*L+5*K=')
3*L+5*K
disp('L.*K=')
L.*K
disp('K.*L=')
K.*L
disp('K^3=')
K.^3
disp('J+K=')
J+K
disp('5J=')
5*J
disp('J^2=')
J.^2
%%%%FOR SULUTION TO b to e
disp('L+K=')
L+K %%%solution to b
disp('5*L=')
5*L %%%solution to c
disp('L/K=')
L./K %%%solution to d
disp('J+H=')
J+H %%%solution to e's
disp('J-H=')
J-H
disp('J*H=')
J*H
disp('5*J=')
5*J

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

RESULT:

>> Untitled2

U =

4 1 2 7 7
7 4 8 5 6
9 6 0 2 1
8 5 9 6 1
7 1 1 1 2


V =

0 9 1 9 5
4 1 6 10 6
8 9 0 5 8
6 1 8 3 1
5 5 8 1 7


W =

5 9 6 9 4
2 7 7 4 8
9 5 4 1 4
6 8 2 4 4
4 5 6 3 4


L =

4 0 0 0 0
7 4 0 0 0
9 6 0 0 0
8 5 9 6 0
7 1 1 1 2


K =

0 0 0 0 0
4 1 0 0 0
8 9 0 0 0
6 1 8 3 0
5 5 8 1 7


J =

0 9 1 9 5
0 1 6 10 6
0 0 0 5 8
0 0 0 3 1
0 0 0 0 7


H =

5 9 6 9 4
0 7 7 4 8
0 0 4 1 4
0 0 0 4 4
0 0 0 0 4

L-K=

ans =

4 0 0 0 0
3 3 0 0 0
1 -3 0 0 0
2 4 1 3 0
2 -4 -7 0 -5

3*L+5*K=

ans =

12 0 0 0 0
41 17 0 0 0
67 63 0 0 0
54 20 67 33 0
46 28 43 8 41

L.*K=

ans =

0 0 0 0 0
28 4 0 0 0
72 54 0 0 0
48 5 72 18 0
35 5 8 1 14

K.*L=

ans =

0 0 0 0 0
28 4 0 0 0
72 54 0 0 0
48 5 72 18 0
35 5 8 1 14

K^3=

ans =

0 0 0 0 0
64 1 0 0 0
512 729 0 0 0
216 1 512 27 0
125 125 512 1 343

J+K=

ans =

0 9 1 9 5
4 2 6 10 6
8 9 0 5 8
6 1 8 6 1
5 5 8 1 14

5J=

ans =

0 45 5 45 25
0 5 30 50 30
0 0 0 25 40
0 0 0 15 5
0 0 0 0 35

J^2=

ans =

0 81 1 81 25
0 1 36 100 36
0 0 0 25 64
0 0 0 9 1
0 0 0 0 49

L+K=

ans =

4 0 0 0 0
11 5 0 0 0
17 15 0 0 0
14 6 17 9 0
12 6 9 2 9

5*L=

ans =

20 0 0 0 0
35 20 0 0 0
45 30 0 0 0
40 25 45 30 0
35 5 5 5 10

L/K=

ans =

Inf NaN NaN NaN NaN
1.7500 4.0000 NaN NaN NaN
1.1250 0.6667 NaN NaN NaN
1.3333 5.0000 1.1250 2.0000 NaN
1.4000 0.2000 0.1250 1.0000 0.2857

J+H=

ans =

5 18 7 18 9
0 8 13 14 14
0 0 4 6 12
0 0 0 7 5
0 0 0 0 11

J-H=

ans =

-5 0 -5 0 1
0 -6 -1 6 -2
0 0 -4 4 4
0 0 0 -1 -3
0 0 0 0 3

J*H=

ans =

0 63 67 73 132
0 7 31 50 96
0 0 0 20 52
0 0 0 12 16
0 0 0 0 28

5*J=

ans =

0 45 5 45 25
0 5 30 50 30
0 0 0 25 40
0 0 0 15 5
0 0 0 0 35

>>

SOLUTIONS:

a)We see that L-K,3L+5K,LK,KL,K^3 are lower triangular matrices and 5J,J^2 are upper triangular matrices.

b)We see that L+K is also a lower triangular matrix so sum of two lower triangular matrix is a lower triangular matrix always.

c)We see that 5*L is also a lower triangular matrix(LTM) so product of a scalar with LTM is also a LTM.

d)We see that some elements of L/K are not defined(NaN) so this operation of divison of LTM with LTM is not defined.

e)1.since J+H is UTM therefore sum of two UTM is an UTM.

2.since J-H is UTM therefore difference of two UTM is an UTM.

3.since J*H is an UTM therefore product of two UTM is an UTM

4.since 5*J is an UTM therefore scalar product of two UTM is an UTM.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote