0% found this document useful (0 votes)
82 views3 pages

Lab 3 Applied Linear Algebra For It - 501032: 1 Exercises

This document contains instructions for exercises in applied linear algebra. It includes commands to create matrices from vectors, flip matrices horizontally and vertically, extract submatrices and vectors from larger matrices, perform matrix operations such as addition and multiplication, compute powers of transition matrices, and calculate matrix determinants. The exercises also involve applying linear algebra concepts to problems involving ice cream sales data.

Uploaded by

Anh Quoc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views3 pages

Lab 3 Applied Linear Algebra For It - 501032: 1 Exercises

This document contains instructions for exercises in applied linear algebra. It includes commands to create matrices from vectors, flip matrices horizontally and vertically, extract submatrices and vectors from larger matrices, perform matrix operations such as addition and multiplication, compute powers of transition matrices, and calculate matrix determinants. The exercises also involve applying linear algebra concepts to problems involving ice cream sales data.

Uploaded by

Anh Quoc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Ton Duc Thang University

Faculty of Information Technology

Lab 3
APPLIED LINEAR ALGEBRA FOR IT - 501032

1 Exercises
Exercise 1: Using a command
 to create the new matrices
 from vectors
x= 1 2 3 4 5 , b= 1 2 3 4 5 6 , c=1:1:30 and d=1:1:25.
   
1 1 1 1 1 1 6 11 16 21 26
 2 2 2 2 2   2 7 12 17 22 27 
   
 3
(a) A =  3 3 3 3  (c) C =  3 8 13 18 23 28 
 
 4 4 4 4 4   4 9 14 19 24 29 
5 5 5 5 5 5 10 15 20 25 30
 
1 2 3 4 5 6  
 1 2 3 4 5 6  1 2 3 4 5
 
 1 2 3 4 5 6   6 7 8 9 10 
(b) B = 
 1
  
 2 3 4 5 6   (d) D =  11 12 13 14 15 

 1 2 3 4 5 6   16 17 18 19 20 
1 2 3 4 5 6 21 22 23 24 25

Exercise 2: Write a command that will create a 5×6 matrix with random integer entries with the elements
∈ [a, b], where a, b ∈ Z
   
1 2 3 3 2 1
Exercise 3: Write a command to flip the matrix A =  4 5 6  horizontally as follows B =  6 5 4 
7 8 9 9 8 7
   
1 2 3 7 8 9
Exercise 4: Write a command to flip the matrix A =  4 5 6  vertically as follows B =  4 5 6 
7 8 9 1 2 3
 
1 2 16 31 22
 2 8 12 21 23 
Exercise 5: Enter the matrix Y =   4 9 11 14 25 , provide a command to create vectors or

3 6 10 16 34
matrices as follows:
 
8 12 21

(a) x = 8 12 21 (c) A =
9 11 14
   
16 1 16 22
 12   2 12 23 
(b) y =  11 
 (d) B = 
 4 11 25 

10 3 10 34

Anh H. Vo - [email protected] 1
Ton Duc Thang University
Faculty of Information Technology

 
2 12 21 23 (f) Create a D matrix from Y whose elements is
(e) C =  4 11 14 25  greater than 12
3 10 16 34
 
2 4 1
Exercise 6: Given the matrix A =  6 7 2 , provide commands to do the following:
3 5 9

(a) Assign the first row of A into a vector called x1


(b) Assign the last 2 rows of A into the matrix called Y
 
2 7 9 7
Exercise 7: Let A =  3 1 5 6 . Write command that will
8 1 2 5
(a) Assign the even numbered columns of A into a new vector called B
(b) Assign the odd numbered rows into a new vector called C
(c) Convert A to a 4 × 3 matrix
Exercise 8: A local shop sells three types of ice cream flavours: strawberry, vanilla and chocolate. Straw-
berry costs 2$, vanilla 1$ and chocolate 3$ each. The sales of each ice cream are as show in the following
table.
Monday Tuesday Wednesday Thursday Friday
Strawberry (S) 12 15 10 16 12
Vanilla (V) 5 9 14 7 10
Chocolate (C) 8 12 10 9 15

How to evaluate the total sales for each day.


Exercise 9: Let T be a (transition) matrix of a Markov chain and p be a probability vector. Then the
probability that the chain is in a particular state after k steps is given by the vector pk :
pk = T k p
Determine pk by any appropriate program for
   
0.6 0.7 0.5
T = , p= , and k = 1, 2, 10, 100, 100000.
0.4 0.3 0.5
   
  5 8   −6 3 1
−1 4 8 −4 1
Exercise 10: Let A = B =  0 −6  C = D =  8 9 −2 .
−9 1 2 6 5
5 6 6 −1 5
Computing the following, if possible

(a) (AB T ) (e) ((DT )T ) (i) ((2AT − 5B)T ) (m) ((C T )2 )


(b) (BC T ) (f) (2C T ) (j) ((−D)T )
(c) (C − C T ) (g) (AT + B) (k) (−(D)T )
(d) (D − DT ) (h) ((AT + B)T ) (l) ((C 2 )T )
 
2 4 1
Exercise 11: Let A =  6 7 2 
3 5 9

Anh H. Vo - [email protected] 2
Ton Duc Thang University
Faculty of Information Technology

(a) Is A matrix square or not? (d) Find Upper triangular matrix of A.


(b) Is A matrix symmetric or not?
(c) Is A matrix skew-symmetric or not? (e) Find Lower triangular matrix of A.

Exercise 12: Write a command to compute the determinant of the matrices below:
     
6 0 0 5 1 −2 5 2 3 5 −8 4
 1 7 2 −5   0 0 3 0   0 −2 3 −7 
A= , B =  , C =  ,
 2 0 0 0   2 −6 −7 5   0 0 1 5 
8 3 1 8 5 0 4 4 0 0 0 2
     
4 0 0 0 4 0 −7 3 −5 6 3 2 4 0
 7 −1 0 0   0 0 2 0 0   9 0 −4 1 0 
     
 2
D= 6 3 , E =  7
0   3 −6 4 −8  , F = 
 8 −5 6 7 1 

 5 −8 3 0   5 0 5 2 −3   3 0 0 0 0 
5 −8 4 −3 0 0 9 −1 2 4 2 3 2 0

Exercise 13: Is it true that det(A + B)=detA+detB? To find out, generate random 5 × 5 matrices A
and B, and compute det(A + B)−detA−detB. Repeat the calculations for three other pairs of n × n
matrices, for various values of n.

Exercise 14: Is it true that detAB=(detA)(detB)?. Repeat the calculation for four pairs of random ma-
trices.
2 4 25 1 −1 3
   
2 4
Exercise 15: Let A and B be the following 3 × 3 matrices  −3
4 2 41 , B =  32 1
2 −2 
1 1 1 1
4 2 2 4 1 2

(a) Calculate A−1 B −1 , (AB)−1 , and (BA)−1


(b) Find (A−1 )T and (AT )−1

Anh H. Vo - [email protected] 3

You might also like