How to Divide by Zero
James Anderson
James Anderson is an academic at the University of Reading and also chair of the Berkshire branch of the BCS. James is the inventor of "transarithmetic" which, amongst other things, gives us a solution to the problem of 'Divide by Zero' errors.
Dust off your phone's calculator (or bring a pocket calculator if you want to be retro) as in his talk James will show how this new maths can make hardware simpler, cheaper and more reliable; Can stop missiles firing in the wrong direction and make amazingly fast computers. He also promises that a 12 year old can understand the maths (phew!!).
3 Comments
David J Seed
there are several discussions on nullity, wheel and NaN, see here http://scienceblogs.com/goodmath/2006/12/nullity_the_nonsense_number_1.php and wikipedia. But for me the representation of divide by zero is not the issue, the issue is whether you can deal with division by zero in a useful way. can you for example solve ax^2 + bx+c = 0 using
x= (-b +-sqrt(b^2-4ac))/2a, when a =0.
However you represent a divide by zero I cannot see, how transarithmetic or any other device will be able to extract the solution to the above equation which is (x= -b/c). The key point is that 6/2 *2 =6 but 6/0 *0 could equal anything you like Nan wheel or nullity but you have lost the information that you started the calculation with a 6 and this cannot be recovered. Another issue for real computers is that it is not just zero that gives problems. a=10^-70 gives problems as well and any computer that claims to handle divide by zero must also deal with overflow and and underflow.
For those interested the way to solve a quadratic with very small a is to use the iterative method
x(next) = -c/b -a*x^2.
It can easily be seen that this method works for arbitrarily small a.
Note that the method fails for finite a and b=0, again no representation of divide by zero applied to the iterative method will give us the required solution: x=+-sqrt(-c/a).
Finally, what language would you program this . I'd be interested to see any real solutions to such problems
David S
James Anderson
David, I just saw your comment.
When the equation ax^2 + bx + c = 0 has a = 0 then solve the equation bx + c = 0. Similarly when a = b = 0, solve the equation c = 0. When a = b = c = 0 you have the atomic solution 0 = 0 without doing any work, other than the work it takes to recognise this case and return the result.
Transreal arithmetic provides a solution for every arithmetical operation but it is up to the programmer and mathematician to find the case with highest information content. You were right to talk about information content but you did not follow your idea through to a workable solution. If you knew more about transreal and transcomplex arithmetic you might be able to do this for yourself.
By the way, you forced finite solutions when you specified ax^2 + bx + c = 0. This is the canonical form only of finite quadratics. For example, ax^2 = bx can have non-finite solutions x = 1/0 = infinity and x = 0/0 = nullity but it cannot have the solution x = -1/0 = minus infinity. There is information content even in the non-finite cases, here x /= -1/0.
The mathematics you use is partial and has infinitely many error states. The transmathematics I use is total and has no error states. This gives me many mathematical, practical and commercial advantages. I would be surprised if you resist the removal of infinitely many error states from mathematics but, if you do, why?
I have implemented transreal and transcomplex arithmetic in Pop11. It runs on my laptop which I bring to many Geek nights. I'll bring it along specially if you ask. I will have it with me tonight.
Overflow and underflow are easy. Round off in the same way that IEEE float does and track the occurrence of roundoff in an inexact flag.
Feel free to talk to me about this. That's what intellectuals do. They debate.
Best wishes,
James
James Anderson
Sadly the absence of error states in transarithmetic does not stop people making arithmetical mistakes. Can you spot the sign error in the above argument?