On this page
AI chatbots are excellent at explaining the concepts of linear algebra, but they are notoriously unreliable when asked to carry out the calculations. If you ask an AI to multiply two matrices, there is a high chance it will explain the steps perfectly but stumble on the arithmetic.
A 2023 evaluation of ChatGPT found that it failed 20% of mathematical word problems even when generating a step-by-step solution, and failed 84% of the time when asked for a direct answer (arXiv:2302.13814). Because a single arithmetic slip in one cell of a matrix ruins the final answer, you should never copy an AI-generated matrix product without verifying it. Fermi's AI tutor works differently because it teaches rather than simply answering—holding a line of reasoning across a session and writing on a board to help you solve the problem yourself.
When you use a standard AI tool to check your work, use these three quick tests to catch hallucinations.
Are the dimensions correct?
The fastest way an AI fails at matrix multiplication is by generating an answer with the wrong shape. Large language models process text as a sequence of tokens, which makes it incredibly difficult for them to internally "visualise" a two-dimensional grid of numbers.
For a matrix multiplication AB to be defined, the number of columns in the first matrix (A) must equal the number of rows in the second matrix (B). If A is an m × n matrix and B is an n × p matrix, the product AB will be an m × p matrix.
Example: If A is 2 × 3 and B is 3 × 2, the result must be a 2 × 2 matrix.
The check: Before looking at the numbers, look at the shape. If the AI hands you a 3 × 3 matrix for the example above, you instantly know it hallucinated the result.
If the model fails this basic structural test, you can discard the entire answer immediately. Always check the outer dimensions before investing time in checking the arithmetic.
Can you verify a single entry by hand?
If the dimensions are correct, the next step is a spot-check. Instead of recalculating the entire matrix yourself—which defeats the purpose of using an AI—choose one entry in the final matrix and calculate it by hand.
To find the entry in the i-th row and j-th column of the product matrix, take the dot product of the i-th row of the first matrix and the j-th column of the second matrix. Multiply the matching elements and add them together.
For example, to check the entry in the first row and second column, you multiply the first element of A's first row by the first element of B's second column, add it to the product of the second elements, and so on. If your hand-calculated number does not match the AI's number in that spot, the whole matrix is wrong.
Doing this for just one or two entries is an incredibly efficient way to catch an arithmetic hallucination. If you are struggling with the mechanics of this operation, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
Does the determinant check out?
If you are multiplying square matrices, you have a powerful mathematical shortcut at your disposal: the determinant of a product is equal to the product of the determinants.
For any two n × n matrices A and B: det(AB) = det(A) × det(B)
This is an excellent verification step because computing a determinant boils a large grid of numbers down to a single value. If the AI gives you a product matrix C, you can calculate the determinant of C. Then, calculate the determinants of A and B separately and multiply them. If the two results do not match, the AI has made a calculation error somewhere in the multiplication process.
For 2 × 2 matrices, finding the determinant takes seconds using the formula (ad − bc). For 3 × 3 matrices, it takes a little longer using cofactor expansion, but it is still often faster and much less error-prone than checking all nine entries of the multiplication by hand. This property also applies to geometric applications, such as finding the area of a triangle using determinants.
By applying these three checks—verifying the dimensions, testing a single entry, and calculating the determinant—you can confidently use AI to learn linear algebra concepts like finding Aⁿ for a matrix by spotting the pattern, without falling victim to its poor arithmetic.



