Note: matrix and vector operations can be found in lecture slides COEN140_02_LinearAlgebraReview.pdf.
- Create a 2×5 matrix 𝐀 with elements as random float numbers from 0 to 1. Print the rank of 𝐀.
Let 𝐁 = 𝐀𝐀𝑇, find the shape and rank of 𝐁
Let 𝐂 = 𝐀𝑇𝐀, find the shape and rank of 𝐂
- Create a 3×5 matrix 𝐗 with elements as random integers from 0 to 10, and find the dimension (shape) of 𝐀 = 𝐗𝐗𝑇 by coding;
Create a 3×1 column vector 𝐰 with elements as random integers from 0 to 10, and find the dimension of 𝐀𝐰 by coding;
Find the dimension of 𝐰𝑇𝐀 by coding;
Find the dimension of 𝐰𝑇𝐀𝐰 by coding.
Find a way (by coding) to verify that 𝐗𝐗𝑇 is symmetric.
Calculate 𝐀−1. Print 𝐀−1𝐀 and 𝐀𝐀−1.
- Create a 5×1 column vector 𝐱 with elements as random float numbers from 0 to 1. Calculate 𝐱𝐱𝑇 by coding. What do you think is the rank of 𝐱𝐱𝑇?
- Create a 5×5 identity matrix 𝐈 and print it.



