1

I want to do LU decomposition with $A$:

$ A= \left[ {\begin{array}{cc} 1 & 2 & 3 & 4 \\ -9 & 8 & -15 & 4 \\ 2 & 13 & -21 & 7 \\ 4 & -5 & 5 & 3 \end{array} } \right] $

My answer is this, which the result is approximation because of limitations of floating point data. $A$ can be done LU decomposition without pivoting.

But WolframAlpha gives me different solution. They do LU decomposition with pivoting. I don't know why WolframAlpha calculate LU decomposition with pivoting even pivoting isn't needed.

  • Try this calculator: http://www.gregthatcher.com/Mathematics/LU_Factorization.aspx – Moo May 16 '18 at 17:26
  • $$\left( \begin{array}{ccc} 1 & 0 & 0 \ -9 & 1 & 0 \ 2 & \frac{9}{26} & 1 \ \end{array} \right).\left( \begin{array}{cccc} 1 & 2 & 3 & 4 \ 0 & 26 & 12 & 40 \ 0 & 0 & -\frac{405}{13} & -\frac{193}{13} \ 4 & -5 & 5 & 3 \ \end{array} \right)=\left( \begin{array}{cccc} 1 & 2 & 3 & 4 \ -9 & 8 & -15 & 4 \ 2 & 13 & -21 & 7 \ 4 & -5 & 5 & 3 \ \end{array} \right)$$ – Moo May 16 '18 at 17:31
  • Oh this calculates LU rather than PLU. And.. no reason why WolframAlpha using pivot without any ground? – oddman621 May 17 '18 at 01:24
  • It is just the way they coded up their routine - even the professional Mathematica does it that way. I coded my own variant and produced the results above - as well as the site I provided. This is not bad to calculate by hand for such a small matrix. – Moo May 17 '18 at 01:35
  • Seems unclear. You mean the result(LU or PLU) depends on what algorithms are used? – oddman621 May 17 '18 at 02:47
  • Yes, it looks like Mathematica's coded algorithm always uses PLU when it can. The one I wrote does not and neither does the web site I pointed you to. See this posting for examples and links: https://math.stackexchange.com/questions/485513/what-are-pivot-numbers-in-lu-decomposition-please-explain-me-in-an-example – Moo May 17 '18 at 03:31
  • Problem solved. Thank you for the help. I wish I could accept your comments. – oddman621 May 17 '18 at 04:33

0 Answers0