TRADITION has it that boys are good at counting and girls are good at reading. So much so that Mattel once produced a talking Barbie doll whose stock of phrases included “Math class is tough!”

Although much is made of differences between the brains of adult males and females, the sources of these differences are a matter of controversy. Some people put forward cultural explanations and note, for example, that when girls are taught separately from boys they often do better in subjects such as maths than if classes are mixed. Others claim that the differences are rooted in biology, are there from birth, and exist because girls' and boys' brains have evolved to handle information in different ways.

Luigi Guiso of the European University Institute in Florence and his colleagues have just published the results of a study which suggests that culture explains most of the difference in maths, at least. In this week's Science, they show that the gap in mathematics scores between boys and girls virtually disappears in countries with high levels of sexual equality, though the reading gap remains.

Dr Guiso took data from the 2003 OECD Programme for International Student Assessment. Some 276,000 15-year-olds from 40 countries sat the same maths and reading tests. The researchers compared the results, by country, with each other and with a number of different measures of social sexual equality. One measure was the World Economic Forum's gender-gap index, which reflects economic and political opportunities, education and well-being for women. Another was based on an index of cultural attitudes towards women. A third was the rate of female economic activity in a country, and the fourth measure looked at women's political participation.

On average, girls' maths scores were, as expected, lower than those of boys. However, the gap was largest in countries with the least equality between the sexes (by any score), such as Turkey. It vanished in countries such as Norway and Sweden, where the sexes are more or less on a par with one another. The researchers also did some additional statistical checks to ensure the correlation was material, and not generated by another, third variable that is correlated with sexual equality, such as GDP per person. They say their data therefore show that improvements in maths scores are related not to economic development, but directly to improvements in the social position of women.

The one mathematical gap that did not disappear was the differences between girls and boys in geometry. This seems to have no relation to sexual equality, and may allow men to cling on to their famed claim to be better at navigating than women are. However, the gap in reading scores not only remained, but got bigger as the sexes became more equal. Average reading scores were higher for girls than for boys in all countries. But in more equal societies, not only were the girls as good at maths as the boys, their advantage in reading had increased.

This suggests an interesting paradox. At first sight, girls' rise to mathematical equality suggests they should be invading maths-heavy professions such as engineering—and that if they are not, the implication might be that prejudice is keeping them out. However, as David Ricardo observed almost 200 years ago, economic optimisation is about comparative advantage. The rise in female reading scores alongside their maths scores suggests that female comparative advantage in this area has not changed. According to Paola Sapienza, a professor of finance at the Kellogg School of Management in Illinois who is one of the paper's authors, that is just what has happened. Other studies of gifted girls, she says, show that even though the girls had the ability, fewer than expected ended up reading maths and sciences at university. Instead, they went on to be become successful in areas such as law.

In other words, girls may acquire an absolute advantage over boys as a result of equal treatment. This is something that society, more broadly, has not yet taken on board. Mattel may wish to take note that among Teen Talk Barbie's 270 phrases concerning shopping, parties and clothes, at least one might usefully have been, “Dostoevsky rocks!”