Awww, look at Snoopy trying to solve a commutativity problem!

Awww, look at Snoopy trying to solve a commutativity problem!

I have been playing Snoopy Drops (スヌーピー・ドロップス), which is a cute variant of Candy Crush Saga with a deep story (Snoopy is seeking Bell). It has all the same essential properties, and a fiendishly addictive bent to it, along with a pay-for-boostups routine that must surely make it a huge money-spinner. I guess Candy Crush Saga is the same …

As I was playing it I started wondering about the patterns and structures within the game, and started thinking – is this game actually a problem in group theory? If you think of each colour of object as a group, it is largely a closed Abelian group with various operations acting within the group. Essentially, aligning the objects is like addition, but they take on special properties after some operations (yet remain within the group). Some functions apply across groups (the line-breaker objects, portrayed by the white-and-yellow-striped Woodstock in the above picture, for example, eliminate objects from as many groups as there are in the line), and the group is not convex – there are objects from other groups in between the objects of any one group. I guess this means that there is some kind of concept of a finite geometry within which the group structure operates. Hmmm … I did a brief google search on this and couldn’t find anything, but I was originally inspired to think of this by the group theoretic solution of the Rubik’s cube, which seems somehow similar (though perhaps less complex?) I found a paper, described in outline in the Daily Mail, which showed that the game might be NP-Hard, but nothing about possible group theory aspects of the game.

I wonder if the game really is NP-Hard, or if it doesn’t permit such a simplistic description, because of its stochastic properties. The classic NP-hard problem is the Travelling Salesperson Problem, but this problem has a big difference with Snoopy Drops: although the landscape of the problem may be determined randomly (e.g. by random selection of the number of cities the salesperson has to visit), it doesn’t change once the game starts. The linked paper seems to have solved the Snoopy Drops problem by drawing circuits and gates within the board, but these change with every round – I’m not sure how the mathematicians handle this. This is also true of the Rubik’s cube, which can be handed to an enterprising mathematician with its faces randomly jumbled up, but doesn’t randomly rejumble them every time you line up three squares. Also Snoopy Drops comes with multiple conditions (in the picture above there are three: the number of moves required to complete the puzzle, the number of jellies to destroy, and a minimum score to complete the level). For the Travelling Salesperson Problem there is only one condition (time required). So I suppose Snoopy Drops is actually a multiply-constrained problem in stochastic group theory (does such a field exist?).

I think we can agree that even someone as cool as Snoopy can’t fathom the maths of that! But I wonder if this group-theoretic aspect of the game is part of the reason for its addictive properties – when we solve it we are essentially attempting to intuitively solve enormously complex mathematical problems through cute visuals, and to the extent that our brains are keyed in to the way the world around us works, I think they must get some basic biological pleasure from revealing the fundamental building blocks of that world.

I also wonder, if Snoopy Drops is an NP-Hard problem, and if some very smart mathematician could find an expression for its parameters, could the distributed nature of the game mean that other complex NP-Hard problems could be solved by re-expressing them as Snoopy Drops problems, then shipping them out to thousands of players as free levels? Given the number of people playing Candy Crush Saga at any time, if someone could do that they could probably solve all the world’s existing NP-Hard problems in a weekend …

Riemann surface or Babylon 5 monster? Only a genius can tell ...

Riemann surface or Babylon 5 monster? Only a genius can tell …

Today Maryam Mirzakhani, aged 37, became the first woman ever awarded the Fields prize for mathematics, a prize that is sometimes described as the “Nobel prize of maths.” She was awarded the prize for her work on “Riemann Surfaces and their moduli spaces,” which you can look up in wikipedia but good luck with that. Riemann surfaces are a kind of manifold, which is a space that globally has a complex structure that cannot be easily described mathematically but that reduces locally to a Euclidean space. A good way to think about manifolds is as the problem of ironing your shirt. Globally, your shirt has a twisted and contorted structure which means you can’t conceive of it as a flat surface suitable for ironing; but you can fold out small sections of it into a simple plane, and iron those sections. Manifold theory is essential for higher work in physics, since quantum mechanical topology is not straightforward. The wikipedia page has some nice examples of Riemann surfaces for basic functions plotted in the complex plane (that is, a plane with complex numbers). The example for the square root function shows an application of the theory of Riemann surfaces (I think): you can plot the real part of the square root on the vertical axis, and then obtain the surface for the complex part by a simple 180 degree rotation. For the average mortal, obtaining a result like that will probably make your eyes bleed. For Dr. Mirzakhani I guess it’s breakfast reading.

Dr. Mirzakhani first came to love mathematics in Iran, where she completed high school and undergraduate studies. I find it very interesting that the first woman to win the Field’s prize was educated in a nation that we westerners consider to be very sexist, and furthermore that she comes from a middle-income country. There are nearly a billion people living in high-income, supposedly comparatively gender-equal nations, but the first female Fields prize winner comes from a middle-income country with a bad record on women’s rights. I think this is indicative of two things: first of all, Iran’s strong support of science; and secondly, the west’s overbearingly sexist attitude towards maths and science. While we in the west like to pride ourselves on the equality of the sexes, it is my opinion that attitudes towards femininity and science in the west are still very backward, and there are major cultural and institutional factors that push women away from fields that they are perfectly capable of performing well in. We also see this in the world of gaming and nerd pursuits, where women are vastly under-represented. This problem does not exist in Asia, where women are encouraged to take up scientific and nerdy pursuits. Certainly in Japan, there is no question about whether a woman could or should do mathematics – it is to be encouraged and admired, and many forms of mathematics that we in the west would consider to be “advanced” or “optional” parts of education (and therefore, through institutional and cultural pressure, tend to select men to learn) are considered an essential and basic part of a woman’s education in Japan. I see this as an Asia-wide phenomenon, and I suspect that it is true of Iran as well that women are considered capable of mathematical achievement. In this aspect of gender equality, I think the west has a long way to go.

