Final Report

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

1

VIETNAM GENERAL CONFEDERATION OF LABOR


TON DUC THANG UNIVERSITY
FACULTY OF INFORMATION TECHNOLOGY

NGUYEN HOANG PHUC - 523H0079

THE MIDTERM REPORT LINEAR


ALGEBRA

SOFTWARE ENGINEERING

HO CHI MINH CITY, 2023


2

DECLARATION OF AUTHORSHIP
We hereby declare that this is our own project and is guided by Mr. Nguyen
Van Khoa; The content research and results contained herein are central and have not
been published in any form before. The data in the tables for analysis, comments and
evaluation are collected by the main author from different sources, which are clearly
stated in the reference section.

In addition, the project also uses some comments, assessments as well as


data of other authors, other organizations with citations and annotated sources.

If something wrong happens, We’ll take full responsibility for the content
of my project. Ton Duc Thang University is not related to the infringing rights, the
copyrights that We give during the implementation process (if any).

Ho Chi Minh city, 3rd September 2023


Phuc
Nguyen Hoang Phuc
3

THE MIDTERM REPORT LINEAR ALGEBRA

ABSTRACT

Through the report book, we can answer how to calculate the matrix, how to
transpose the matrix, creating vector, how to find the determinant of the matrix and
so on.

This report has 8 questions:

1.(1.0 point). Calculate A + AT + CB + BTCT, and print the results to the screen.

𝐴 𝐴 2 𝐴 3 𝐴 4 𝐴 5 𝐴 6 𝐴 7
2.(1.0 point). Calculate + ( ) + ( ) + ( ) + ( ) + ( ) + ( ) +
10 11 12 13 14 15 16

𝐴 8 𝐴 9 𝐴 10
( ) + ( ) + ( ) , and print the results to the screen.
17 18 19

3.(1.0 point). Save odd rows of the matrix A into a new matrix, and print the resultant
matrix to the screen.
4.(1.0 point). Save odd integer numbers in the matrix A into a new vector, and print
the resultant vector to the screen.
5.(1.0 point). Save prime numbers in the matrix A into a new vector, and print the
resultant vector to the screen.
6.(1.0 point). Given a matrix 𝐷 = 𝐶𝐵, reverse elements in the odd rows of the matrix
D, and print the resultant matrix to the screen.
7.(1.0 point). Regarding the matrix A, find the rows which have maximum count of
prime numbers, and print the rows to the screen.
8.(1.0 point). Regarding the matrix A, find the rows which have the longest
contiguous odd numbers sequence, and print the rows to the screen.
4

TABLE OF CONTENT
Chapter 1: Introduction…………………………………………………………………………5

Chapter 2: Matrix and Matrix Calculation………………………………………………6

Chapter 3: Administer…………………………………………………………………………….7

3.1 Calculate A + AT + CB + BTCT, and print the results to the screen…..8

𝐴 𝐴 2 𝐴 3 𝐴 4 𝐴 5 𝐴 6 𝐴 7 𝐴 8
3.2 Calculate + ( ) + ( ) + ( ) + ( ) + ( ) + ( ) + ( ) +
10 11 12 13 14 15 16 17

𝐴 9 𝐴 10
( ) + ( ) , and print the results to the screen…………………………………9
18 19

3.3 Save odd rows of the matrix A into a new matrix, and print the resultant matrix
to the screen………………………………………………………………………10
3.4 Save odd integer numbers in the matrix A into a new vector, and print the resultant
vector to the screen……………………………………………………………….11
3.5 Save prime numbers in the matrix A into a new vector, and print the resultant
vector to the screen………………………………………………………………...12
3.6 Given a matrix 𝐷 = 𝐶𝐵, reverse elements in the odd rows of the matrix D, and
print the resultant matrix to the screen……………………………………………13
3.7 Regarding the matrix A, find the rows which have maximum count of prime
numbers, and print the rows to the screen…………………………………………14

3.8 Regarding the matrix A, find the rows which have the longest contiguous odd
numbers sequence, and print the rows to the screen……………………………….15

Chapter 4: Conclusion……………………………………………………………17

Chapter 5: Refrences……………………………………………………………..18
5

1. CHAPTER 1: INTRODUCTION
This report introduce about matrix, how to calculate them. Moreover, this report shows
them how to calculate the determinant. How to using the basic changes to change the
matrix to the new matrix without change the the nature of this old matrix.
6

2. CHAPTER 2: MATRIX AND MATRIX CALCULATION


We have matrix A,we have some basic matrix calculation:

Add matrices.

Minus matrices.

Multiply matrices.

In addition, we have high level matrix calculations. Determinant A is the value of


