Editor

Predict the Determinant

Advanced · Predict the output · from NumPy Linear Algebra: Dot Products, Inverses, and Eigenvalues

From the lesson: NumPy Linear Algebra: Dot Products, Inverses, and Eigenvalues

Linear algebra is the math behind machine learning, computer graphics, physics simulations, and data science. Every time a game rotates a 3D object, a search engine ranks pages, or a neural network makes a prediction, matrix operations are doing the heavy lifting.

Read the lesson

What does the following code print? Remember the determinant formula for a 2x2 matrix: ad - bc.

import numpy as np
M = np.array([[3, 8],
              [4, 6]])
print(np.linalg.det(M))
import numpy as np
M = np.array([[3, 8],
[4, 6]])
print(round(np.linalg.det(M)))

More NumPy Linear Algebra exercises

All Python exercises · 50 practice problems · Data Science & Machine Learning quiz