Dr. Mirzakhani is also a sterling example of another aspect of maths education that I consider important, and that I have written about before on this blog: it depends very strongly on the attitude of your teachers, and especially on their ability to get students engaged in mathematics and to keep them trained. Dr. Mirzakhani was not originally interested in mathematics, but had her interest fired by a brother’s stories and a teacher’s encouragement. She also was not initially very good at mathematics, but stuck at it, saying:

I can see that without being excited mathematics can look pointless and cold. The beauty of mathematics only shows itself to more patient followers

It takes time and encouragement to develop mathematical skills, and teachers who ignore the slower students because they assume they lack “talent,” or who discourage certain groups or people from taking up this field, are both denying their society the chance to deepen and broaden the level of cultural knowledge of an essential discipline, and also are denying the possibility of access to a beautiful and inspirational world of thought, simply on the basis of their own prejudices. Dr. Mirzakhani obviously benefited from a series of teachers who like to inspire interest and support effort, and don’t judge their students’ potential on the basis of poor early development or gender. The world needs more teachers like those who encouraged Dr. Mirzakhani. Dr. Mirzakhani herself commented on barriers to entering and staying in mathematics earlier this year, suggesting that they are not being lowered:

The social barriers for girls who are interested in mathematical sciences might not be lower now than they were when I grew up. And balancing career and family remains a big challenge. It makes most women face difficult decisions which usually compromise their work

Hopefully this award will be another small step to breaking down some of those social barriers, and encouraging more women into mathematics.

The Guardian article on Dr. Mirzakhani also contains a very nice and powerful quote from another Fields prize winner, Manjul Bhargava:

The mathematics that has been the most applicable and important to society over the years has been the mathematics that scientists found while searching for beauty; and eventually all beautiful and elegant mathematics tends to find applications

I think the importance of beauty and aesthetic sense in driving discoveries in mathematics and physics is often understated, but when you listen to mathematicians and physicists talk it is clear that it is a really important part of how they conceive of problems and solutions. There is an unexpected and deep relationship between our sense of symmetry and beauty, and the deep truths of the natural world. This is also the reason that people who understand mathematics find it so compelling and almost mystical in its beauty, and why I think it is not just an issue of shrunken talent pools when some groups of people are prevented from fully enjoying this field – they are being held back from being part of something truly profound. It’s good to see that whatever barriers still exist for women entering mathematics in Iran or the west, Dr. Mirzakhani was able to overcome them and join this small group of people peering into the deep mysteries of our universe.

We should have seen this coming...

We should have seen this coming…

Today I stumbled on a discussion of a cute little modeling paper, that opened my eyes to a whole world of modeling I didn’t know was happening. The discussion was at the blog Resource Crisis, and it concerned a paper which uses a relatively simple predator-prey model (a Lotka-Volterra model, in other words) to model civilization collapse. The paper can be read here. Apparently it caused a bit of a stir, attracting a write-up in the Guardian and subsequent controversy for having been called a NASA-funded study. The model in the paper has been derided by some as just another piece of Malthusian silliness, but the really interesting aspects of the model arise from the model processes where it does not predict Malthusian outcomes: instead, under some conditions, this model predicts civilization collapse without exhaustion of natural resources, i.e. the social structures in this model bring about collapse without necessarily exhausting resources. This arises from social inequality in the model, in which a small class of elites live parasitically off  of a large population of labourers. Some commentators have related the model to global warming (see e.g. the picture in the Guardian article) but I don’t think the model is intended to talk about this. It appears from discussion within and outside the paper that the main interest is in modelling civilization collapses of the past which came about despite abundant wealth and resources: especially, Rome and the Mayan empire.

The model is a fairly simple one and the paper relatively easy to read, along with a very large number of references to similar work in the field. The basic idea is to set out two resource stocks, one natural and the other accrued as time passes. Nature regenerates at a fixed rate, and the human population is assumed to have a carrying capacity above which it is no longer sustainable, but unlike in classic predator prey models with a carrying capacity, humans can live off their accrued wealth when they pass the carrying capacity. Wealth is built by one class of humans (called “commoners” in the model paper) but the wealth is controlled by another, smaller class, called “elites.” These elites give the commoners a subsistence level of wealth, and retain the remainder. Mortality among humans is set by a base rate that modifies according to whether the population is above the carrying capacity threshold, and by access to wealth. Mortality reaches its maximum once wealth is exhausted, but the thresholds for mortality to begin increasing are different for commoners and elites, and they have different consumption rates. Basically the model assumes a fairly nasty imperial society, in which elites control wealth and ensure that once past the carrying capacity it is the poor who suffer first.

The authors then divide societies into three types: Egalitarian, in which there are no elites; Equitable, in which there are elites but equal consumption rates; and Inequitable, in which the elites have different consumption rates. The first two societies suffer collapse, but generally only through resource depletion. The interesting situation is what the authors call “Type-L collapse,” wherein the population of commoners dies out, wealth stops being produced, and then the elite population collapses, even though natural resources have not been depleted. This is visible in Figure 6a of the paper, and leads to an interesting scenario in which natural resources recover but neither population does. This, the authors argue, is a replication of the Mayan collapse. The authors also point out that this collapse happens when the society is at the peak of its wealth and power, and the elites are still growing in size. There is a period of plateauing total wealth, in which the amount of wealth created and consumed are equal. The charts in the paper show net wealth, but of course from the perspective of the people within the society wealth would appear to be growing, since an increasing population of elites consuming wealth at 100x the rate of the commoners must mean that gross wealth (before consumption effects) is growing rapidly. So from within society it looks like a period of unparalleled success and wealth, but it is actually the beginning of the end.

