IN 1948 Angus John Bateman, an English geneticist, proposed that females invest more in producing and caring for their offspring than males because sperm are cheaper than eggs. Since then, however, many species, in particular egg-laying ones, have been found to violate what became known as Bateman's principle. Such role reversal has left evolutionary biologists baffled. Some suggeseted that species in which females lay eggs that are big compared to their bodies may need more time to recover after laying eggs and males perform nest chores to compensate. Others fingered high levels of nest predation, which prompts females to seek more males to mate with, in order to produce more offspring, and leave nests untended; again, males pick up the slack. Neither hypothesis had robust data to back it up.

In 2000 Tamas Szekely, an ornithologist at the University of Bath, put forward an alternative explanation. What determines the role adopted by each sex, Dr Szekely contends, is the ratio of males to females. Typically, females outnumber males. This means a male mates with a female once and goes off in search of another willing partner, leaving the mother to tend the nest. Where the ratio favours males, however, the fathers might care for the young rather than face stiff competition to woo another female. Since the supply of males is low, females compete for them instead.

This idea remained untested, however, mainly because finding reliable data on animal sex ratios is tricky. But Andras Liker, Dr Szekely’s colleague at the University of Sheffield, believes he has found some. For over 20 years researchers around the world have been painstakingly collecting data on waders. Studies by Dr Liker and Dr Szekely showed that the data were good enough to test the sex ratio hypothesis.

As they report in Nature Communications, wading birds’ sex roles are indeed correlated with the sex ratio in 16 of the 18 species they tested. In the five species in which females outnumber males (ruffs and northern lapwings, for instance) mothers care for their brood. In the 11 male-dominant species, including Jesus birds and greater painted snipes, by contrast, it is the fathers who look after the nestlings.

Sex ratios are, of course, in part determined by precisely the sort of behavioural traits Drs Szekely and Liker strive to explain. The reason this does not lead to a chicken-and-egg problem, as it were, is that sex ratios are also a function of other factors, like different mortality rates among adult males and females, themselves the result of things like body size.

Dr Szekely's idea may help explain why sex-role reversal seldom happens in mammals, where sex ratios tend to favour females (though mammalian males also lack females' ability to produce milk). It might even, Dr Liker speculates, shed light on other social behaviour in animals, such as homosexual pairing, possibly triggered byof a shortage of available partners of the opposite sex.