Challenge - 5 Problems
Eigen Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of eigenvalues and eigenvectors for a 2x2 matrix
What is the output of the following MATLAB code?
A = [2 1; 1 2]; [V,D] = eig(A); disp(D); disp(V);
MATLAB
A = [2 1; 1 2]; [V,D] = eig(A); disp(D); disp(V);
Attempts:
2 left
💡 Hint
Remember that eig returns eigenvalues in ascending order on the diagonal of D and corresponding eigenvectors in V.
✗ Incorrect
The matrix A has eigenvalues 1 and 3. MATLAB's eig returns them in ascending order on the diagonal of D. The columns of V are the corresponding eigenvectors normalized to length 1.
🧠 Conceptual
intermediate1:30remaining
Understanding eigenvalue multiplicity
Consider the matrix
A = [2 0; 0 2]. How many distinct eigenvalues does A have?Attempts:
2 left
💡 Hint
Look at the diagonal elements and their values.
✗ Incorrect
Matrix A is diagonal with both diagonal entries equal to 2. This means it has one eigenvalue 2 with algebraic multiplicity 2.
🔧 Debug
advanced1:30remaining
Identify the error in eigenvalue calculation code
What error will the following MATLAB code produce?
A = [1 2; 3 4]; [V,D] = eig(A(1:3,1:3));
MATLAB
A = [1 2; 3 4]; [V,D] = eig(A(1:3,1:3));
Attempts:
2 left
💡 Hint
Check the size of matrix A and the indexing used.
✗ Incorrect
Matrix A is 2x2, but the code tries to access rows and columns 1 to 3, which is out of bounds, causing an indexing error.
📝 Syntax
advanced1:30remaining
Syntax error in eigenvalue function usage
Which option contains a syntax error when computing eigenvalues and eigenvectors in MATLAB?
Attempts:
2 left
💡 Hint
MATLAB uses square brackets for multiple outputs and does not support comma-separated assignment.
✗ Incorrect
Option A uses Python-style multiple assignment with commas, which is invalid in MATLAB syntax.
🚀 Application
expert2:00remaining
Number of eigenvalues for a 3x3 matrix with repeated eigenvalues
Given the matrix
B = [5 4 2; 0 1 0; 0 0 1], how many distinct eigenvalues does B have?Attempts:
2 left
💡 Hint
Look for eigenvalues on the diagonal and consider repeated values.
✗ Incorrect
Matrix B is upper triangular, so eigenvalues are diagonal entries: 5, 1, 1. So two distinct eigenvalues: 5 and 1.