(CNN) Summer is approaching in the northern hemisphere, heralding the return of that great scourge of al fresco diners everywhere: the wasp.

Now, a new study out of the University of Michigan reveals that the striped critters aren't just pesky -- they're smart.

The research found that wasps can use a form of logical reasoning to infer unknown relationships from known relationships, according to a press release.

Essentially this means they can work out that if is X is greater than Y, and Y is greater than Z, X is greater than Z -- an ability that was thought to be a key human trait for thousands of years.

In recent decades, however, scientists have shown that vertebrate animals such as birds, monkeys and fish also have this ability, known as transitive inference (TI).

And Elizabeth Tibbetts, an evolutionary biologist at the University of Michigan, has found the first evidence of TI in an invertebrate animal -- namely the paper wasp.

While the paper wasp's sting is toxic to humans, it is less painful than those of other wasp species.

Researchers from the University of Michigan found the wasps could infer unknown relationships from known ones.

A previous study investigated TI in honeybees, which failed the test, with their small nervous system thought to be a possible explanation.

Paper wasps have a similar-sized nervous system to honeybees, and both insects have brains about the same size as a grain of rice.

However paper wasps show more complex social behaviors.

Tibbetts was intrigued to discover whether these behaviors had any bearing on TI, and investigated by training wasps to discriminate between different pairs of colors.

She found the wasps quickly and accurately learned the pairs, and were later able to use what they had learned to organize a hierarchy of colors when confronted with new pairs of colors.

"This study adds to a growing body of evidence that the miniature nervous systems of insects do not limit sophisticated behaviors," Tibbetts said in the release.

"We're not saying that wasps used logical deduction to solve this problem, but they seem to use known relationships to make inferences about unknown relationships."

Tibbetts believes the explanation may lie in the differing social behaviors of paper wasps and honey bees.

While a honeybee colony has a single queen and multiple female workers of equal rank, paper wasp colonies are home to multiple reproductive females, called foundresses, which compete for dominance.

In such a situation, TI would help wasps make quick deductions about social interactions.

This means they can build and manipulate an implicit hierarchy, helping them to live in the colony, the press release said.

"Our findings suggest that the capacity for complex behavior may be shaped by the social environment in which behaviors are beneficial, rather than being strictly limited by brain size," said Tibbetts, who has been researching wasp behavior for 20 years.

Gavin Broad, Principal Curator in Charge (Insects) at the Natural History Museum in London, agrees with these conclusions.

"The paper wasps in the study are more flexible than many wasps (or indeed honey bees) in their ability to transition from being workers to queens," Broad told CNN via email.

"So dominance hierarchies are important to these paper wasps as the workers can become the queens, whereas a worker honey bee can never become a queen."

Broad also pointed out that wasp society is entirely female, and males don't contribute to social dynamics.

Tibbetts told CNN via email that the next step is to study how wasps use TI in social interactions, including figuring out their relative strength without fighting a rival.

"For example, if a wasp saw Jane win a fight with Lisa and that wasp had previously won a fight with Jane, the wasp could infer that she could probably beat Lisa," said Tibbetts, who added that other animals use TI in this way during social interactions.

In a previous study, Tibbetts showed paper wasps can recognize variations in facial markings and are more aggressive toward wasps with unfamiliar markings.

And another piece of her research found the insects use memories of previous social interactions with other wasps to determine their behavior, relying on surprisingly long memories.