# Different determinant for same matrix

I have the following matrix: $$A=\begin{bmatrix} 2883,4675 & 44263,069125 & 724401,86824027 \\ 44263,069125 & 724401,86824027 & 12346864,4095603\\ 724401,86824027 & 12346864,4095603 & 216427597,203037 \end{bmatrix}$$ And I want to calculate the determinant. I know of two ways I can do this. Either I use the rule of Sarrus or I split the matrix (Laplace expansion) and calculate it this way.

Using the rule of Sarrus would give us: $$det(A)=2883,4675\cdot724401,86824027\cdot216427597,203037+44263,069125\cdot12346864,4095603\cdot724401,86824027+724401,86824027\cdot44263,069125\cdot12346864,4095603-724401,86824027^{3}-44263,069125^{2}\cdot216427597,203037-2883,4675\cdot12346864,4095603^{2}$$

I calculated the determinant using Excel and got exactly $$122305571810432$$

Splitting the matrix gives us: $$\begin{bmatrix} 2883,4675\begin{vmatrix} 724401,86824027 & 12346864,4095603\\ 12346864,4095603 & 216427597,203037 \end{vmatrix}\\ -44263,069125\begin{vmatrix} 44263,069125 & 12346864,4095603\\ 724401,86824027 & 216427597,203037 \end{vmatrix}\\ +724401,86824027\begin{vmatrix} 44263,069125 & 724401,86824027\\ 724401,86824027 & 12346864,4095603 \end{vmatrix} \end{bmatrix}$$ Which leads to: $$det(A)=2883,4675(724401,86824027\cdot216427597,203037-12346864,4095603\cdot12346864,4095603)-44263,069125(44263,069125\cdot216427597,203037-12346864,4095603\cdot724401,86824027)+724401,86824027(44263,069125\cdot12346864,4095603-724401,86824027^{2})$$ Calculating that value in Excel gives me $$122305571810516$$

I tried using a few websites which allowed me to calculate the determinant online, I got different results again. One gave me $$122305571810432,17$$ And the other one gave me $$122305571810440$$

Why is it that I'm getting a different determinant for the same matrix? Is one method more accurate than another? Or maybe there is a different method which I did not try and is even more accurate?

Picture from the excel table

Formula for B1:=A3*A5*A7+A4*A6*A5+A5*A4*A6-A5^3-A4^2*A7-A3*A6^2
Formula for B2:=A3*(A5*A7-A6^2)-A4*(A4*A7-A6*A5)+A5*(A4*A6-A5^2)

I think you are playing at the edges of the floating point range, and the errors are compounding and decimal parts are dropped. So, depending on the calculations, you get different numbers, all wrong.

You either need to use some computer system/program that uses infinite precision, or you need to work with your matrix in a way that you avoid products (that give you very big numbers) and differences of said big numbers.

See the Wikipedia article for more details.

To see an example of (part of) what is happening, take your number $122305571810432$ in your Excel cell, and now in another cell add $0.3$ to it, and look at the result.

• This seems the right answer. To add to it, I'd say that the Excel answer is almost surely wrong: what is the probability that out of so many numbers with decimal digits, an integer result should emerge? Nah, I'm not buying it. @Cartman123, try using Wolfram Alpha, it is more respectful to decimal places. Apr 22, 2016 at 18:30
• Yeah, I think you're right. I'm trying out some software seeing if it gives me the same answer. I'll keep you posted. Apr 22, 2016 at 19:09
• If you really care about obtaining the actual determinant, you could divide each row by the biggest element, calculate the determinant, and then multiply by each of the three numbers you extracted. Still, you cannot do it with Excel because it is not precise enough. Apr 22, 2016 at 19:13
• I used an arbitrary precision calculator and turned out the determinant is equal to around 122 305 571 810 451 which is the final answer. Thanks! Apr 22, 2016 at 19:27