I was struck by the thought that this may already be happening in some countries not through death but through emigration. Thinking of the state of emigration from Nepal and Mexico, for example, it seems that these are countries with high inequality and large population outflows – perhaps they are on the cusp of such a disaster. The obvious example is North Korea, where the elites are sucking the common population dry without any regard for restoring natural resources. Of course in a connected world it is difficult for a single nation to collapse, since they can trade their way out of disaster (though perhaps, over time, this trade forces them into poverty and acts as a natural brake on further exploitation of the natural world). The bigger example is the earth as a whole, but I don’t think that this is a realistic model for the earth as a whole. The only global environmental problem so serious that it could lead to a major extinction event is, in my opinion, global warming, and this is not a resource depletion problem, nor is it necessarily related to inequality. It’s perfectly possible to wipe ourselves out through global warming without much affecting the overall stock of natural resources at all. In fact, the conditions given in the paper for achieving equilibrium are being partially achieved, with the likelihood of population stabilizing at around 9 billion. The second condition – of reducing inequality below some threshold level – may also be achieved once the low-income nations are lifted out of poverty, which Bill Gates seems to think will happen in a generation. So I think this model is more apt for societies of bygone eras, when people were less connected and more vulnerable to resource depletion, due to having access to a smaller range of resources, and less knowledge with which to change technologies as their component resources exhausted, and when in additional to relative inequality, the absolute poverty of the commoners was so great as to make them fatally vulnerable to any sudden reduction in wealth. Although these models are obviously analogous to what could happen to the whole of earth, I think it’s difficult to claim that they apply given the huge range of possibilities for resource consumption and adaptation on the planet as a whole. Still, as cautionary tales they’re interesting, and I think it’s safe to say that we’re at a point in our ecological history where careful custodianship of natural resources will always be a good idea.

As an interesting aside, one of the blog posts connected with this discussion led me to a blog post criticizing the story of Easter Island as portrayed in Jared Diamond’s Collapse. In Diamond’s version of the Easter Island story – which was apparently the mainstream scientific view until just about 10 years ago – the Islanders brought on their own destruction through poor ecological management, but it seems that the opposite is true: they were good custodians of their land, despite deforestation brought on by rats they accidentally brought with them, and their population collapse was actually the fault of western visitors bringing disease. The soil erosion the island is famous for was the fault of 100 years of sheep-farming by Chilean colonists who also brutalized the local population. Jared Diamond responds to the criticisms on the same blog, but his response is frankly a little mean-spirited and unreasonable. This response is in turn met with a blistering critique by his two most trenchant critics, and although I know nothing about archaeology and anthropology, I was certainly impressed by the thoroughness of their response. The truth of this story is heartening on many levels: it indicates that humans can live sustainably with much less knowledge than we currently possess, in very fragile environments, without major conflict. This debate also shows how pernicious and far-reaching the early racist colonial interpretations of history and anthropology could be, with sensationalist and incorrect fables about the Easter Islanders still being carried through academia 100 years later. Anyone who has read Jared Diamond’s books knows that this particular debate – about the relationship between ecology and human social collapse – is not merely academic, with some recent events such as the massacres in Rwanda being slated home to ecological problems, and the obvious bigger environmental issue of how to live together on this earth without destroying it. It’s sad to see someone of Diamond’s calibre and reputation being misled by racist and colonialist stories from 100 years ago, and drawing wrong conclusions about our environmental vulnerabilities as a result.

Anyway, I was fascinated to see simple predator-prey models being used to model civilization collapse, and collapse due to inequality rather than resource depletion, at that. It’s also interesting to note that a lot of the major collapses in history seem to have been driven by inequality rather than simple resource depletion. And interesting that these models should spark debate just at a time when an influential new book is putting forward the idea that modern capitalism is structurally designed to increase inequality (here I am referring to Piketty of course). It doesn’t bode well for the future, does it? These models are fundamentally too simple and limited to describe the risks facing the planet as a whole (which I do not believe are first and foremost resource depletion issues), but the finding that collapse can happen without resource depletion in the presence of inequality is fascinating, and food for thought for those people who think that inequality is only a social justice issue. It’s for the species, Rico!

Today’s Guardian has a classic piece of click-bait by the opinionated and ignorant AIDS-denialist Simon Jenkins, in which he claims that maths is a waste of time for school students, and government obssession with maths will make schools intolerable and authoritarian. His article is leavened in equal measure with sneering at any politician who tries to find a solution to any problem, haughty dismissal of any attempt to regularize or monitor teaching practice, and a sly dose of cheap stereotyping to boot. At time of writing it is completely buried on the Guardian website (at least this newspaper has some shame!) and has attracted 1594 comments, mostly disagreeing with his pathetic and stupid thesis.

The thing that really stands out for me is not the vacuity and shallowness of the arguments, but the existence of the article itself. Can anyone imagine a Japanese, Chinese or Korean newspaper bothering to publish an opinion piece arguing that maths is a waste of time? Can anyone imagine an ordinary Japanese, Chinese or Korean citizen being one-eyed enough (or worked up enough) to comment on such an article agreeing with it? The existence of such theories in East Asia is pretty questionable, I would say: there are lots of Japanese for whom maths is a waste of time, but the number of Japanese who think teaching maths is a waste of time would be pretty small, I think – certainly not sufficient to support an article on the topic in a major newspaper. If anyone wants to look at why Britain is failing in the (shudder) “global race,” articles like this by “public thinkers” give you a big hint as to the answer: an ex-editor of the Times actually believes that trying to improve maths teaching is a “race to the bottom” against China, and apparently believes schools shouldn’t teach things if they are a waste of time to the majority of their pupils.

I wonder what Jenkins thinks schools should be doing, if not teaching material that is a waste of time? Shakespeare is clearly out, as is most of history. Apparently philosophy is important because it helps one to understand formal logic (just putting aside the preponderance of mathematicians amongst the classical philosophers, for the sake of “argument”…) Jenkins is an AIDS denialist, so I guess he thinks sex education is a waste of time too. I imagine he thinks geography enormously relevant, but he would probably prefer it to focus on map reading and memorizing the names of capital cities – all that stuff about social geography and global warming is irrelevant, surely. And he wouldn’t want kids being able to calculate age-standardized mortality rates, because then they might notice that AIDS is a big issue in some parts of the world …

