Sunday, 17 November 2013

Highlights from MathsJam

It's already two weeks since the wonderful MathsJam conference: once again the most exciting maths event of the year.  I'm sorry that it has taken me so long to post about it.  There is so much I could write about from the talks and conversations - a number of unusual proofs of Pythagoras's Theorem, various interesting games, some nice problems, lots of ideas.

Here are just three outstanding memories:

  • Tarim's demonstration of the Dr Nim mechanical robot from the 1960s which plays a version of Nim's game perfectly.  This was particularly timely: Dr Nim will feature in my talk at the Science Museum Lates on the evening of 27 November.
  • Derek Cozens showing how to tie a tie one-handed.  i didn't manage to do it - but perhaps with some practice...
  • Pedro Freitas's demonstration of how to untangle a braid with a clever use of rational numbers
I intend to write a further post about Dr Nim when I have more time.

Sunday, 27 October 2013

Maths Education and Unintended Consequences

I should emphasise that this post expresses only my own personal views.

That policy decisions can have unintended consequences is well illustrated by events in maths education in England over the last fifteen years.

First, the introduction of Curriculum 2000 created a modular A-level syllabus in which AS-levels became stepping-stones on the way to the full A-level.  In principle I think this was a thoroughly good thing.  But it had a disastrous effect on mathematics in higher education.  With module exams a few months after students had moved from GCSE into A-level study, the gulf proved too great, AS-level results were spectacularly awful, the number of students taking A-level maths plummeted because potential candidates were discouraged by their results at AS-level, schools and colleges advised students not to study maths post-GCSE, applications to study maths at University dropped substantially, and University departments closed because they could not recruit enough students to be viable.  It took a decade for mathematics in higher education to recover.

There was also the unintended consequences of the GCSE data-handling coursework.  The country needs more statisticians, and it needs citizens with basic understanding of descriptive statistics.  So the introduction of a significant statistical assignment - the data-handling coursework - was largely welcomed by the statistics community.  It would give students more knowledge of this important subject and encourage more to study statistics at university.

But it didn't work out that way.  Students found the coursework time-consuming and tedious.  It put them off statistics!  Numbers taking statistics at university, whether as a subject in itself or as an option in business or science degrees, fell as a result.  University statistics departments have shrunk.  The GCSE data-handling coursework did a huge amount of damage to statistics.

As another example, consider the inclusion of mathematics GCSE in the government's schools league table data for five GCSEs at grade A-C.  The maths community was delighted when the old league table measure, just the proportion of candidates getting five A-C grades regardless of subject, was changed to require that the five GCSEs must contain Maths and English.  The feeling was that this would lead schools to put more effort into Maths GCSE.  But a consequence has been that many schools have been putting their students in for maths GCSE as early as year 9, and at every opportunity thereafter until they get the C pass, even if they have not covered most of the curriculum.    If a student can scrape enough marks for a C, they then drop the subject so that they can focus on the other GCSEs: so they may never cover a large part of the GCSE curriculum.  This is extremely damaging for students (and may have prevented many potential mathematicians from taking A-level maths).  Fortunately the government has now acted to prevent this abuse, but it is another example of unintended consequences.

So with this history of apparently desirable initiatives having adverse outcomes, I am nervous about the proposal for a new maths qualification for 16-18-year-olds.  Like many others, I believe the more maths people study, the better; I regret the English system which means that so few students study mathematics post-16; and I welcome the opportunity to allow post-16 study of mathematics for those who will benefit from a less intensive course than A-level (such as those who did not obtain A* or A at GCSE but who have the potential to gain from developing further mathematical understanding).

But there are dangers.  Where are the teachers going to come from?  Will resources move from A-level teaching to the new exam?  Worse, will students who would otherwise have taken A-level maths prefer the less intensive course?  Could the new mathematics exam lead to another drop in A-level numbers and impact on further study?  Are some of the potential top mathematicians of the future going to find themselves unable to study maths at university because they made a poor decision, or their school or college advised them badly, at 16?

