All problems
Condition Estimate via Power Iterations
Problem
Estimate the 2-norm condition number of A as the ratio sigma_max / sigma_min.
Use power iteration (starting from all ones) on B = A^T A to get sigma_max, and on inv(B) to get 1 / sigma_min; return their product. Return None if B is singular.
Hint
The largest eigenvalue of inv(A^T A) is the reciprocal of the smallest eigenvalue of A^T A.
Test cases
case 1
in: [[[1,0],[0,2]],10]
expected: 2
case 2
in: [[[1,0],[0,1]],10]
expected: 1
case 3
in: [[[1,2],[3,4]],30]
expected: 14.933034373659252
case 4
in: [[[4,1],[1,3]],20]
expected: 1.9387489019317519
Starter codePython
def condition_estimate(A, num_iterations):
# Your code here
pass4 test cases · run your code against them in the editor