the matrix A. It use for solving linear systems. If 𝑑𝑒𝑡𝐴= 0, this linear system has
more-inf solutions or non solutions.

Transpose matrix. The matrix has i rows and j columns. When we transpose it, this
matrix has j rows and i columns.

45 46
For example, let A = ( ), AT = ( )
67 57
7

CHAPTER 3: ADMINISTER
3.1 QUESTION 1 Calculate A + AT + CB + BTCT, and print the results to the screen.

39 60 5 82 86 89 12 13 56 48
22 2 23 62 76 74 41 56 68 99
32 72 89 20 63 64 31 78 28 20
43 93 93 76 88 63 34 69 40 67
52 41 78 55 97 81 25 100 58 17
Let A =
86 81 54 31 67 33 57 22 69 92
56 99 47 13 64 77 8 52 73 34
46 60 46 92 24 58 52 80 51 44
62 41 7 8 34 21 61 64 71 12
( 7 8 92 88 15 49 65 75 91 97 )
4 19 13 13 1 16 5 13 19 15
B=( )
9 9 7 7 18 20 11 7 5 7
37
12 2
12
10 4
4 16
C=
1 14
20 14
15 10
20 11
( 6 18 )
8

39 60 5 82 86 89 12 13 56 48
22 2 23 62 76 74 41 56 68 99
32 72 89 20 63 64 31 78 28 20
43 93 93 76 88 63 34 69 40 67
52 41 78 55 97 81 25 100 58 17
We have A + AT + CB + BTCT = +
86 81 54 31 67 33 57 22 69 92
56 99 47 13 64 77 8 52 73 34
46 60 46 92 24 58 52 80 51 44
62 41 7 8 34 21 61 64 71 12
( 7 8 92 88 15 49 65 75 91 97 )
39 60 5 82 86 89 12 13 56 48 37
22 2 23 62 76 74 41 56 68 99 12 2
32 72 89 20 63 64 31 78 28 20 12
43 93 93 76 88 63 34 69 40 67 10 4
52 41 78 55 97 81 25 100 58 17 T + 4 16 4 19 13 13 1 16 5 13 19 15
( )+
86 81 54 31 67 33 57 22 69 92 1 14 9 9 7 7 18 20 11 7 5 7
56 99 47 13 64 77 8 52 73 34 20 14
46 60 46 92 24 58 52 80 51 44 15 10
62 41 7 8 34 21 61 64 71 12 20 11
( 7 8 92 88 15 49 65 75 91 97 ) ( 6 18 )
37
12 2
12
10 4
4 19 13 13 1 16 5 13 19 15 T 4 16 T =
( )
9 9 7 7 18 20 11 7 5 7 1 14
20 14
15 10
20 11
( 6 18 )
228 268 147 289 427 493 366 297 389 335
268 496 302 551 385 532 728 661 826 577
147 302 232 298 342 285 463 416 401 345
289 551 298 468 389 445 499 584 595 537
427 385 342 389 778 785 557 483 466 534
493 532 285 445 785 658 893 631 719 710
366 728 463 499 557 893 524 651 805 725
297 661 416 584 483 631 651 690 787 618
389 826 401 595 466 719 805 787 1012 684
( 335 577 345 537 534 710 725 618 684 626 )
9

3.1.1 The coding image for question 1.


𝑨 𝑨 𝟐 𝑨 𝟑 𝑨 𝟒 𝑨 𝟓 𝑨 𝟔 𝑨 𝟕 𝑨 𝟖
3.2 Calculate + ( ) + ( ) + ( ) + ( ) + ( ) + ( ) + ( ) +
𝟏𝟎 𝟏𝟏 𝟏𝟐 𝟏𝟑 𝟏𝟒 𝟏𝟓 𝟏𝟔 𝟏𝟕

𝑨 𝟗 𝑨 𝟏𝟎
( ) + ( ) , and print the results to the screen.
𝟏𝟖 𝟏𝟗

4614
8978
Let A = ( )
4697
1567
10

𝑨 𝑨 𝟐 𝑨 𝟑 𝑨 𝟒 𝑨 𝟓 𝑨 𝟔 𝑨 𝟕 𝑨 𝟖
We have + ( ) + ( ) + ( ) + ( ) + ( ) + ( ) + ( ) +
𝟏𝟎 𝟏𝟏 𝟏𝟐 𝟏𝟑 𝟏𝟒 𝟏𝟓 𝟏𝟔 𝟏𝟕
𝟐 𝟑 𝟒
4614 4614 4614 4614
(8 9 7 8) (8 9 7 8) (8 9 7 8) (8 9 7 8)
4697 4697 4697 4697
𝑨 𝟗 𝑨 𝟏𝟎 1567 1567 1567 1567
( ) + ( ) = + + + +
𝟏𝟖 𝟏𝟗 𝟏𝟎 𝟏𝟏 𝟏𝟐 𝟏𝟑

