Australian magpies that hang out in large groups appear to be smarter and more successful at breeding than those in smaller groups.
That's the finding of research that tested the cognitive skills of magpies living in a suburb of Perth.
The study, published in the journal Nature, supports a contentious concept that living in complex societies can influence intelligence in the animal world.
The idea is the larger the group, the more relationships you have to maintain, said the study's lead author Ben Ashton of the University of Western Australia.
"So not only do you have to remember all these individuals, but you have to remember your relationship with them and how to behave appropriately with them," Dr Ashton said.
Australia's "favourite bird" is renowned for its social and territorial nature.
Magpies often live in multigenerational clans that can inhabit the same territory for several years if conditions are good.
Young male magpies also hang out in nomadic tribes in some parts of Australia.
Dr Ashton and his colleagues studied West Australian magpies (Cracticus tibicen Dorsalis) that lived in well-established multigenerational groups in the Perth suburb of Guildford over a period of three years.
The groups varied in size from three to 12 individuals, which were all tagged with colour rings on their legs for identification.
The scientists put 56 adult magpies through a series of tests involving four tasks.
This included a spatial memory task (below), in which the bird had to remember where a lump of mozzarella was hidden in a grid of eight options.
It also included a task in which the birds had to get food out of a transparent tube. This tested their ability to control their behaviour, as they had to learn to stop pecking at the tube and source the food from an opening at either end.
The birds were isolated from the rest of the group to make sure they didn't cheat or give a heads up to their mates.
The scientists found that individuals in the larger groups consistently performed much better than those in the smaller groups.
"There wasn't much variation in smaller groups. They all performed quite poorly," Dr Ashton said.
He said the relationship between cognition and group size was expected, but the researchers were surprised by the performance of individual birds across the four tasks.
"If an individual performed well in one task, they performed well in another. And likewise if one performed poorly in one task, they performed poorly in all four," he said.
"This is kind of referred to as general intelligence in humans, and this is a bit of a contentious issue in non-human animals, yet we found quite strong evidence of it."
To understand how learning plays out as birds age, the scientists also tested 21 juvenile birds in the groups at 100 days after leaving the nest, and again at 200 and 300 days.
While the youngest birds didn't exhibit any difference in their results, a pattern started to emerge at 200 days.
"This suggests the social environment has an effect on cognitive development," Dr Ashton said.
"It's not purely a genetic thing, there must be some kind of environmental factor at play."
The scientists also noted that the smarter female birds had better breeding outcomes, but they are not sure why.
"It might be that smarter females are better at defending their chicks or their juveniles, which increases reproductive success.
"Or they might feed better quality food [to their chicks]," Dr Ashton speculated.
Why is group size and cognition contentious?
Magpie expert Gisela Kaplan said the study was nicely done, but the concept of linking animal intelligence just to group size is still very contentious.
"An intense study of a species reveals animals can really do a lot more than we give them credit for," Professor Kaplan from the University of New England said.
But while researchers such as Dr Ashton's team argue that increased communication in groups contributes to the development of brain networks and cognition, Professor Kaplan said other researchers have argued that individual animals don't need to be as smart if they all worked together as a group.
"The cognitive ability decreases in the individual but not in the group as a whole.
"That's been shown in birds that usually live in larger groups," Professor Kaplan said.
And it could also be important to have a mix of leaders and followers for group survival.
Professor Kaplan said another factor in cognitive development was stability of the group. The longer a bird stays within a group, the more time it has to develop cognitive skills and breeding success.
"The question is always whether the resources are there to maintain the groups when they get larger," Professor Kaplan said.
"We keep cutting down trees, nesting habitats for magpies. It means nesting territories tend to become a bit smaller and the competition between magpies becomes more intense."
Dr Ashton said it would be interesting to study intelligence in groups that are less stable than the Guildford mobs, which didn't change at all over the three-year period.
He said he would also like to understand more about the social networks within the groups and how these could affect cognition.
"Is it the number of relationships an individual has in a group? Is it the strength of those relationships? Or is it the number of affiliated or antagonistic interactions it has?" Dr Ashton said.
"If we find a relationship there that could really give us an indication of what aspects of group living drives cognition."