Most of all these articles – which appear fairly regularly in the British press – make me angry because of the toxic mix of contradictory stereotypes about maths (and by extension, mathematicians) that they promulgate. On the one hand maths teaching is a brutal exercise in crushing creativity, because maths is a fundamentally joyless and mechanical process that depends on rote learning and soul-destroying repetition; but only a few people are actually good at maths – presumably due to some kind of innate talent or special powers – so there’s no point in teaching the rest of us anything. Not only are these two ideas fundamentally incompatible, but they also suggest some kind of contrast with the humanities in which studying the humanities is always and everywhere liberating and enlightening, and hours of soulless repetition (or indeed the development of any kind of skills connected to such study) are unnecessary. Tell that to a good writer, or a ballerina … Jenkins’s view somehow manages to simultaneously belittle both mathematics and the disciplines he sets up in opposition to it.

He also manages to belittle the Chinese when he says

I once visited Chinese schools; they were like communist drill halls, factories of pressure, discipline and childhood misery

What’s that, Jenkins? You visited “Chinese schools”? All of them, was it? Maybe just 10% of them? Or did you mean to say “a Chinese school” and just couldn’t quite get yourself to spit it out? A solid grounding in mathematics might help you with that whole singular/plural distinction thing, and it might also help you to calculate what proportion of “Chinese schools” you visited, to help you understand how representative your experience was. But I can tell you this for free, Jenkins: I studied in British schools (probably, at a guess, more schools than you ever visited in China), and I can tell you now: they were like communist drill halls, factories of discipline and childhood misery. There’s even a famous British song about how terrible they are. At least Chinese kids leave their schools capable of doing basic mathematics. You might want to think about that before you make sweeping statements about a nation of a billion people, based on a couple of hours in a Shanghai school.

Many of the commenters on the article have said this, but I’d like to repeat it here: if you want to see the intellectual justification for Britain’s decline in the modern world, articles like this make it as clear as day. Here we have a senior public figure who was an editor of Britain’s most respected paper (the Times), writing from the nation that invented calculus about how teaching mathematics is a waste of time. That, right there, expresses Britain’s decline in a nutshell. Thank you, Jenkins, for making it clear. Now to the back of the class with you, until you have learnt your times tables.

Not enough to save you from castration

Not enough to save you from castration

I’ve been reading Anthony Beevor’s The Second World War, and I have been very disappointed by its handling of cryptography. Overall the book is an interesting and fun read, not as engrossing or powerful as Stalingrad or Berlin but retaining his trademark narrative flow, mix of military and personal history, and leavened with analysis of the broader political currents flowing through the war. It also doesn’t ignore colonial history the way earlier generations’ stories did, and  it is willing to present a relatively unvarnished view of Allied commanders and atrocities. The book has many small flaws, and I don’t think it’s as good as previous work. In particular the writing style is not as polished and the tone slightly breathless, occasionally a little adolescent. I’m suspicious that his grasp of the Pacific war is not as great as of Europe, and that he may fall back on national stereotypes in place of detailed scholarship, though I have seen no evidence of that yet. But the main problem the book has is just that the war is too big to fit into one person’s scholarship or one book, and so he glosses over in a couple of sentences what might otherwise have formed a whole chapter. This was particularly striking with the Nanking Massacre, which gets a paragraph or less in this book. That, for those who aren’t sure of it, is about the same amount of coverage it gets in a Japanese middle school history textbook – which also has to cover the whole of World War 2. Interesting coincidence that …

Anyway, as a result of this a great many things that might be important are given very little description. For example, the famous technology of the war – the Spitfire, the Messerschmitt, the Zero – are introduced without explanation or elucidation, and though constantly referred to by their proper names we don’t know what their strong or weak points are – it’s as if Beevor assumed we were going to check it ourselves on wikipedia. I was a little disappointed when I realized that Beevor had decided to treat the decryption/encryption technologies of the war – and the resulting intelligence race – in this way. So at some point early in the Battle of the Atlantic he starts referring to “Ultra Decrypts,” as if they were simply another technology.

This is disappointing because Ultra decrypts aren’t just another technology. There was an ongoing battle between mathematicians and engineers of both sides of the war to produce updated technologies and to decrypt them, and the capture and utilization of intelligence related to encryption methods was essential to this effort. The people who participated in this battle were heroes in their own right, though they didn’t have to ever face a bullet, and their efforts were hugely important. Basically every description of every major engagement in the African campaign includes the phrase “fortunately, due to Ultra decrypts, the Allies knew that …”[1]; the battle of Midway was won entirely because of the use of decryption; and much of the battle of the Atlantic depended on it too. These men, though they never fired a shot in anger, saved hundreds of thousands of tons of allied materiel, tens of thousands of lives, and huge tracts of land and ocean from conquest. Yet they aren’t even mentioned by name, let alone given even a couple of sentences to describe what they did and how they worked. This is particularly disappointing given that Alan Turing, who was hugely important to this effort, was cruelly mistreated by the British government after the war and ended up committing suicide. It’s also disappointing because cryptography was an area where many unnamed women contributed to the war effort in a way that was hugely important. In one earlier sentence during the Battle of Britain Beevor refers to “Land Girls,” the famous women who farmed England while the men were at war. It would be nice to also see a reference to “the Calculators,” young women who crunched numbers before computers were invented.

I find this aspect of Beevor’s book disappointing, and I’m sure that there are similar oversights in reporting the contribution of other “back office” types. Maybe it’s reflective of the modern idea that only “frontline workers” count, and only their stories are important. Or maybe it’s a reflection of a culture in which the contribution of nerds and scientists is always devalued relative to the contribution of adventurers, sportspeople and soldiers. It’s a very disappointing missed opportunity to tell an important and often under-reported story about the huge contribution that science makes to advancing human freedom.

fn1: And usually also includes the phrase “Unfortunately, [insert British leader] was too [timid/stupid/slow/arrogant] to respond and thus …”

On Monday I was required to monitor at the Tokyo University undergraduate entrance exams. I shepherded 60 terrified 17 year olds through a 2.5 hour Japanese language test and then a 100 minute maths test. These tests were part of a two day examination process for those want to enter the humanities faculty of Tokyo University. About the Japanese test I can say nothing, but the maths test interested me, and can be found online (in Japanese) at the Mainichi Shinbun newspaper. In order, based on my feeble attempts at translating the exam, the four questions were:

  • A straightforward but nasty calculation of the properties of a line intersecting with a cubic function, including elucidation of all minima and maxima of the products of the lengths of two line segments
  • A geometry question with two proofs
  • A constrained linear programming problem
  • A simple Markov model with a slight twist