( ) ( ) ( )
𝟓 𝟔 𝟕 𝟖 𝟗
4614 4614 4614 4614 4614
(8 9 7 8 ) (8 9 7 8 ) (8 9 7 8 ) (8 9 7 8 ) (8 9 7 8 )
4697 4697 4697 4697 4697
1567 1567 1567 1567 1567
+ + + + +
𝟏𝟒 𝟏𝟓 𝟏𝟔 𝟏𝟕 𝟏𝟖

( ) ( ) ( ) ( ) ( )
𝟏𝟎
4614
(8 9 7 8 )
4697
1567
𝟏𝟗

( )
3.45 ∗ 1011 5.3 ∗ 1011 5.0 ∗ 1011 5.4 ∗ 1011
11 11 12 12
= ( 7.2 ∗ 1011 1.1 ∗ 1011 1.0 ∗ 1011 1.2 ∗ 1011 )
6.1 ∗ 10 9.4 ∗ 10 8.8 ∗ 10 9.6 ∗ 10
4.5 ∗ 1011 7.0 ∗ 1011 6.6 ∗ 1011 7.2 ∗ 1011

3.2.1 Code and the resultant of question 2


3.3 Save odd rows of the matrix A into a new matrix, and print the resultant matrix
to the screen.
11

39 60 5 82 86 89 12 13 56 48
22 2 23 62 76 74 41 56 68 99
32 72 89 20 63 64 31 78 28 20
43 93 93 76 88 63 34 69 40 67
52 41 78 55 97 81 25 100 58 17
Let A =
86 81 54 31 67 33 57 22 69 92
56 99 47 13 64 77 8 52 73 34
46 60 46 92 24 58 52 80 51 44
62 41 7 8 34 21 61 64 71 12
( 7 8 92 88 15 49 65 75 91 97 )
We have row 1, 3, 5, 7, 9 is the odd row, so the new matrix is
39 60 5 82 86 89 12 13 56 48
32 72 89 20 63 64 31 78 28 20
B = 52 41 78 55 97 81 25 100 58 17
56 99 47 13 64 77 8 52 73 34
( 62 41 7 8 34 21 61 64 71 12 )

3.3.1 The coding and the resultant of question 3


3.4 Save odd integer numbers in the matrix A into a new vector, and print the
resultant vector to the screen.
39 60 5 82 86 89 12 13 56 48
22 2 23 62 76 74 41 56 68 99
32 72 89 20 63 64 31 78 28 20
43 93 93 76 88 63 34 69 40 67
52 41 78 55 97 81 25 100 58 17
Let A =
86 81 54 31 67 33 57 22 69 92
56 99 47 13 64 77 8 52 73 34
46 60 46 92 24 58 52 80 51 44
62 41 7 8 34 21 61 64 71 12
( 7 8 92 88 15 49 65 75 91 97 )
We have C =
12

39 5 89 13 23 41 99 89 63 31 43 93 93 63 69 67 41 55 81 25 17
( )
81 31 67 33 57 69 99 47 13 77 73 51 41 7 21 61 71 7 15 65 75 91 97

3.4.1 The coding and the resultant of question 4


3.5. Save prime numbers in the matrix A into a new vector, and print the
resultant vector to the screen.
39 60 5 82 86 89 12 13 56 48
22 2 23 62 76 74 41 56 68 99
32 72 89 20 63 64 31 78 28 20
43 93 93 76 88 63 34 69 40 67
52 41 78 55 97 81 25 100 58 17
Let A =
86 81 54 31 67 33 57 22 69 92
56 99 47 13 64 77 8 52 73 34
46 60 46 92 24 58 52 80 51 44
62 41 7 8 34 21 61 64 71 12
( 7 8 92 88 15 49 65 75 91 97 )
We have a vector of prime number is
D = (5 89 13 2 89 31 43 67 41 97 17 31 67 47 13 73 41 7 61 71 7 97)

3.5.1 The coding and the resultant of question 5


13

