Sunday, 27 January 2013

Maths and arrogance

Earlier this week a popular-science Facebook page posted a letter apparently from a schoolteacher to a pupil's parent complaining about the pupil questioning the teacher's assertion that a kilometre is longer than a mile.  The teacher felt that even though he was wrong he should not have been questioned by a student.   This brought back memories of a similar occasion in my youth (when, on my parents' insistence, I privately asked my teacher whether she had meant "Fahrenheit" when she said the average summer temperature in Nebraska is 95 degrees Centigrade, and was roundly abused for my temerity.)   Others have reported similar experiences.  Being told "You mustn't question me - I am a teacher" is something many people seem to remember.

I find this baffling.  Teachers may say all sorts of things under stress, but in some of the cases cited there was no excuse.  I hope times are now more enlightened.  Children have to learn that everybody gets things wrong sometimes, and that when you make a mistake, it's best to admit it and learn from it.  Authority should be questioned when necessary.  The way to respond to a challenge is to show that the challenge is wrong. Someone who forbids questions should not expect to be believed.  Even in primary school, I don't think there is a good argument for saying children should not question a statement that they think is wrong.

I do remember one very distinguished mathematician responding angrily to a question in a postgraduate lecture.  We were all puzzled by a definition, so a friend of mine asked "Why have you defined that in this way?"  The lecturer's response was "Because it bloody well works, that's why!", which didn't help us much nor did it gain him our respect.

Despite this example, I sometimes like to think that one of the ways in which mathematics is good for the soul is that studying mathematics gives excellent protection against arrogance.   It's hard to take oneself too seriously when there are simple problems, like saying whether every even integer is the sum of at most two primes, which one cannot solve.  Mathematics is not a subject in which one can fool oneself into over-estimating one's abilities: there is always a reality check.  I might mistakenly believe that my poem is an unprecedented masterpiece but I know that my proof of the Twin Primes Conjecture doesn't stand up.

I'm probably wrong, but I feel that if mathematicians ruled the world, they wouldn't have the over-confidence to lead us into unnecessary wars.  Self-questioning and self-doubt should be encouraged (unless you're a sportsman!)

On Monday 4th February I am giving the first of three free public lectures on computing and mathematics at Gresham College, London.  Readers of this blog are very welcome!

Wednesday, 16 January 2013

A well-willer to the Mathematicks

I have just read Benjamin Wardhaugh's fascinating book Poor Robin's Prophecies: A curious Almanac, and the everyday mathematics of Georgian Britain (Oxford).  It is a fascinating account of popular mathematics during, essentially, the long eighteenth century, based on a comic almanac "written by POOR ROBIN Knight of the Burnt-Island, a well-willer to the Mathematicks", first published in 1663 and which lasted - latterly as Old Poor Robin - till 1828.  Poor Robin's almanac contained parodies, as well as standard almanac information, and Wardhaugh uses the almanac and other popular publications to explore the uses of mathematics over a period when it was, for some, a means to social advancement or a route into a career, and when sophisticated mathematical problems appeared in publications like The Ladies' Diary.

Does spirit of Poor Robin of Saffron Walden (for the meridian of which the original almanac was calculated, according to its title-page) survive today?  I think Poor Robin's attitude to mathematics can be found in TV shows like Dara O Briain's School of Hard Sums and in the mathematical jokes and puzzles which seem to achieve a wide circulation on Facebook (and, if my Facebook stream is typical, are appreciated and reposted by many who have no particular mathematical background).  Wardhaugh's book reminds us that the value of mathematics has always been questioned, but that even so there has always been popular interest in all kinds of mathematics: both traits are evident today!

Sunday, 6 January 2013

Computer chess and human error

When I was a teenager I was a keen chess player, and when I discovered the joys of programming a computer I was naturally interested in how computers could be programmed to play chess.  This was in the days before PCs, the mid 1970s, when computer time was a rare resource, and when the possibility that a computer could beat a good human chess player seemed at best a long way away.

It was also a time when the less perspicacious of us, like me, believed that playing chess was a serious test of computer power; a demanding human activity which was a pinnacle of intelligence.  Now, of course, we realise how much more difficult it is to programme a machine to recognise faces or interpret speech or read handwriting, and other activities which are very difficult for a computer but which human beings do automatically.  (Well, I am embarrassingly bad at recognising faces, as it happens!)  Of course, in his seminal paper 'Computing Machinery and Intelligence' Alan Turing had actually included solving a chess problem as a suitable task for a potentially intelligent computer, but he had, with is usual perceptiveness, also included writing poetry.

Anyway, in the 1970s we seemed a long way away from computers being able to play chess at the top human level.  Indeed, the Scottish chess player David Levy made, and won, a series of bets against proponents of computer chess at the time that no computer could beat him.

I was delighted when I found in the university library Alex Bell's book The machine plays chess? (1978), which was a very entertaining account of our attempts to get computers to play chess.

I remember his hilarious account of an early programme, which (playing against a weak human opponent) got into a wining position.  The opponent wanted to resign when the computer got to an ending with king and two queens against king but the programmers insisted the game be played out to its conclusion.  Unfortunately, the simple way to force mate was slightly too long for the computer to calculate, so, knowing that pieces are most powerful in the centre, it moved its queens to the centre of the board.  Its strategy was essentially to keep its queens in the centre, but it knew about draws by repetition of position, so as the game continued the computer's queens gradually spiralled away from the centre, but failed to progress towards a mate.

Bell's book was very funny, and full of lessons and entertainment for any aspiring programmer, but growing computer power meant that humans were no longer unbeatable.  First, a computer beat the backgammon world champion, albeit with a huge amount of luck, and eventually in 1997 the computer Deep Blue beat the great Garry Kasparov in a best-of-six-games chess match.

Having enjoyed Bell's book so much, I was fascinated to read in Nate Silver's recent book about mathematical predictions, The signal and the noise, an account of Kasparov's defeat which presents Deep Blue's triumph as the result of a programming error!  Kasparov won the first game, but was puzzled when, in a losing position, Deep Blue chose what appeared to be an inferior move, rather than one which would seem to have held off defeat for longer.  According to Silver, Kasparov tried to work out Deep Blue's logic, and concluded that the computer was looking so far ahead that it could see that the "better" move lost just as badly as the "inferior" one.

In the second game, Deep Blue had a slight advantage.  At a key point, it could either play a move which would lead to a complex tactical situation - which one would expect to favour the computer - or one which led to a simpler game in which Deep Blue had an edge which might not be sufficient to force a win.  To everyone's surprise, it chose the latter.  In fact Kasparov had the opportunity to force a draw, but missed it.  It seems that, knowing from the first game how far ahead Deep Blue was calculating, Kasparov assumed that there could not possibly be a way for him to draw, or Deep Blue would have played the other move.  Since he assumed the game was lost, inevitably he missed the draw.

Demoralised by this defeat in the second game, Kasparov then blundered in the final game and lost the match by 3.5 to 2.5.

But according to Silver, Deep Blue's choice of losing move in the first game wasn't due to its seeing a long way ahead.  It was due to a programming error!  So Kasparov's attributed the move to deep analysis when in fact it was a simple bug in Deep Blue's programme, and this mistaken analysis of Deep Blue's abilities led Kasparov to defeat in the match.  Rather than being the triumph of the infallible calculating machine, Deep Blue's victory was due to Kasparov's very human response to a computer error!

As always, there is more to both human and artificial intelligence than a strict logical analysis appears to suggest!