The students had 100 minutes, and to their credit quite a few of the students managed all four, though a lot also stumbled and didn’t get past two. I would say that for a well-trained student with good maths skills, these four questions can all be done inside their allotted 25 minutes, but it’s a pretty risky process – even a small error at the start, or misconception of how to do the problem, and you have basically lost the whole question because you only have time to attack the problem once. And these problems are probably about the same level of difficulty as the questions on a standard year 12 maths exam in Australia – where usually we would have three hours.

But these questions were for the Humanities Faculty of this university. If you want to study Japanese literature at Tokyo University, you first have to get through that 100 minutes of high level mathematics. It says something, I think, about the attitude of Japanese people towards mathematics, and towards education in general, that they would even set a mathematics test for access to a Humanities Faculty; and it says even more about the national aptitude for maths that the students could tackle this exam.

At about the same time as these exams were being held, the Guardian and the Sydney Morning Herald released articles slamming the mathematical and science abilities of the average student in the UK and Australia, respectively. The Guardian reported on a new study that found English star students were two years behind their Asian counterparts in mathematics, with 16 year old English students at the same level as 14 year old Chinese. The study also found that

The research also found England’s most able youngsters make less progress generally than those of similar abilities across the 12 other countries studied. The other countries studied were Singapore, Hong Kong, Taiwan, Japan, Australia, Slovenia, Norway, Scotland, the US, Italy, Lithuania and Russia.

Meanwhile, the Sydney Morning Herald reported on a new study showing that the proportion of students doing mathematics is falling fast, with apparently only 19% of students studying maths, science or technology in their final year of school, and a rapid fall in mathematics enrollments amongst girls especially. The corresponding figure in Japan in 2002 was 64%.

So is this a problem, why is it common to the English speaking world and viewed so differently in Asia, and what can be done about it? Obviously as a statistician I think this is woeful[1], and it certainly is my personal opinion that understanding mathematics is a good thing, but is it bad for a society as a whole to neglect mathematics education? I don’t know if that’s objectively verifiable. So let’s skip that question, assume for now that improving the number of people taking mathematics is good, and just jump onto the question of why it is unpopular in Australia, and why the British are so bad at it.

First, I would like to dispute the possible explanation provided in the Guardian article by “the researchers”:

In east Asian cultures education has historically been highly valued. This can be seen not only in teachers’ high salaries, but also in the heavy investment of families in private tutoring services

While it may be true that “social and cultural factors” affect maths achievement, the idea that Asians are better at maths because they value education more highly is a very weak one. If this were the case, would it not also be the case that Japanese would universally be better at foreign languages than the British or Australians? Japanese get a long exposure to English teaching but are generally woeful at it, despite all the money they sink into private tutoring services. No, there’s something else going on here, something about the Asian approach to maths and the way it is taught that is important.

It is certainly the case that private tutoring services need to be considered in the mix. When comparing a 16 year old English student to a 14 year old Japanese student, for example, you are comparing someone who does a 9 – 5 study day with very long winter and summer holidays against someone who does an 8 – 8 study day with two-week holidays, and who gets 2-on-1 or small group tutoring in key subjects for up to 3 hours a day, and on weekends. This process starts at age 10 and really ramps up at about age 15-16, just when the linked article finds the biggest gap between English and Asian students. It’s also the kind of process that benefits the “brightest” students most, and would explain the gap very nicely.

It may be that if the UK wants to compete with the sleeping giants of Asia on basic educational outcomes, it’s just going to have to face up to a simple fact: British students need to study harder. A lot harder.

There are some more nebulous cultural factors that come into play, however, and I am going to go out on a limb here and name a few factors in Japanese society (the part of Asia I am familiar with) that I believe make Japanese so much better at maths than their western counterparts.

  • It isn’t about native talent: A pet hate of mine about western approaches to mathematics is the idea that some people are talented at it, and most people aren’t. I don’t think this is true at all, and I think it’s not something that Japanese believe very strongly. The reality is that getting good at maths is a long, hard slog that involves a huge amount of repetition of basic skills (things like completing the square, substitution, differentiation, interpreting graphs, sign diagrams, etc.) – just like learning a language. Sure, solving maths problems requires creativity and intuition, but these are only of any value if you know the tools you can apply them to, and are familiar enough with those tools to recognize when and how to use them. Mathematics – and especially high school mathematics – is a process of drilling, drilling, drilling, and I think that Japanese recognize this. In Japan the default assumption is that if you pay attention at school and do your homework, you will be good at maths. Sure, they recognize that advanced maths requires extra commitment and talent, but there is a fundamental assumption here that the broad body of maths (up to and including differentiation, integration, limits, and basic probability theory) are things that anyone can learn.
  • The teacher is important: the flip side of the idea that education is important is an increased stress on the value of the teacher, and their role as a guide. The role of the guide is also viewed very differently if they are teaching something that they believe anyone can do, compared to if they are teaching a subject that everyone believes is impossible for most mortals to comprehend. Find me a westerner under the age of 30 who is “terrible at maths” and I will show you someone who was humiliated by an arrogant maths teacher at a crucial time in high school, usually around when they were 14. I was in the bottom class in mathematics when I was 14, expecting to drop out as soon as possible, until a good teacher put some time into teaching me, and I found that I really loved it. In Japan, teachers can be bullies and they can be cold and hard, but I would also argue that they have a much greater burden of personal care and responsibility placed on them compared to western teachers, and the failure of their students is treated more like a professional failure (rather than due to the student’s personal talents) than it is in the west. I think this is especially important with mathematics, because when you don’t get it it really hurts – like a kind of itching in the back of your brain – and the failures pile up rapidly. Just a single year between 12 and 14 in which you give up on maths is enough to make all the subsequent years ever more challenging, meaning the damage and the attendant confidence failures compound.
  • Being nerdy is cool: In Japan, it’s okay to be a nerd, and being good at mathematics is admired and respected. It’s virtually unheard of to find someone here who looks down on a man who can do maths, or thinks that it is beyond the female brain, or thinks that being interested in mathematics is weird. Furthermore, the nerd world in Japan is much more gender neutral than in the west, so there’s nothing unusual about girls doing maths. Good mathematics skill – up to and including being able to rearrange equations or solve systems of equations, for example – is not seen as a weird foible, but as an admirable sign that you are a rounded human being.
  • There is a social expectation of mathematical skill: In addition to nerdiness being much more acceptable, the range of mathematical abilities that qualify you as a nerd in Japan is much more esoteric and advanced than in the west. There is a general expectation that ordinary people can solve maths problems, that they understand the basic language of mathematics so that even if they can’t solve a problem they know roughly what it is and where it sits in the pantheon. Parents assume that their kids will learn mathematics, and don’t dismiss it as the too hard subject that only the special or the weird get ahead in. Whereas in Australia having a kid who is good at maths is unusual, in Japan it is unusual (and embarrassing!) to have a kid who is not good at maths.

