Media playback is unsupported on your device Media caption Footage from the University of St Andrews shows birds 'selecting' the best materials, as lead researcher Dr Ida Bailey explains

Birds can learn to choose the best building materials for their nests, according to scientists.

It was previously thought that birds' choice of nest material was determined by their genes - with each type of bird having an "innate nest template".

But an experiment has now shown this to be a more cognitively complex activity.

The study, published in the Royal Society journal Proceedings B, involved giving finches a choice of floppy and stiff string to build their nests.

Image copyright FRANS LANTING, MINT IMAGES / SCIENCE PHOTO LIBRARY There's a massive diversity of nests in the natural world Dr Ida Bailey, University of St Andrews BBC Nature: Birds' nests in unusual places

"We found that zebra finches like the stiffer string," explained lead researcher Dr Ida Bailey from the University of St Andrews.

"It's more efficient for them to build with - they can build a nest with fewer materials."

Dr Bailey and her colleagues were looking to test the learning ability of birds; their test aimed to work out if the birds could learn to differentiate between materials based on their properties.

To test this, they gave one group of finches a flexible, floppy string to build with, and another group stiffer, more "structurally sound" string.

Both groups of birds were subsequently offered a choice between the flexible and stiff string. And the birds that had been made to build their nests with the floppy string immediately opted for the more rigid building material.

"There's a massive diversity of nests in the natural world," said Dr Bailey. "Some really amazing things - birds stitching leaves together, weaver birds building hanging baskets.

"And because birds are not considered to be as clever as people, who can learn to use different materials quite easily, the assumption had been that there was a genetic template in the birds' brains.

"This shows that actually learning is also very important for their decisions."

Mike Toms from the British Trust for Ornithology said the research made a lot of sense.

"It may help to explain the variety of materials that may be used by individuals of the same species nesting in the same general area," he told BBC News.

"This new knowledge certainly increases my respect for the construction skills of birds like the long-tailed tit, which use many thousands of pieces of material to make their domed nest of moss, lichen, spider-webs and feathers."