The new maths exams should provide an opportunity for many to gain useful training in a subject that will benefit them throughout their lives.  But, once again, there is potential for unintended consequences which could damage maths education in England.

Friday, 30 August 2013

Two simple maths / cricket problems inspired by Aaron Finch

Aside: To comment on my recent Gresham College lectures please go to this blog entry. My most recent Gresham College lecture was on Monday 15 April.  I talked about proof, by human and by computer.  The lectures can be viewed on the Gresham College website.


These problems were inspired by Aaron Finch's great innings last night.  Apologies that some knowledge of cricket is required.

In a Twenty20 match Australia bat first and score 261.  England's openers are A and B, who are both remarkably consistent.  A plays every ball he faces for 3, while B scores 2 off every ball he receives.  In an equally unrealistic manner, the Australian bowlers never bowl no-balls.

So the openers score an average of 2.5 runs per ball, and therefore over 20 overs England will expect to score 300.  But after how many balls will England win the match?

Second problem: Unfortunately England's top batsman, A, is unavailable for the next match and is replaced by C, who scores a single run off every ball he faces.  Clearly a loss of two runs per ball will make a big difference to England's total score.  How many fewer runs will they make off 20 overs when C, rather than A, opens the batting with B?

Aaron Finch
(Photo by Supun47 from Wikimedia Commons)

These questions were motivated by the observation that Finch faced more than his fair share of the bowling last night.  So was luck a factor in his making such a high score?  No, it wasn't, because a batsman who is scoring lots of boundaries will have much more of the strike than a batsman scoring in singles!

Sunday, 14 July 2013

The game theory of Jane Austen

Aside: To comment on my recent Gresham College lectures please go to this blog entry. My most recent Gresham College lecture was on Monday 15 April.  I talked about proof, by human and by computer.  The lectures can be viewed on the Gresham College website.


One of the most unexpected maths book titles of the year has to be Michael Suk-Young Chwe's Jane Austen, Game Theorist (published by Princeton).  For those of us who think of Jane only as an author of novels in which young men rip their shirts off and jump into pools, the idea that her fiction a systematic exploration of game theory comes as a bit of a surprise.

I haven't yet read more than a few pages of Chwe's book, which looks fascinating.  He is (I am sure) not arguing that Austen based her novels on pay-off matrices and Nash equilibria, but rather that she shows an intuitive understanding of the strategies that game theory proposes.

From one point of view this isn't really surprising.  Austen is (despite my crass characterisation of her fiction above) an astute observer of people.  Game theory describes ways in which people can play situations to their advantage, and one would expect an observant novelist to show this kind of understanding.  You don't need to write down numbers to use game theory effectively!

One of the problems with finding applications of mathematics in the real world is that maths is so effective.  The maths of differential equations can predict accurately where a thrown stick will land, but that does not mean that a dog which catches a stick is using maths in any meaningful sense.

Suppose that (as some suggest) the most pleasing ratio of length to height of a rectangle is the golden ratio.  Then an artist with a feel for beautiful design will naturally draw rectangles in this proportion, regardless of whether or not they are aware of the mathematics of the golden ratio.  So the appearance of golden rectangles in great art, while it might confirm the aesthetic judgment, does not demonstrate any intentional use of the mathematics in the painting.  Similarly, the discovery that some scenes in great novels can be expressed in game-theoretical terms is amusing and instructive, but doesn't necessarily indicate that the author had anticipated twentieth-century mathematics.

This is not intended in any way as a criticism of Chwe's book, which seems particularly interesting because his introduction argues that Austen's exploration of strategy is deliberate, systematic and methodical.  I'm looking forward to finding out whether I am convinced!

Sunday, 9 June 2013

What comes next in this sequence?

Aside: To comment on my recent Gresham College lectures please go to this blog entry. My most recent Gresham College lecture was on Monday 15 April.  I talked about proof, by human and by computer.  The lectures can be viewed on the Gresham College website.

Here's something which I found (presented in a different way) in a nice book by Anany and Maria Levitin, Algorithmic Puzzles (Oxford University Press, 2011).

