Skip to main content

Now what was 2 + 2 again?

If there's one thing we expect it's for computers to be able to add numbers up and get the right answer. It's their forte. They aren't so good at (say) writing novels, winning the X-Factor or developing a new scientific theory, but they really are hot on sums.

This is such an obvious reality that it got me on the BBC consumer programme Watchdog in my (relative) youth. I ought to stress I was not there as a dodgy dealer, or a dubious salesman, but rather as an expert to make tutting noises about the spreadsheet on a Psion pocket computer, which had a bug that made it capable of producing basic arithmetic errors. Being Watchdog, they couldn't just interview me - I had to go to what was then a trendy location - a cyber café in London. The two main things that stick in my mind about my first ever TV interview were that they were unspeakably patronising about their audience, and they were tight.

Bearing in mind they were expecting me to travel all the way to London just to be interviewed, I assumed they would pay first class rail fare. They did (grudgingly), but muttered that they normally only pay second. As for their audience, they said to me something to the effect of 'Don't use any technical terms or hard words. You have to remember, our audience is mostly housewives.' I suspect that this particular producer is no longer with the BBC.

However, the issue was a real one, if quite rare. Spreadsheets tend not to make basic adding errors with whole numbers. Yet when we get to decimal places, there is a need for care. Because if you aren't dealing with whole numbers, there will have to be some assumptions about how the numbers are handled in the limited space available. (That's the wonder of a quantum computer, which isn't limited to a finite decimal expansion - but that's a different story.) What this means is that you can get calculations where the order in which you make a step will change the final value, even though in pure mathematical terms, it shouldn't. It's usually with more complicated equations than this, but what we're saying is that A+B is not necessarily exactly the same as B+A.

Luckily there is a group poised like a mathematical equivalent of Superman to leap high problems at a single bound and to smash the incompetance of computer calculations. Called the Numerical Algorithms Group, it specializes in providing solutions to numerical nasties. You'll find a paper on computers getting sums wrong here (it's a trifle dated at 10 years old - certainly the (5.01+5.03)/2 problem it mentions doesn't challenge Excel) and a whole host of articles here.

As a writer, if I'm honest, I don't have anything more challenging to do numerically than to work out the VAT (and it's surprising how often other people make rounding errors in this), but for those with a more numerically-based discipline, the NAG is well worth knowing about.

The picture, incidentally, is (part of) Babbage's difference engine. This was really more a mechanical calculator than a computer, and Babbage couldn't manage the precision engineering to build it - the version shown was built by the Science Museum for a Babbage anniversary.

Comments

  1. My fear and consequent awe of numbers has been a constant companion, with the emphasis on the fear. Alas, this doesn't help much to make me feel any more comfortable around them. Thanks anyway for the reality check, though.

    ReplyDelete

Post a Comment

Popular posts from this blog

Why I hate opera

If I'm honest, the title of this post is an exaggeration to make a point. I don't really hate opera. There are a couple of operas - notably Monteverdi's Incoranazione di Poppea and Purcell's Dido & Aeneas - that I quite like. But what I do find truly sickening is the reverence with which opera is treated, as if it were some particularly great art form. Nowhere was this more obvious than in ITV's 2010 gut-wrenchingly awful series Pop Star to Opera Star , where the likes of Alan Tichmarsh treated the real opera singers as if they were fragile pieces on Antiques Roadshow, and the music as if it were a gift of the gods. In my opinion - and I know not everyone agrees - opera is: Mediocre music Melodramatic plots Amateurishly hammy acting A forced and unpleasant singing style Ridiculously over-supported by public funds I won't even bother to go into any detail on the plots and the acting - this is just self-evident. But the other aspects need some exp...

Murder by Candlelight - Ed. Cecily Gayford ***

Nothing seems to suit Christmas reading better than either ghost stories or Christmas-set novels. For some this means a fluffy romance in the snow, but for those of us with darker preferences, it's hard to beat a good Christmas murder. An annual event for me over the last few years has been getting the excellent series of classic murderous Christmas short stories pulled together by Cecily Gayford, starting with the 2016 Murder under the Christmas Tree . This featured seasonal output from the likes of Margery Allingham, Arthur Conan Doyle, Ellis Peters and Dorothy L. Sayers, laced with a few more modern authors such as Ian Rankin and Val McDermid, in some shiny Christmassy twisty tales. I actually thought while purchasing this year's addition 'Surely she is going to run out of classic stories soon' - and sadly, to a degree, Gayford has. The first half of Murder by Candlelight is up to the usual standard with some good seasonal tales from the likes of Catherine Aird, Car...

Is 5x3 the same as 3x5?

The Internet has gone mildly bonkers over a child in America who was marked down in a test because when asked to work out 5x3 by repeated addition he/she used 5+5+5 instead of 3+3+3+3+3. Those who support the teacher say that 5x3 means 'five lots of 3' where the complainants say that 'times' is commutative (reversible) so the distinction is meaningless as 5x3 and 3x5 are indistinguishable. It's certainly true that not all mathematical operations are commutative. I think we are all comfortable that 5-3 is not the same as 3-5.  However. This not true of multiplication (of numbers). And so if there is to be any distinction, it has to be in the use of English to interpret the 'x' sign. Unfortunately, even here there is no logical way of coming up with a definitive answer. I suspect most primary school teachers would expands 'times' as 'lots of' as mentioned above. So we get 5 x 3 as '5 lots of 3'. Unfortunately that only wor...