Module 5. Assignment- inspecting matrices in R
(Please select image for better clarity) Why solve(A) and det(A) work. For matrix A, det(A) gives an output of zero. That’s because of how A <- matrix(1:100, nrow=10) is filled: the columns are simple combinations of the vectors of all 1s and 1:10, so the matrix doesn’t have full rank. A zero determinant means A is singular, which means there’s no true inverse. That’s why solve(A) would normally error out. It works in the script because it is wrapped with tryCatch to catch the error. Why operations on B fail (non‑square matrix). Matrix B it’s 10×100, not square which is simply why it failed. Both solve() and det() need a square matrix. So the unwrapped calls would error by definition (as seen), and with tryCatch it captures those errors and continues with the computation. Any notes on numeric stability or performance. I keep it simple: first I check dim() to make sure the matrix is square. Then I wrap the risky parts—solve() and det()—with t...