Answers to all puzzles appear at the foot of the blog.

What is the next number in this sequence?

Puzzle 1: 
 1, 2, 3, 5, 7, 11, ... ?

The answer will come at the foot of this post, but think about it first!

What makes puzzles like this interesting?  They occur in IQ tests and psychometric tests which supposedly measure one's aptitude for a job.  But they are problematic.  If I were to ask a twelve-year old, "What comes next in the sequence 1, 2, 4, 8, ...?" I would expect the answer 16 - these are powers of 2.  If I were to ask a class of maths undergraduates, that answer would be too obvious - why would I be asking such a simple question - so they might deduce that something else was expected.  

Puzzle 2:
1, 2, 4, 8, ...?

So it is unlikely that the answer to Puzzle 1 is simply 13, as if I was listing the primes and forgot that 1 is not a prime.

Here's another one, but don;t waste time on this one:

0, 4, 4, 8, 10, 9, 11, 15, ?

Well, even the wonderful On-Line Encyclopedia of Integer Sequences can't solve this one!  In fact these were the waiting times in minutes listed on the electronic display for the arrivals of the next ten buses when I arrived at my local bus stop yesterday evening.  The next two numbers were 18 and 18.  But this sequence was essentially random and it has no interest as a puzzle.

When I learned at school that you can fit any set of n data points by a polynomial of degree n-1, it seemed to make sequence questions trivial.  A natural answer for a mathematician would be simply to fit the polynomial of least degree so that, for example, to find the next term in the sequence "1, 2, 4, 8 ..." I would just find the quadratic equation that goes through the points (1,1), (2,2) and (3,4) .  It is (1/2)s^2 - (1/2)x + 1, which gives us 7 for the fourth term in the sequence.

But this has no predictive power whatsoever, because for any possible numerical value of the next term, there is a polynomial equation that fits it.  If, at the beginning of next season, I record the number of goals scored by my football team in their first 5 matches as 0, 0, 0, 0 and 0 (which is not unlikely), I might take comfort from the fact that the formula (n-5)(n-4)(n-3)(n-2)(n-1) has successfully predicted the goals in the first five matches and that therefore I can expect my team to score 120 in their sixth match.  But the existence of the formula is proof only of the power of mathematics in representing data.

So if there are formulae which can represent any sequence and suggest any term I like for the next one, what is the interest in these questions?  In "intelligence" tests, I would argue that they are often testing simply testing your understanding of the context: any answer can be justified but the "correct" answer is the one that the setter had in mind, and your task is to work out what kind of answer is expected.  A mathematically over-sophisticated answer fails the test, which is about your ability to fit in as much as it is about mathematics.

But as a puzzle, if I ask a colleague or a student for the answer to Puzzle 1 or Puzzle 2, the whole point is that the answer is not the most obvious one (primes or powers of two).  It's a sort of mathematical joke: the recipient is not expected to get the answer, but will be amused when they hear it.  The joke is that the same initial sequences arise in very different contexts.  Before I give solutions, here's one more, which is based on what I was once told is Whitfield' Diffie's favourite sequence puzzle.

Puzzle 3: What comes next in this sequence:
138, 125, 116, 110, 103, 97, 86, 77, 68, 59, 51, ?

The Encyclopedia of Integer Sequences won't help with this one either.

Solutions follow:

Solution to Puzzle 1: There are no more numbers in this sequence. These are related to McNugget Numbers - McDonalds' Chicken McNuggets are sold in boxes of 4, 6, 9 and 20.  You can order any number of McNuggets by choosing suitable combinations of boxes, except for 1, 2, 3, 5, 7, 9 and 11.   (Wikipedia's discussion of McNugget Numbers excludes boxes of 4, which are perhaps only available in the UK.  As a vegetarian, I do not have first-hand knowledge here.)

Solution to Puzzle 2: 15.  The number of ways you can cut a cake with n cuts (in three dimensions,without rearranging the pieces between cuts, and assuming, rather unrealistically, that the cuts are perfect and don;t create extra pieces in the form of crumbs) goes 1, 2, 4, 8, 15, 26, 42, 64, ... (See the Encyclopedia of Integer Sequences)

