Practice question · Multiple choice
Solving a linear system by computing the inverse is correct mathematics and discouraged in code. What are the two objections?
Hints
- Computing A⁻¹ means solving Ax = e for each column of the identity. How many systems is that?
- Every floating-point operation rounds. Which route performs more?
Show the answer
C. Cost and accuracy: it solves n systems where you needed one
Why
Roughly n³ against n³/3, plus more roundings on an ill-conditioned matrix. The formula x = A⁻¹b states what the solution is; it was never an instruction for computing it, which is why solve exists and calling inv first is the classic tell of someone translating algebra directly into code.
Practise Integration and Antiderivatives
The app has 7 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.