3.6 Given a matrix 𝑫 = 𝑪𝑩, reverse elements in the odd rows of the matrix D,
and print the resultant matrix to the screen.
37
12 2
12
10 4
4 16
C=
1 14
20 14
15 10
20 11
( 6 18 )
4 19 13 13 1 16 5 13 19 15
B =( )
9 9 7 7 18 20 11 7 5 7
75 120 88 88 129 188 92 88 92 94
66 246 170 170 48 232 82 170 238 194
22 37 27 27 37 56 27 27 29 29
76 226 158 158 82 240 94 158 210 178
160 220 164 164 292 384 196 164 156 172
D = CB =
130 145 111 111 253 296 159 111 89 113
206 506 358 358 272 600 254 358 450 398
150 375 265 265 195 440 185 265 335 295
179 479 337 337 218 540 221 337 435 377
(186 276 204 204 330 456 228 204 204 216)
We have row (75 120 88 88 129 188 92 88 92 94),
(22 37 27 27 37 56 27 27 29 29),
(160 220 164 164 292 384 196 164 156 172),
(206 506 358 358 272 600 254 358 450 398),
(179 479 337 337 218 540 221 337 435 377 is the odd rows.
So, the matrix which rows are reversed is
14

94 92 88 92 288 129 88 88 120 75


66 246 170 170 48 232 82 170 238 194
29 29 27 27 56 37 27 27 37 22
76 226 158 158 82 240 94 158 210 178
172 156 164 196 384 292 164 164 220 160
130 145 111 111 253 296 159 111 89 113
398 450 358 254 600 272 358 358 506 206
150 375 265 265 195 440 185 265 335 295
377 435 337 221 540 218 337 337 479 179
(186 276 204 204 330 456 228 204 204 216)
3.7 Regarding the matrix A, find the rows which have maximum count of prime
numbers, and print the rows to the screen.
39 60 5 82 86 89 12 13 56 48
22 2 23 62 76 74 41 56 68 99
32 72 89 20 63 64 31 78 28 20
43 93 93 76 88 63 34 69 40 67
52 41 78 55 97 81 25 100 58 17
Let A =
86 81 54 31 67 33 57 22 69 92
56 99 47 13 64 77 8 52 73 34
46 60 46 92 24 58 52 80 51 44
62 41 7 8 34 21 61 64 71 12
( 7 8 92 88 15 49 65 75 91 97 )
Row 1 has 3 prime numbers
Row 2 has 1 prime numbers
Row 3 has 2 prime numbers
Row 4 has 2 prime numbers
Row 5 has 3 prime numbers
Row 6 has 2 prime numbers
Row 7 has 3 prime numbers
Row 8 has 0 prime numbers
Row 9 has 4 prime numbers
Row 10 has 2 prime numbers

 Row 9 has the largest number of prime numbers


So, the resultant is (62 41 7 8 34 21 61 64 71 12)
15

3.7.1 The coding of question 7

3.7.2 The resultant of question 7


3.8 Regarding the matrix A, find the rows which have the longest contiguous odd
numbers sequence, and print the rows to the screen.
39 60 5 82 86 89 12 13 56 48
22 2 23 62 76 74 41 56 68 99
32 72 89 20 63 64 31 78 28 20
43 93 93 76 88 63 34 69 40 67
52 41 78 55 97 81 25 100 58 17
Let A =
86 81 54 31 67 33 57 22 69 92
56 99 47 13 64 77 8 52 73 34
46 60 46 92 24 58 52 80 51 44
62 41 7 8 34 21 61 64 71 12
( 7 8 92 88 15 49 65 75 91 97 )
We have:
Row 1 has 1 contiguous odd numbers sequence
Row 2 has 1 contiguous odd numbers sequence
Row 3 has 1 contiguous odd numbers sequence
Row 4 has 3 contiguous odd numbers sequence
Row 5 has 4 contiguous odd numbers sequence
Row 6 has 4 contiguous odd numbers sequence
Row 7 has 3 contiguous odd numbers sequence
16

Row 8 has 1 contiguous odd numbers sequence


Row 9 has 2 contiguous odd numbers sequence
Row 10 has 6 contiguous odd numbers sequence
So, Row 10 has longest contiguous odd numbers sequences
So, the result is (7 8 92 88 15 49 65 75 91 97)

3.7.1. The coding of question 8

3.7.2 The resultant of question 8


17

CHAPTER 4: CONCLUSION
From this report, we understand about:
_How to know the matrix.
_How to calculate the matrix.
_How to transpose a matrix.
_How to multiply the matrix
_How to calculate matrixn
18

CHAPTER 5: REFERENCES

Akarsh Shrivas, Aniket Pawar, Pratham Mishra, Satish Chadokar. (2023). E-commerce
Website using MERN Stack- IJIRMPS Volume 11, Issue 3. IJRASET.

Shubham, K. (2021, January 23). Build an E-Commerce website with MERN Stack .
Retrieved from dev.to: https://dev.to/shubham1710/build-an-e-commerce-website-
with-mern-stack-part-1-setting-up-the-project-1l2d

You might also like