Solution to Puzzle 3: Grand Central Station.  The terms of the sequence are consecutive stops on the New York Subway, Line Four (Check here!).

Sunday, 12 May 2013

My favorite equation

Aside: To comment on my recent Gresham College lectures please go to this blog entry. My most recent Gresham College lecture was on Monday 15 April.  I talked about proof, by human and by computer.  The lectures can be viewed on the Gresham College website.


I have been reading William Poundstone's excellent book about the interview questions asked by Google, Microsoft and co, Are You Smart Enough to Work at Google?  Amongst many others, he discusses how a candidate should answer the question "What is the most beautiful equation you have ever seen?"

For me, and I suspect a great many mathematicians, the natural answer is "Euler's formula e^i.pi+1=0" (which is much more beautiful when properly set out!)  (This is the special case of Euler's more general formula for e^ix.)  Why do we like this equation so much?  Well, first because it is astonishing.  I don't have any natural intuitive understanding of what it means to raise a number to an imaginary power, but this equation shows that doing so is amazingly powerful.  This equation demonstrates the relevance of "imaginary" numbers to the real world.  Who would have thought in the sixteenth century that imaginary roots of negative numbers could lead to the incredible developments in our understanding of the universe exemplified by Schrodinger's Equation, for example?  (Even if I'm not sure "understanding" is the right word when one is talking about quantum theory!)

Euler's equation is remarkable because it involves five very special numbers, zero, one, i, pi and e, and it includes  the fundamental mathematical operations of addition, multiplication, exponentiation as well as the notion of equality.

So is Euler's formula my favourite?  Well, some of my favourites change over time.  Is my favourite composer Bach, Schubert, or Monteverdi?  At different times I would have answered any of these, and it depends on my mood (as well as who's performing).  On the other hand, I can't imagine ever changing my favourite football team, however depressing their results (and I fear that the Pars' sensational 6-1 win yesterday in the relegation / promotion play-off semifinal has just set us up for greater disappointment in the final).  I feel that Euler's as favourite equation is probably more permanent than Schubert but may be less lifelong than my love for the Pars.

But apparently Euler's is not the right answer for Google - it's not original enough.  (Understandably.)  So i wanted to be provocative I'd have to give another favourite equation.  And I think I might put forward John McKay's equation.  Here is the equation, written by McKay himself in my visitor's book.  

McKay's equation

So what is this about?  The equation 196884 = 196883+1 is certainly plausible, but why is it any more interesting than any other trivial arithmetic sum?

Well, McKay works on sporadic simple groups, the existence of the largest of which, the Monster, was conjectured in 1972 and confirmed in 1980.  The smallest non-trivial irreducible representation of the Monster has degree 196883.  McKay's wife works in the area of modular forms (a quite different area of mathematics) and McKay happened to see that she had written down an equation which included the coefficient 196884.

McKay thought the similarity of the two numbers could not be coincidental.  It turns out that the other coefficients in the elliptic modular function also relate to the representations of the Monster.  McKay's observation has led to the discovery of very deep (and very obscure) connections between apparently totally different branches of mathematics.  This whole area has been given the evocative name "Monstrous Moonshine".  It's much too difficult for me, but I believe considerable progress is being made, although at the time he wrote his formula in my visitor's book, McKay told me that he thought it likely the matter will never be fully understood - there being little likelihood of anyone ever having deep enough knowledge of both of these two subjects to be able to investigate the connection.

So McKay's formula may not be as immediately beautiful as Euler's, but it has something of the same spirit (and perhaps even importance).  It demonstrates a very deep connection between group theory and modular forms; it's mysterious and hard to understand, and it's inspiring important mathematics.  And it says a lot about the serendipity which lies behind insights even in a subject as apparently logical and rigorous as mathematics.   If I can't use Euler's equation then when Google ask me this question I'll go for McKay.

Wednesday, 3 April 2013

A book which changed my view of linear algebra