I think these properties add up to a society in which mathematical achievement is encouraged and widespread. I think that Australia and the UK need to change some cultural factors so that the intellectual and educational landscape is closer to that in Asia if they want to keep up on mathematics and technology achievement – especially since China’s education system is maturing, and other Asian nations like Vietnam, Singapore and India are getting wealthier, with all the educational gains that implies. So what should Australia do?

  • Ditch the nerd-baiting: there’s something really wrong with the way the English-speaking world treats people who do nerdy things. I’m sure it’s mellowed a lot since I was a kid but it’s still there, the kind of ugly-four-eyes assumption about anyone who is interested in anything that isn’t sport or fashion. Until this weird attitude dissipates – and until the nerd world becomes more gender-balanced, to boot – it’s going to be hard to encourage the kind of cultural changes needed to make maths achievement standard across the board
  • Less intuition and initiative, more drills: I think it’s very sweet that maths teachers want to encourage their charges to think about the broader world of maths, about creative problem-solving, about applying maths to the real world, etc. But I think those are natural talents all humans possess, that cannot be unlocked without a robust background in the basic skills that make mathematics work. So leave the creativity for people who need it, and stuff kids’ heads full of “useless” rote learning of techniques and drills. It’s boring, but it’s essential to the bigger stuff. If you aren’t able to immediately see when and how to complete a square, then any problem which requires this basic technique is going to be beyond you, no matter how intuitive you are. Maths, possibly more than any other discipline, is built from the ground up, tiny block by tiny block, and all those blocks are essential. So ram them down every kid’s throat, and make every kid think that knowing the quadratic formula is not a test of some kind of obscure talent, but a basic expectation of every 12 year old
  • Force mathematics at higher school levels: When I finished school our balance of subjects had to include at least one science/technology subject, but it didn’t have to include maths. This is wrong, and part of the reason that so many students in Japan do mathematics is that you can’t get into a good university if you take this approach: every one of the better universities includes mathematics in its entrance exam. My personal belief is that completion of higher school certificates should require one foreign language, mathematics, and English. That leaves two other subjects to choose from, and guarantees that you have to do some kind of mathematics to the end of school. Not only will this very quickly lead to a society where entire generations of people are generally familiar with mathematics, it will also put a real focus on the quality of teaching at the earlier years, since any student who is doing badly in years 8 – 10 is going to fail their higher school certificate. [Probably this suggestion for a national curriculum is completely unreasonable, but at the very least students could be forced to do mathematics up until year 11, for example].
  • Make school more robust: The Japanese school system is about to shift to a “tougher” system that will include Saturday morning classes, because the previous system was considered “relaxed” compared to earlier years. This is, frankly, ridiculous, but so is the attitude towards education of most of the English-speaking world. Summer holidays are way too long and relaxed, there is a real lack of extension classes and tutoring, and expectations are altogether too low. Education isn’t valued enough, and until this changes anyone who wants their child to do better is going to be swimming against a strong current. Educational achievement is partly supported through the shared goals of a whole society, not just through the targets of individual families, and the expectations we hold for education are primarily set through the school system. So toughen it up – not in the sense of making teachers scarier or bringing back outdated “three Rs” educational styles, but by increasing the amount of time students spend at school, setting tougher standards for graduation and university entrance, making schools compete with each other (as Japanese schools partly do) and forcing parents to take greater responsibility for and involvement in their children’s education. This change isn’t specific to mathematics, but it would certainly help.

I don’t think there’s anything special about Asian students, or about Asian culture, that we can’t adopt. Asians’ mathematics achievements aren’t some kind of native or racial talent. It’s just a collection of attitudes towards education, mathematics and nerdiness that we can adopt if we want. Obviously there will be (potentially challenging) institutional changes required as well, and many people may judge it not worth the effort, but I personally think a world where everyone is good at mathematics is a better world, and we should be aiming for it. With these cultural changes maybe one day everyone will know the obvious thrill of being able to complete a challenging mathematics exam … and enjoying it!

fn1: Though obviously, the less people doing maths, the longer I will remain competitive in the marketplace …

In October my master’s student had her work on modeling HIV interventions in China published in the journal AIDS, with me as second author. You can read the abstract at the journal website, but sadly the article is pay-walled so its full joys are not available to the casual reader. This article is a sophisticated and complex mathematical model of HIV, which incorporates three disease stages, testing and treatment separately. It is based on a model published by Long et al in the Annals of Internal Medicine in 2010, but builds on this model by including the effects of methadone maintenance treatment, and doesn’t include an injecting drug use quality of life weight. It also adds new risk groups to the model: Long et al considered only men who have sex with men (MSM), injecting drug users (IDU) and the general population, but we added commercial sex workers (CSW) and their clients, who we refer to as “high risk men.” Thus our mathematical model can consider the role of both injecting drug users and sex workers as bridging populations between high-risk groups and the general population, an important consideration in China.

