Question: ( a ) Use numpy's np . random.randn function to randomly generate an 8 8 matrix M . ( b ) Use numpy to randomly

(a) Use numpy's np.random.randn function to randomly generate an 88 matrix M.
(b) Use numpy to randomly generate a vector v of dimension 8.
(c) Write code that uses numpy to multiply the above matrix M by the above vector v.
(d) Write code that computes the sum of the squares of the components of v. Can you do it in one line?
(e) Write numpy code that randomly generates a vector w of dimension 8 and then compute sthe dot product of v and w. Use numpy's np. vdot function to compute the dot product.
 (a) Use numpy's np.random.randn function to randomly generate an 88 matrix

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!