Aside: To comment on my recent Gresham College lectures please go to this blog entry. My most recent Gresham College lecture was on Monday 15 April at 6pm at Barnards Inn Hall, near Chancery Lane tube station, central London.  I talked about proof, by human and by computer: all readers of this blog are very welcome.  The lectures can be viewed on the Gresham College website.


(Just in case any of my students are reading this: just because I didn't use to much like linear algebra doesn't mean you won't!)

When I was an undergraduate I wasn't very excited about linear algebra.  It was worthy stuff, but it wasn't as attractive as group theory and combinatorics were.  Even when I was employed to write mathematical modelling software and relied heavily on matrix methods, I felt the applications of linear algebra were useful but not really very interesting.  Even when the founders of Google have made millions by exploiting the Power Method, I still found it hard to be wildly enthusiastic about this (very important) area of mathematics.

But I have just read a wonderful book which has changed my mind completely.  It's Jiri Matousek's Thirty-three Miniatures: Mathematical and Algorithmic Applications of Linear Algebra.

Thirty-three Miniatures book cover

The book consists of (you've guessed it!) thirty-three chapters, generally of four to six pages, each describing an entertaining problem which can be solved by linear algebra.  The applications are staggering - this isn't boring applied mathematical modelling or billionaire-making search engines, but REAL mathematics - combinatorics, geometry, coding, probabilistic algorithms.

For example: we begin by finding the formula for Fibonacci numbers.  We show that there are no four points in the plane such that the difference between any pair is an odd integer.  We learn about turning ladders around in a finite field.  We have the wonderful matrix-tree theorem which counts the spanning trees of a graph. There is the wonderful account of the information that can be transmitted by a secret agent whose only means of communication is to choose the colour of umbrella he uses each day, to be photographed by a satellite which can't tell the colours apart.   And my favourite - how do you tell whether a given binary operation on n objects is associative?  It appears you have to test n cubed cases.  Even if you only want a probabilistic answer, sampling doesn't appear to help us much: if the operation has one non-associative triple, you have to sample half the triples to have an even chance of detecting the offending triple.  But no - there is an ingenious algorithm which does very much better.

The amazing thing for me is that we are using linear algebra in all these diverse areas of pure mathematics where its relevance seems quite unexpected.  This is a sensational book!

Sunday, 3 March 2013

Advancing Women in Mathematics

Aside: To comment on my recent Gresham College lectures please go to this blog entry. My next Gresham College lecture is on Monday 15 April at 6pm at Barnards Inn Hall, near Chancery Lane tube station, central London.  I will be talking about proof, by human and by computer: all readers of this blog are very welcome.  The lectures can be viewed on the Gresham College website.

On Wednesday 27 February the London Mathematical Society launched a report "Advancing Women in Mathematics".  There are too few female mathematicians.  While this may be because women are too sensible to want to do mathematics, I believe that mathematics has enriched my life and given me opportunities and I am dismayed that these benefits are being taken up in the UK largely by representatives of only one half of the population.  Only 6% of professors of mathematics in the UK are women.  (Most other countries do a lot better.)

There are some promising signs.  There are now sufficiently many successful mathematicians to show conclusively that women can do mathematics at the highest level. But they face obstacles.  Chris Good and I recently did a project about "Being a Professional Mathematician", which produced resources including interviews with mathematicians, and the interviews with Gwyneth Stallard and Sue Merchant, in particular, have interesting insights into their lives as female mathematicians.

Women now make up 40% of undergraduate mathematicians (and were a slightly smaller proportion of the speakers at the recent undergraduate conference Tomorrow's Mathematicians Today).  But the proportion of women in mathematics drops as one lists PhD students, postdocs, academics and professors.  Even 40% of undergraduates could be seen as a rather disappointing proportion when more women than men go to university.

The LMS report contains useful examples of initiatives and actions which may help.  The LMS and its excellent Women in Mathematics Committee is to be congratulated for so publicly raising this issue and for its commitment to improving the situation.

Sunday, 17 February 2013

Tomorrow's Mathematicians Today 2013

(To comment on my recent Gresham College lecture please go to this post.)

TMT 2013 Conference Logo

Yesterday the University of Greenwich hosted the second UK conference for mathematics undergraduates. Tomorrow's Mathematicians Today 2013.  (The first TMT was also held at Greenwich, in 2010.)  About 150 students attended, and there were 30 student speakers from 15 different universities, as well as an excellent keynote address by Robin Wilson.  The conference was sponsored by the Institute of Mathematics and its Applications, GCHQ (a big employer of mathematicians) and the publishers Taylor and Francis, and the OR Society was also present.

I thought it was a wonderful day.  (The programme and abstracts can be found on the conference website.)  The atmosphere was remarkable - friendly and supportive of the speakers.  The contents of the talks varied enormously.  Some students were simply telling us about mathematics that excited them: others were reporting on their own original individual or collaborative work.  Some talks were relatively elementary, others sophisticated.  But there wasn't a single dud in the sessions I attended.  (Sadly, with parallel sessions, one couldn't attend all the talks.)  

In the first morning session I learned about applications of category theory in computer science, "funny functions" which show up misconceptions and misintuitions in analysis, and the applied group theory of "speedcubing" - how to find the most ergonomically efficient ways to solve Rubik's cube quickly.  Later in the morning I attended talks on Shor's algorithm and the threat quantum computers pose to conventional cryptography, and Conway's Angel and Devil game on an infinite chessboard - a simple game which took thirty years to solve.

In the afternoon I heard three fascinating talks about applications of mathematics in biology and medicine - the strengths and weaknesses of models in epidemiology and in the study of how bacteria move - and about financial mathematics and students' perception of GCSE mathematics.  The afternoon ended with Robin Wilson's keynote talk about Euler's life, labours and legacy.  The audience was enthusiastic throughout.  

The prize for the best paper, sponsored by GCHQ, went to Jason Young of Cardiff University for his talk on "Understanding the Effect of Individual Behaviour in Hierarchical Queues" - about how individuals' selfish or unselfish behavour affects queuing times for everyone.  It was an excellent example of interdisciplinary work with real practical consequences leading to insights which might, for example, reduce waiting times for medical treatment.

It was a wonderfully stimulating day. I am sure I am not the only person there who found myself unusually exhausted early last evening.  Thinking about mathematics, even as enjoyably as yesterday, is hard work!

Sunday, 10 February 2013

Are mathematicians and artists opposites?

(To comment on my recent Gresham College lecture please go to this post.)

A newspaper feature today ("My funny Valentine: Do opposites really attract?" in the Independent)
presents as its prime example of the attraction of opposites a couple com[prising an artist and a mathematician.

Are mathematicians and artists really opposites?  I know many mathematicians and artists who get on.  Why wouldn't they?  Both professions require creativity, thinking for oneself, a willingness to challenge (or at least test) received opinion, perseverance in the face of difficulty, preparedness to wait for inspiration, and integrity.  And sometimes, perhaps, occasional use of drugs for stimulation (the drug for choice of mathematicians being coffee, and the use generally rather more than occasional.)

The public perception that mathematics is routine drudgery should be challenged!  Mathematicians and artists have a lot in common.

Sunday, 3 February 2013

Gresham College Lectures

On Monday February 4th, I gave the first of a series of three free public lectures on computng and mathematics at Gresham College, Barnards Inn Hall, Holborn, Central London.  Any reader of this blog is welcome to attend these lectures.

The first lecture was entitled  "Arithmetic by Human and Arithmetic by Computer".  Video and audio recordings are available at the Gresham College website.   This lecture featured some cool tricks for doing arithmetic, a performing monkey and brilliant Scottish inventions.

The second lecture was "How Computers get it Wrong: 2+2=5".  Video and audio recordings are now available at the Gresham College website.  This lecture discussed different kinds of computer error.

The third lecture will be given at Gresham College (Barnards Inn Hall, Holborn, central London) on Monday 15th April.

Please post any comments or questions about the lectures as comments on this blog post.

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!