Ask LibreOffice - RSS feedhttps://ask.libreoffice.org/en/questions/Questions and answers for LibreOfficeenFri, 04 May 2018 23:02:50 +0200mdeterm solving matrix determinanthttps://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/Hi, I've stumbled accros with a strange issue, using LO Calc in spreadsheet calculating matrices, especially a determinant of the matrix with mdeterm() function. The function gives wrong answer. So here is the data in the calc file: https://drive.google.com/open?id=1S4ptB2AqvPya9fIjYOQhclOUZmeoUG76
Octave gives answer for this matrix Det(A)=23503.602875
(matrix for solving in octave: A=[10, 22.5, 71.25; 22.5, 71.25, 253.13; 71.25, **235.13**, 958.31]) **error in third row a32 index**
I've checked with [wolframalpha](http://www.wolframalpha.com/input/?i=det+%7B%7B10,+22.5,+71.25%7D,+%7B+22.5,+71.25,+253.13%7D,+%7B71.25,+235.13,+958.31%7D%7D) and gives the same answer as Octave.
I found similar issue with this function in the [buggzila ](https://bugs.documentfoundation.org/show_bug.cgi?id=32834). But it is shown, that this bug is fixed.
So, why do LO Calc gives me wrong answer? Any suggestions?
P.S. LO version: 5.4.6.2 (x64)Fri, 04 May 2018 13:57:09 +0200https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/Answer by OSS-user for <p>Hi, I've stumbled accros with a strange issue, using LO Calc in spreadsheet calculating matrices, especially a determinant of the matrix with mdeterm() function. The function gives wrong answer. So here is the data in the calc file: <a href="https://drive.google.com/open?id=1S4ptB2AqvPya9fIjYOQhclOUZmeoUG76">https://drive.google.com/open?id=1S4p...</a></p>
<p>Octave gives answer for this matrix Det(A)=23503.602875
(matrix for solving in octave: A=[10, 22.5, 71.25; 22.5, 71.25, 253.13; 71.25, <strong>235.13</strong>, 958.31]) <strong>error in third row a32 index</strong></p>
<p>I've checked with <a href="http://www.wolframalpha.com/input/?i=det+%7B%7B10,+22.5,+71.25%7D,+%7B+22.5,+71.25,+253.13%7D,+%7B71.25,+235.13,+958.31%7D%7D">wolframalpha</a> and gives the same answer as Octave. </p>
<p>I found similar issue with this function in the <a href="https://bugs.documentfoundation.org/show_bug.cgi?id=32834">buggzila </a>. But it is shown, that this bug is fixed. </p>
<p>So, why do LO Calc gives me wrong answer? Any suggestions?</p>
<p>P.S. LO version: 5.4.6.2 (x64)</p>
https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/?answer=154048#post-id-154048Hi, Regina,
thanks for the answer. That definitely has an influence on result, but not to much. The difference is by few tenth's. So, yeah, roundof is, because I didn't check what real value was in a cell e.g. 958.3125 Calc shows in general format as 958.31.
But real issue was human failure! When typing matrix, I've accidentally messed up one number in third row i.e. it should be 253.13, and my typo was 235.15. So Octave gave me another result.
Again, everything works great, all programs shows the same answer! Sorry for false interpretation.
P.S. I've checked the determinant with Sarrus rule, and the result was again - correct. Thank you!Fri, 04 May 2018 21:48:55 +0200https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/?answer=154048#post-id-154048Comment by David for <p>Hi, Regina, </p>
<p>thanks for the answer. That definitely has an influence on result, but not to much. The difference is by few tenth's. So, yeah, roundof is, because I didn't check what real value was in a cell e.g. 958.3125 Calc shows in general format as 958.31. </p>
<p>But real issue was human failure! When typing matrix, I've accidentally messed up one number in third row i.e. it should be 253.13, and my typo was 235.15. So Octave gave me another result.</p>
<p>Again, everything works great, all programs shows the same answer! Sorry for false interpretation.</p>
<p>P.S. I've checked the determinant with Sarrus rule, and the result was again - correct. Thank you!</p>
https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/?comment=154058#post-id-154058@OSS-user - You have "closed" this Q&A, but you haven't "accepted" the "right" answer -- you do that by clicking the `✓` symbol at the top-left of the correct answer. Please do this! That's a signal in the Askbot systm to other users that the question has been solved. Thanks.Fri, 04 May 2018 23:02:50 +0200https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/?comment=154058#post-id-154058Answer by Regina for <p>Hi, I've stumbled accros with a strange issue, using LO Calc in spreadsheet calculating matrices, especially a determinant of the matrix with mdeterm() function. The function gives wrong answer. So here is the data in the calc file: <a href="https://drive.google.com/open?id=1S4ptB2AqvPya9fIjYOQhclOUZmeoUG76">https://drive.google.com/open?id=1S4p...</a></p>
<p>Octave gives answer for this matrix Det(A)=23503.602875
(matrix for solving in octave: A=[10, 22.5, 71.25; 22.5, 71.25, 253.13; 71.25, <strong>235.13</strong>, 958.31]) <strong>error in third row a32 index</strong></p>
<p>I've checked with <a href="http://www.wolframalpha.com/input/?i=det+%7B%7B10,+22.5,+71.25%7D,+%7B+22.5,+71.25,+253.13%7D,+%7B71.25,+235.13,+958.31%7D%7D">wolframalpha</a> and gives the same answer as Octave. </p>
<p>I found similar issue with this function in the <a href="https://bugs.documentfoundation.org/show_bug.cgi?id=32834">buggzila </a>. But it is shown, that this bug is fixed. </p>
<p>So, why do LO Calc gives me wrong answer? Any suggestions?</p>
<p>P.S. LO version: 5.4.6.2 (x64)</p>
https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/?answer=154020#post-id-154020I find no error in the calculation in Calc. Do you have considered, that the displayed values are rounded? If you compare it with other calculators you have to use
<pre> 10 22.5 71.25
22.5 71.25 253.125
71.25 253.125 958.3125
</pre>
det(A)=6806.25
If you do not believe it, calculate it with Sarrus-rule with a pocket calculatorFri, 04 May 2018 17:09:35 +0200https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/?answer=154020#post-id-154020Comment by erAck for <p>I find no error in the calculation in Calc. Do you have considered, that the displayed values are rounded? If you compare it with other calculators you have to use</p>
<pre> 10 22.5 71.25
22.5 71.25 253.125
71.25 253.125 958.3125
</pre>
<p>det(A)=6806.25</p>
<p>If you do not believe it, calculate it with Sarrus-rule with a pocket calculator</p>
https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/?comment=154044#post-id-154044With the example document given and Sarrus rule in Calc:
=A4*B5*C6+B4*C5*A6+A5*B6*C4-C4*B5*A6-B4*A5*C6-C5*B6*A4
=> 6806.25
It's "funny" but sad that both Octave and Wolfram apparently give the same wrong answer.. yet other calculators on the net agree with Calc.Fri, 04 May 2018 20:13:58 +0200https://ask.libreoffice.org/en/question/154004/mdeterm-solving-matrix-determinant/?comment=154044#post-id-154044