The Museum of HP Calculators

HP Forum Archive 02

 Error found on HP49GMessage #1 Posted by Aharon Sarussi on 5 May 2000, 6:15 a.m. I used the NUM.SLV on th HP49G to solve linear sys of the following : 6x-3y=15 -2x+y=0 there is no solution , but the HP49G find the solution to be x=1.8 and y=-0.9, I tried other non solution linear system and still the HP49G insist to "solve" it and report as it have solution for example I tried also the following: x-y=2 2x-2y=0 the HP49G find the solution to be x=0.2 and y=-0.2. those any one can tall me what is wrong or it is a BUG!!

 Re: Error found on HP49GMessage #2 Posted by William L. Drylie on 5 May 2000, 4:12 p.m.,in response to message #1 by Aharon Sarussi Dear Aharon: I do not have a 49G calculator, but I put your equation 6X-3Y=15 2X+Y=0 into a 48GX solve for linear equations and came up with the answer that you did X=1.8 and Y=0.9. Here is your explanation. First off in general, the solution set for a system of two equations in two variables is one ordered pair, an infinite number of ordered pairs or an empty set. This equation solution is an infinite number of ordered pairs, and the 48 and 49 will give you this answer if you investigate further. Right off the bat, you should enter the equations in matrix form on the stack, press MTH MATR NORM COND (hp 48G,GX) and compute its condition number. If it is large, 10 to the 12th power or higher, then it is an ill conditioned matrix. In this case with the above equation, it returns a condition error infinite results. Meaning, there are infinitely many ordered pairs. I'm sure the hp49G has the same tests. With this test, you can determine before hand if the equation is solvable with one specific ordered pair. If you do solve it first without testing, there is also another way to test. Your hp 49 returned an answer to you that was not useable because it returned the smallest ordered pair that it could obtain, basically it returned one of the infinite pairs as an answer. Finding the residual of the array will verify this. I will not go into these instructions as I do not have a 49G but I'm sure it has a test for the residual of an array or matrix. The smaller the absolute value of the elements the better the solution, in this case on my 48GX it was rather high. So it is up to the individual to test the answer they receive from the calculator for validity. This is true in both the 48&49. In the hp48GX manual it says that the Linear system solver will return a result array for any of the following systems. Exactly determined systems, Over determined sytems, or under determined sytems, and goes on to say to pay attention to your linear system because it will influence the way you should interpret the result array, and to test for ill conditioning before you solve, or even accept an exact solution as a valid solution. No bug! Hope I have helped you.

 Re: Error found on HP49GMessage #3 Posted by Aharon Sarussi on 7 May 2000, 6:17 a.m.,in response to message #2 by William L. Drylie Thanks for your answer. I disagree whit the idea that this 2 order equation has infinity solutions, that is way: 6x-3y=15 -2x+y=0 that mean y=2x so 6X-3(2x)=15 and 6x-6x=15 finely 0=15 and that can not be!!! no matter what is the reason the HP must report that this 2 order system has no solution !!! I usually need to calculate 13-19 order system and such results must be reported !!

 Re: Error found on HP49GMessage #5 Posted by Aharon Sarussi on 9 May 2000, 1:24 a.m.,in response to message #4 by William L. Drylie Thanks, I understand what you mean . and about TI 89/92 I am going to seriously think about it....

 Re: Error found on HP49GMessage #6 Posted by rupert9000 on 6 May 2000, 5:43 p.m.,in response to message #1 by Aharon Sarussi > 6x-3y=15 -2x+y=0 On my HP41CV the SIMEQ program of the Math I rom module displays: NO SOLUTION. The answer of my HP15C is instead [-7.5e10, -1.5e11]. > x-y=2 2x-2y=0 Again, the HP41CV + Math I rom module displays: NO SOLUTION. The answer of the HP15C is [2e10, 2e10]. The HP15C Advanced Functions Handbook explains the problem of errors in matrix calculations: a square matrix A is said to be ill-conditioned (nearly singular) if the condition number K(A)=|A|*|A^-1| is very large. ( where |A|=row norm of A, |A^-1|=row norm of the inverse of A ). A large condition number makes possible a large error in the result. This seems to be the case of both your examples: K(A)=1.2e11 and K(A)=6e10 respectively (HP15C results). The handbook discusses also the accuracy of numerical solutions to linear systems, describes how to improve the solution precision by iterative refinement (residual correction), round-off errors in internal calculations, accuracy of numerical calculations, and so forth. Similar handbooks are available for the HP28 and the HP48, if I'm not wrong. The main problem with the HP49G is that it isn't a real HP engineering calculator. :-)

 Re: Error found on HP49GMessage #7 Posted by Aharon Sarussi on 7 May 2000, 6:05 a.m.,in response to message #6 by rupert9000 Thanks for your answer. But I think your HP15C solution is not relevant here, since the solution you got is different from mine, (very different !!) any way on "non solution equations" I expect my HP to report me that it is a "non solution equations" and not give me a solution that it is not mathematically right. on 2 order equation it's simple to check out the HP but what about 19 order equation that I need to use??.

 Re: Error found on HP49GMessage #8 Posted by Brian Keller on 7 May 2000, 11:25 a.m.,in response to message #7 by Aharon Sarussi I tried this system on my TI-92+ and it correctly reported "No solution".

 Re: Error found on HP49GMessage #9 Posted by rupert9000 on 7 May 2000, 12:50 p.m.,in response to message #7 by Aharon Sarussi > Thanks for your answer. But I think your HP15C solution > is not relevant here, since the solution It looks like there is a little misunderstanding. The point is: in order to make proper use of numerical computation algorithms it is required to learn how they work.

 Re: Error found on HP49GMessage #10 Posted by Bill Duncan on 8 May 2000, 2:48 a.m.,in response to message #7 by Aharon Sarussi The determinant (as calculated on a 48G) is zero. The condition value is infinate. What do you expect?

 Re: Error found on HP49GMessage #11 Posted by Aharon Sarussi on 8 May 2000, 6:19 a.m.,in response to message #10 by Bill Duncan I disagree whit the idea that this 2 order equation has infinity solutions, that is way: 6x-3y=15 -2x+y=0 that mean y=2x so 6X-3(2x)=15 and 6x-6x=15 finely 0=15 and that can not be!!! no matter what is the reason the HP must report that this 2 order system has no solution !!! I usually need to calculate 13-19 order system and such results must be reported !!

 Re: Error found on HP49GMessage #12 Posted by Wayne Brown on 7 May 2000, 5:45 p.m.,in response to message #6 by rupert9000 Just for fun, I decided to try this on my HP-41CX. Using the MATH I ROM, I got the same results as your 41CV for both sets of equations: NO SOLUTION. However, using the MSYS function from the HP-41 Advantage ROM, I got [2.5e10, 5e10] for the first pair and the same as your 15C for the second pair [2e10, 2e10]. After throwing together a quick program to calculate K(A) using RNRM and MINV, I got 1.2e11 for the first matrix and 6e10 for the second (both the same as your 15C's results). Surprisingly, I didn't find any mention in the documentation of checking the condition number or of the possibility of errors in the solution matrix. I guess they expected that anyone using these functions would be aware of these things, but for math non-experts (like me!) it would have been nice to mention them.

 Re: Error found on HP49GMessage #13 Posted by Aharon Sarussi on 8 May 2000, 6:22 a.m.,in response to message #12 by Wayne Brown can you be aware of these things when you using 19order system??????

 Re: Error found on HP49GMessage #14 Posted by Andy on 7 May 2000, 7:13 p.m.,in response to message #1 by Aharon Sarussi One more note on this issue... I have a HP49G and obviously get the same (incorrect)result. My stepson's TI89, one of the HP49G's biggest competitors, gives the correct solution. I just have to shake my head on this one.

 Re: Error found on HP49GMessage #15 Posted by Werner Huysegoms on 8 May 2000, 3:04 a.m.,in response to message #14 by Andy Depends how you look at it. The numerical algorithm to solve a set of linear equations is the same in the 48 and 49. (In exact mode, the 49G does return [0 '?'] to indicate a defective set). The algorithm is designed to perturb the original matrix with small quantities to reach a solution if no solution exists. While I contend this practice, it is true that an exact linear dependency will only be discovered for the smallest of problems (talking about numerical, approximate mode here), leading you to believe that if a solution has been found, it must necessarily be the correct one. Not so.. rule of thumb: always check the condition number.. its exponent tells you how many digits you can trust of the answer ie if you have a condition number of 1e5, you can trust 15-5=10 digits of the answer (for exact input, otherwise it's 12-5=7 digits). If your condition number exceeds 1e15 (or 1e12) the answer is useless, and no numerical algorithm can help that. It would have been nice if a command existed that solved the system AND returned the condition number at the same time..

 Re: Error found on HP49GMessage #16 Posted by Keith Dicks on 9 May 2000, 8:02 a.m.,in response to message #1 by Aharon Sarussi Have you contacted HP, via their web site, about this problem? From the other responses from more learned HP users it may well be possible to derive the accuracy (none in this case) of the result. However using the HP49G guides (which is all you can assume) there is no mention of further investigation to be carried out. The ordinary user will probably trust that the answer is right. As with some other areas of the HP49G's performance it is too variable, this is the worst possible situation as any non-expert user can no longer trust the answers given. It is no good to say 'well the user is inputting impossible problems and the HP49 is just doing the best it can'. If it is true that the TI89/92 (and even the HP41!) gives the more informative and 'correct' result then this is bad news for the sales of HP49G and needs to be rectified.

Go back to the main exhibit hall