The HIV epidemic in China is currently a concentrated epidemic, primarily among IDUs in five provinces, and amongst MSM. The danger of concentrated epidemics is that they give the disease a foothold in a country, and a poor or delayed response may cause the epidemic to jump to the rest of the population – there is some suggestion this may have happened in Russia, for example. The Chinese authorities, recognizing this risk, began expanding methadone maintenance treatment (MMT) in the early 2000s, but it still only covers 5% of the estimated 2,500,000 IDUs in China. Our goal in this paper was to compare the effectiveness of three key interventions to prevent the spread of this disease: expanded voluntary counseling and testing (VCT); expanded antiretroviral treatment (ART); and expanded harm reduction (MMT and needle/syringe programs); and combinations of these interventions. VCT was assumed to reduce risk behavior and expand the pool of individuals who can enter treatment per year; ART was assumed to reduce infectiousness; and harm reduction to reduce risk behavior. Costs were assigned to all of the programs based on available Chinese data, and different scenarios considered (such as testing everyone once a year, or high-risk groups more frequently than everyone else).
The results showed that all the interventions considered are cost-effective relative to doing nothing; that some of the interventions saved more money than they cost; and that the most cost-effective intervention was expanding access to ART. Harm reduction was very close to ART in cost-effectiveness, and would probably be more cost-effective if we incorporated its non-HIV-related effects (reduced mortality and crime). The Chinese government stands to reap a long-term benefit from implementing some of these programs now, through the 3.4 million HIV cases averted if the interventions are successful (there are a lot of “ifs” in that sentence).This is the first paper I’m aware of that compares ART and harm reduction head on for cost-effectiveness, though subsequently some Australians showed in the same journal that needle/syringe programs (NSP) in Australia are highly cost-effective as an anti-HIV intervention. This is also the most comprehensive model of HIV in China to date, and the first to conduct cost-effectiveness analysis in that setting. I think it might be the first paper to consider the detailed structure of risk groups in a concentrated epidemic, as well. There are obvious limitations to the conclusions that one can draw from a mathematical model, and some additional limitations on this model that are specific to China: the data on costs was a bit weak (especially for MMT) and of course there are questions about how feasible some of the interventions would be. We also didn’t consider restricting the interventions to the key affected provinces, which would have made them much cheaper, and we didn’t consider ART or VCT interventions targeted only at the high-risk groups, which would also have been cheaper. For example, legalizing sex work and setting strict licensing laws might enable universal, quarterly HIV testing and lead to the eradication of HIV from this group within 10 years, but we didn’t include this scenario in the model because a) legalization is not going to happen, b) enforcement of licensing laws is highly unlikely to be effective in the current context in China, and c) data on the size and behavior of the CSW population is probably the weakest part of our model, so findings would be unreliable. Despite the general and specific limitations of this kind of modeling in this setting, I think the results are a strong starting point for informing China’s HIV policy. China seems to have a very practical approach towards this kind of issue, so I expect that we’ll see these kinds of policies implemented in the near future. My next goal is to explore the mathematical dynamics of these kinds of models with the aim of answering some of the controversial questions about whether behavioral change is a necessary or effective part of a modern HIV response, and the exact conditions under which we can hope to eliminate or eradicate HIV. Things are looking very hopeful for the future of HIV, i.e. it’s going to be eliminated or contained in most countries within our lifetime even without development of a vaccine, and that’s excellent, but there is still debate about how fast that will happen and the most cost-effective ways of getting there: hopefully the dynamic properties of these models can give some insight into that debate. This article is a big professional achievement for me in another way. It’s extremely rare for master’s students to publish in a journal as prestigious as AIDS (impact factor over 6!), and my student’s achievement is a reflection of her amazing talent at both mathematics and English, and a year of intense work on her part, but I like to think it also is a reflection of my abilities as a supervisor. There were lots of points where we could have let things slide on the assumption that master’s students don’t publish in AIDS; but we didn’t, and she did. I like to think the final product reflects well on both of us, so read it if you get the chance!

Gruumsh not think R help much like poetry. Gruumsh need use R to crush human foe. Gruumsh not like read help, but sometimes have to. Here help for round function, Gruumsh quote verbatim:

Note that for rounding off a 5, the IEC 60559 standard is expected to be used, ‘go to the even digit’. Therefore round(0.5) is 0 and round(-1.5) is -2. However, this is dependent on OS services and on representation error (since e.g. 0.15 is not represented exactly, the rounding rule applies to the represented number and not to the printed number, and so round(0.15, 1) could be either 0.1 or 0.2).

Gruumsh not trained statistician, but Gruumsh think this is big pile of steaming Ogre shit. Gruumsh check with Stata oracle. Stata rounds 0.5 to 1, not 0. Stata sensible god of numbers. Gruumsh not mathematician, but when Gruumsh round 0.15, Gruumsh expect 0.2. Gruumsh want to smash idiot that made IEC 60559 standard. Stupid jobsworth die slow nasty death under Gruumsh-club.


Recently I’ve been working on some problems in disease modeling for influenza, and one of the problems is to calculate the basic reproduction number for a model which includes differential disease strengths in poor and rich risk groups. Calculating this number is generally done with a method called the “Next Generation Matrix” method, and to do this one needs to calculate two matrices of partial derivatives, invert one and multiply it by the other, then calculate the eigenvalues – the basic reproduction number is the largest eigenvalue of the resulting calculation. Doing this for just one risk group in the model I’m fiddling with can be done analytically in about 7 pages of notes – it involves finding the inverse of a 5×5 matrix, but actually this is quite quick to do by hand because most of the matrices involved are wide open spaces of zeros. However, once one extends the model to four risk groups the calculation becomes nastier – it involves inverting a 20×20 matrix, then finding the eigenvalues of a product of 20×20 matrix. Even recognizing that most of these matrices are zero elements, one still ends up with a fiendish hand calculation. On top of this, the matrices themselves contain many separate values all multiplied together. I started this by hand and decided today that I want to take a shortcut – a student needs to use some basic values from this soon and neither she nor I are going to get it done analytically before our deadline.

