# How to verify the characteristic polynomial? [closed]

I am computing the characteristic polynomial of a matrix over a number field, using the minimal polynomial of it. Is there a fast way to verify the characteristic polynomial of a big matrix ?

## closed as off-topic by YCor, Greg Martin, abx, Neil Hoffman, Per AlexanderssonNov 27 '18 at 21:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "MathOverflow is for mathematicians to ask each other questions about their research. See Math.StackExchange to ask general questions in mathematics." – YCor, Greg Martin, abx, Neil Hoffman, Per Alexandersson
If this question can be reworded to fit the rules in the help center, please edit the question.

• By "number field" do you mean a finite extension of $\mathbb{Q}$? The question is tagged with "finite-fields" which would rather change the answer. – David Zhang Nov 27 '18 at 15:57
• @DavidZhang Yes, I am sorry. It is a finite extension of \mathcal{Q}, just finitely generated. – student Nov 27 '18 at 19:46
• – David E Speyer Nov 27 '18 at 21:00

You can pick $$n+1$$ numbers and evaluate the determinant $$det(A-tE)$$ at these values. This gives you a garantee, but if you just want a rough check, you can pick smaller amount of (random) numbers and evaluate the determinants modulo some prime numbers (which is usually faster).
• Thank you for the answer. You meant, computing eigenvalues (roots) of the polynomial? and then checking whether $det(A-tE)$ is zero? Then, what did you meant by picking smaller amount of random numbers? – student Nov 27 '18 at 19:58
• @student No, I think Victor meant exactly what he wrote, nothing about computing eigenvalues. If you have two polynomials that you want to compare (in your case they're the actual characteristic polynomial and the computed one that you want to check), evaluate both at some specific numbers and see whether you get the same results. If your polynomials have degree $n$ and you get the same results for each of $n+1$ inputs, then the polynomials are the same. If you try only $k$ inputs ($k<n+1$) and get the same results, you can't be sure the polynomials agree (continued in next comment) – Andreas Blass Nov 28 '18 at 2:24
• (continuation of previous comment) but you can be pretty confident that they agree if $k$ isn't too small and the $k$ inputs you used are random. – Andreas Blass Nov 28 '18 at 2:25
• @AndreasBlass , got it. Thank you very much. The approach seems to be expensive, as I have to calculate determinant $k+1$ times. But,I will see. – student Nov 28 '18 at 22:25