"I found that the amount of grooming a male performs on a female during a sexual interaction is related to the supply/demand ratio of females per male around the male-female pair at the time of the grooming," says Gumert.

Put another way, male monkeys - especially lower status ones - have to groom more to get more action when fewer females are around.

Grooming in macaques involves using the teeth and hands to pick through the fur of the recipient to remove dirt, tangles and parasites.

The activity often sexually excites the monkeys, particularly the males, so many scientists suspect it evolved into foreplay in humans.

Indonesian study

Gumert, analysed a wild population of long-tailed macaques at Tanjung Puting National Park in Indonesia, from 2003 to 2005.

During this period he documented 243 male-to-female grooming sessions, most of which were directed at females who were receptive to mating.

The "grooming before sex" bouts lasted anywhere from a few seconds to a half hour or more, with the durations frequently linked to either the number of potential other partners or to the status of the groomer or recipient.

According to Gumert, "rank does not remove the market, it only skews it."

"Powerful individuals can take more and give less than low-ranked individuals can," he says, suggesting that such corruption of the fair trade ideal appears to be an inherent facet of primate social life that can apply to everything from monkey sex to human politics.

High-ranking females can also skew the system because, in the case of macaques, they demand more attention before they agree to mate.

Since males often have their work cut out for them, they also try to first "flirt" with females, using facial gestures before they approach.

"Being anthropomorphic, this may be like winking or smiling," says Gumert.

"The male bows and bobs his head, raises the eyebrows and smacks his lips at the female."

He also found that females will groom males at times, but that this behaviour doesn't appear to be linked to sex.

Gumert suggests it instead may serve to forge bonds with certain males, which could later protect the female's offspring from other aggressive males without such a vested interest in her family.

"Well done" study

Professor Frans de Waal, a psychologist from Yerkes Primate Center at Emory University in Atlanta says the new study is "very well done and nicely applies the biological market concept to something new - exchange of grooming for sex, or sex for grooming."

De Waal adds: "We all know that primate males often do a bit of grooming before they mate with females, and that they groom very little if the female isn't fertile, but it is good to see such a thorough, quantified account of it."

Gumert experienced a similar fair trade in his own life, when he married an Indonesian woman in a traditional village ceremony. He provided nuptial gifts to her family, as well as a small dowry.

"I received no material gifts [in return]," says Gumert, "but I did get to marry my wife."