So tonight I came home and, after a nice dinner and an hour spent with my partner, I spent about an hour programming Matlab to do the calculation numerically for me. I now have the two values that my student needs, and if she needs to tweak her model it’s just a few presses of a button on my computer to get the updated reproduction number. Also, it’s a matter of a second’s work to test any other parameter in the model, and with a few loops I can produce charts of relationships between the reproduction number and any parameter. It’s nice and it was fairly trivial to program in Matlab. In this instance Matlab saved me a couple of days’ work fiddling around with some enormously tricky (though not mathematically challenging) hand calculations.

On this blog a short while back I investigated a weird probability distribution I had encountered at Grognardia. For that calculation, rather than going through the (eye-bleedingly horrible) tedium of attempting to generate a mathematical expression for the probability distributions I wanted to analyze, I simply ran a simulation in R with so many runs (about 100,000) that all random error was stripped out and I essentially got the exact shape of the theoretical underlying distribution I wanted.

In both cases, it’s pretty clear that I’m using a computer to do my thinking for me.

This is very different to using a computer to run an experiment based on the theory one developed painstakingly by hand. Rather, I’m using the brute number-crunching power of modern machines to simply get the theoretical result I’m looking for without doing the thinking. That Grognardia problem involved a badly programmed loop that executed a total of 4,500,000 dice results just to produce one chart. I did it on a computer with 32Gb of RAM and 12 chips, it took about 3 seconds – and I didn’t even have to program efficiently (I did it in R without using the vector nature of R, just straight looping like a 12 year old). The resulting charts are so close to the analytical probability distribution that it makes no difference whatsoever that they’re empirical – that hour of programming and the 3 seconds of processor time short circuited days and days of painstaking theoretical work to find the form of the probability distributions.

Obviously if I want to publish any of these things I need to do the hard work, so on balance I think that these numerical short cuts are a good thing – they help me to work out the feasibility of a hard task, get values to use in empirical work while I continue with the analytic problems, and give a way to check my work. But on the flip side – and much as I hate to sound like a maths grognard or something – I do sometimes wonder if the sheer power of computers has got to the point where they genuinely do offer a brutal, empirical short cut to actual mathematical thinking. Why seek an elegant mathematical solution to a problem when you can just spend 10 minutes on a computer and get all the dynamics of your solution without having to worry about the hard stuff? For people like me, with a good enough education in maths and physics to know what we need to do, but not enough concerted experience in the hard yards to be able to do the complex nitty-gritty of the work, this may be a godsend. But from the broader perspective of the discipline, will it lead to an overall, population-wide loss of the analytical skills that make maths and physics so powerful? And if so, in the future will we see students at universities losing their deep insight into the discipline as the power of the computer gives them ways to short cut the hard task of learning and applying the theory?

Maybe those 12 chips, 32Gb of RAM, 27 inch screen and 1Gb graphics card are a mixed blessing …

In the Australian state of New South Wales, final year mathematics exams were held a few days ago and the Sydney Morning Herald reports the advanced maths exam was “cruel and difficult.” Students on some message board are posting sad messages saying they might as well not have bothered because it was so hard, and some teacher says:

I am appalled that an examination committee could set such a difficult paper which gives the competent student little chance to show what they know

Poor kids! I was interested in this because when I did my year 12 (in South Australia) in 1990, the NSW assessment was famously challenging, and we were in awe of the effort the students put in. There’s a certain pride that comes from completing a year 12 advanced maths exam, and I can understand why even if the results are scaled (so you don’t fail if the exam was too hard), it’s discouraging and mean to put out an exam that is too hard for the subject content. I’m also interested because in my opinion Australians are much more numerate than British, but much less than Japanese, and I’m interested in our educational trajectory.
Fortunately, the herald also gives an example from this exam, and here it is:

A game is played by throwing darts at a target. A player can choose to throw two or three darts.

Darcy plays two games. In Game 1, he chooses to throw two darts, and wins if he hits the target at least once. In Game 2, he chooses to throw three darts, and wins if he hits the target at least twice.

The probability that Darcy hits the target on any throw is p, where 0 < p < 1.

(i) Show that the probability that Darcy wins Game 1 is 2p – p[squared].

(ii) Show that the probaility that Darcy wins Game 2 is 3p[squared] – 2p[cubed].

(iii) Prove that Darcy is more likely to win Game 1 than Game 2.

(iv) Find the value of p for which Darcy is twice as likely to wine Game 1 as he is to win Game 2.

So I’m interested to know … do my readers think this is challenging? I did it on a single sheet of paper in 10 minutes yesterday, and it really didn’t seem tough. Admittedly I should be able to do this stuff quickly, but when I compare it to the work I did in 1990 it doesn’t seem very hard at all. Questions i and ii are basic applications of probability theory, without even any conditional or joint probability questions; part ii requires use of basic combinatorics but I remember this stuff was not too hard in year 12 when I did. Questions iii and iv are trivial exercises in problem solving with quadratics: you need to do a sign diagram for iv and complete the square of a quadratic but if you can’t identify and solve such a problem in year 12 surely you have stuffed up somewhere? Also, you don’t need to get i and ii right to do iii and iv, which in my opinion is very far from cruel. I would have been very happy to see that option in an exam when I was doing year 12! Basically, the first two questions are year 11 level probability (at most!) and the last two are year 10 functions.

So I’m wondering, have standards slipped in Australia in the last 20 years, or am I turning into one of those teachers I hated when I was at university, who say “this is trivial high school maths” as they introduce a path integral that can only be solved numerically? I’m pretty sure it’s the former (or the question the Herald gave is not representative) and 38% of people who answered the poll on the Herald website agree with me. Dissenting opinions (and reminiscences about the horrors of your own school days) are welcome in comments…

Update: I found on reddit some photos of two other questions: question 5 and question 7. I think these both look tough though I think I could do question 7 (I think you use differentiation and a change of variables in part i, then ii and iii are just straight nasty old manipulation; though maybe part i is induction). I’ve always been terrible at trigonometry, and I remember fluffing a question very similar to (possibly the same as!) number 5 in my exam in 1990. I don’t think I’d do better this time round. But I’m not sure that this material is excessive for a year 12 maths exam; maybe question 7 is more a first year university question …? But I don’t think so. Kids should be doing series and induction in year 12 for sure …