CARVIEW |
Linear Algebra in NumPy Arrays
This quiz is designed to test and enhance your understanding of linear algebra concepts implemented using NumPy
Question 1
Which NumPy function is used to compute the dot product of two arrays?
np.multiply()
np.dot()
np.matmul()
np.linalg.dot()
Question 2
Which NumPy function is used to compute the dot product of two arrays?
np.multiply()
np.dot()
np.matmul()
np.linalg.dot()
Question 3
Which function is used to compute the determinant of a matrix?
np.linalg.det()
np.determinant()
np.linalg.inv()
np.linalg.eig()
Question 4
What will the following code output?
import numpy as np
A = np.array([[2, 3], [1, 4]])
result = np.linalg.inv(A)
print(result)
[[ 0.8 -0.6]
[-0.2 0.4]]
[[ 0.5 -0.5]
[-0.5 0.5]]
[[1 0]
[0 1]]
Error
Question 5
Which function is used to compute the eigenvalues and eigenvectors of a matrix?
np.linalg.inv()
np.linalg.eig()
np.linalg.norm()
np.linalg.svd()
Question 6
What is the Frobenius norm of this matrix?
import numpy as np
A = np.array([[1, 2], [3, 4]])
result = np.linalg.norm(A)
print(result)
5.477
10
5
7
Question 7
How can you solve a linear system of equations Ax = b?
np.linalg.inv(A).dot(b)
np.linalg.solve(A, b)
np.linalg.solve(A)
Both a and b
Question 8
What will be the output of this code?
import numpy as np
A = np.array([[1, 2], [3, 4]])
result = np.trace(A)
print(result)
10
5
Error
6
Question 9
What does np.linalg.qr() compute?
Determinant
QR decomposition
Singular Value Decomposition
Cross product
Question 10
What does np.linalg.svd() return?
Singular values
Eigenvalues
[Tex]U, \Sigma and V[/Tex]
Both a and c
There are 10 questions to complete.