Challenge - 5 Problems
SVD Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of SVD on a simple matrix
What is the output of the following MATLAB code snippet?
MATLAB
A = [3 1; 1 3]; [U,S,V] = svd(A); disp(diag(S)');
Attempts:
2 left
💡 Hint
Recall that singular values are the square roots of eigenvalues of A'*A.
✗ Incorrect
The matrix A'*A has eigenvalues 16 and 4, so singular values are sqrt(16)=4 and sqrt(4)=2.
🧠 Conceptual
intermediate1:30remaining
Properties of matrices in SVD
Which statement about the matrices U, S, and V from the SVD of a matrix A is correct?
Attempts:
2 left
💡 Hint
Think about the definition of orthogonal matrices and singular values.
✗ Incorrect
In SVD, U and V are orthogonal matrices (U'*U=I, V'*V=I), and S is diagonal with non-negative singular values.
🔧 Debug
advanced2:30remaining
Identify the error in SVD reconstruction
What is the error in the following MATLAB code that attempts to reconstruct matrix A from its SVD?
MATLAB
A = [1 2; 3 4]; [U,S,V] = svd(A); A_reconstructed = U * S * V; disp(A_reconstructed);
Attempts:
2 left
💡 Hint
Recall the formula for reconstructing A from U, S, and V.
✗ Incorrect
The correct reconstruction is A = U * S * V', not U * S * V.
📝 Syntax
advanced1:30remaining
Syntax error in SVD usage
Which option contains a syntax error when performing SVD in MATLAB?
Attempts:
2 left
💡 Hint
Check the correct syntax for function calls in MATLAB.
✗ Incorrect
In MATLAB, function arguments must be enclosed in parentheses; 'svd A;' is invalid syntax.
🚀 Application
expert2:00remaining
Number of singular values greater than a threshold
Given matrix A, how many singular values are greater than 1.5 in the following code?
MATLAB
A = [4 0 0; 0 3 0; 0 0 0.5]; [~,S,~] = svd(A); sv = diag(S); count = sum(sv > 1.5);
Attempts:
2 left
💡 Hint
Look at the diagonal entries of S and count those greater than 1.5.
✗ Incorrect
The singular values are 4, 3, and 0.5; only 4 and 3 are greater than 1.5, so count is 2.