Challenge - 5 Problems
Matrix Determinant Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this MATLAB code?
Consider the following MATLAB code that calculates the determinant of a matrix. What is the output printed to the console?
MATLAB
A = [2 3; 1 4]; d = det(A); disp(d);
Attempts:
2 left
💡 Hint
Recall that the determinant of a 2x2 matrix [a b; c d] is ad - bc.
✗ Incorrect
The determinant of matrix A = [2 3; 1 4] is (2*4) - (3*1) = 8 - 3 = 5.
❓ Predict Output
intermediate2:00remaining
What is the determinant of this 3x3 matrix?
Given the matrix B below, what value does MATLAB's det(B) return?
MATLAB
B = [1 2 3; 0 1 4; 5 6 0]; d = det(B); disp(d);
Attempts:
2 left
💡 Hint
Use the rule for 3x3 determinants or MATLAB's det function.
✗ Incorrect
The determinant is calculated as 1*(1*0 - 4*6) - 2*(0*0 - 4*5) + 3*(0*6 - 1*5) = 1*(0 - 24) - 2*(0 - 20) + 3*(0 - 5) = -24 + 40 - 15 = 1.
❓ Predict Output
advanced2:00remaining
What is the output of this MATLAB code with a singular matrix?
What does MATLAB display when calculating the determinant of matrix C?
MATLAB
C = [1 2 3; 2 4 6; 3 6 9]; d = det(C); disp(d);
Attempts:
2 left
💡 Hint
Check if the rows of the matrix are linearly dependent.
✗ Incorrect
Matrix C has rows that are multiples of each other, so it is singular and its determinant is 0.
❓ Predict Output
advanced2:00remaining
What is the determinant of this diagonal matrix?
Calculate the determinant of matrix D using MATLAB's det function. What is the output?
MATLAB
D = diag([4, 5, 6, 7]); d = det(D); disp(d);
Attempts:
2 left
💡 Hint
The determinant of a diagonal matrix is the product of its diagonal elements.
✗ Incorrect
The determinant is 4*5*6*7 = 840.
🧠 Conceptual
expert2:00remaining
What error does this MATLAB code produce?
What error message will MATLAB show when running this code?
MATLAB
E = [1 2; 3 4; 5 6]; d = det(E); disp(d);
Attempts:
2 left
💡 Hint
Check the shape of matrix E and the requirements for det.
✗ Incorrect
The det function requires a square matrix. E is 3x2, so MATLAB throws an error.