Mammals can choose the sex of their children in order to increase the number of grandchildren, a new study from Stanford University School of Medicine found.

The study shows that mammals don't rely on some unknown factors that select the gender of their offspring. The study was based on more than 90 years' record of breeding from the San Diego Zoo.

Previously it was believed that healthy mammals tend to produce more males when conditions are favorable- such as presence of good food supply. Conversely, females living in unfavorable conditions would give birth to more females. This hypothesis was proposed by Robert Trivers and Dan Willard (1973) and was based on the idea that when conditions can support a large population, having a male is a good idea since they can breed more.

In 1984, another team of researchers from the University of Cambridge found that dominant females among wild red deer tended to produce more sons than the less dominant females in the herd.

The present study supports build up on these theories.

This study was based on data from three generations of 2,300 animals. They found that grandparents strategically decided to give birth to more sons, especially if they were high-quality and would give birth to many grandchildren.

Researchers believe that females tend to choose the gender of the offspring.

"You can think of this as being girl power at work in the animal kingdom. We like to think of reproduction as being all about the males competing for females, with females dutifully picking the winner. But in reality females have much more invested than males, and they are making highly strategic decisions about their reproduction based on the environment, their condition and the quality of their mate. Amazingly, the female is somehow picking the sperm that will produce the sex that will serve her interests the most: The sperm are really just pawns in a game that plays out over generations," said Joseph Garner, PhD, associate professor of comparative medicine and senior author of the study, according to a news release.

For the study, researchers spent years constructing a three-generation pedigree record for over 600 different species. Note that they used records from many major mammalian groups including primates, carnivores and cloven-hoofed animals.

The results showed that when females gave birth to sons, these sons had 2.7 times more babies than females who gave birth to equal number of males and females.

Garner said that gender selection is a sort of gambling for parents. The mammals that produce mostly daughters are playing it safe. But, mammals giving birth to more sons are playing the high risk game as they'd get more rewards (in terms of more grandchildren) if they win.

"Most male lions don't reproduce. There may be 10 or 15 females but only one male that fathers everybody. The same is true with baboons," he said." There is one alpha male. If you are the parent of that harem-holding male, then you have hit the genetic jackpot because he might produce tens or hundreds of offspring. If you have a bachelor male, who never produces offspring, he produces zero. So males are a high-risk, high-payoff bet. Who would take the bet unless they knew they could rig it?"

But, how do females choose the gender of the offspring?

According to researchers, there aren't many studies that show how the genders are fixed. One theory suggests that females can control the male and female sperm based on their shape and size and slowing down the movement of undesired sperm.

Researchers said that gender selection in humans depend on social cues. For, example a study in 1988 had shown that women with some form of speech impediment were three times more likely to have sons than daughters.

The study is published in the journal PLOS One.