What do Donald Trump and a bee hive have in common?

While this might sound like the setup to a bad joke or bit of political punditry, it’s an important and meaningful academic question. To a collective behavior scientist, electing a president or choosing a new nest site are both choices that arise from the interactions of a large number of individuals.

WIRED OPINION About Joe Bak-Coleman (@jbakcoleman) is a Ph.D. candidate in ecology and evolutionary biology at Princeton University, where he is studying collective behavior.

When bees need to find a new nest site, scouts will visit several potential locations. When they return, if they like the site they dance excitedly in a way that tells others where it is located. This dancing may recruit more scouts to check out the site, who likewise visit the site and start dancing to express support for the location. Bees will butt heads with dancers advocating for an opposing location. Through these interactions, they eventually settle on a nest site, often a very good one. The amazing thing is that this process allows a hive to measure the relative quality of nest sites, without any single bee knowing which is best.

It's not hard to draw parallels between selecting a nest and selecting a president. We each have a candidate we support, often without full information about the variety of options, and we still excitedly post to Facebook. Our goal is to recruit others to in turn support our candidate and spread our beliefs.

On face value, this is encouraging. If bees can find the best nest, can't we find the best presidential candidate? Indeed, animal groups often make extraordinary collective decisions that go far beyond the abilities of any single individual. The idea that groups can make collective decisions more successfully than individuals is known as the "wisdom of the crowd" and is arguably why we vote, have juries, and fill boardrooms.

Unfortunately, the power of collective decision-making is fickle. For instance, if individuals are wrong on average, their collective decision-making processes select the worse of two options. In complex environments with multiple sources of information, sometimes small groups are better than large ones. Even individuals with no preference whatsoever can have striking impacts on the group-level decisions. These are just some of the myriad of ways in which the wisdom of the crowd isn’t so straightforward.

Imagine for a moment, that exactly half of the bees see dances for one site, and half for another. Without crucial interaction between both sides, since they're split evenly they risk becoming deadlocked. If they are forced to decide, their selection would likely be random, even if the original quality difference was massive.

Could the same thing happen with elections? It's well known that companies like Google and Facebook measure the political leanings of their users, something that makes financial sense. But what do they do with this data? Even seemingly benign decisions could have disastrous collective consequences.

Centering is arguably one of the more commonplace and generally innocuous data science procedures. It involves removing the average from your data so that it is split evenly around zero. Many machine-learning algorithms, such as those that are likely used by Facebook and Google, rely on centered data and behave poorly without it. A reasonable data scientist might apply centering to political leanings, particularly in a bipartisan society. But what happens if they then use this centered metric to preferentially display news stories?

Going back to our honeybee example, this practice is effectively the same as dividing the hive evenly into two groups and only showing either side one option. It's possible that such a simple, reasonable data science decision could push the system toward evenly split political beliefs. Beyond simply creating an echo chamber, this would explicitly remove all leaning of the system toward a better option, making election results effectively random. A line of code could shift an electorate.

Unfortunately, most social media sites aren't open source, so it's impossible to know what decisions they've made. Centering, echo chambers, and fake news represent only a few of many plausible ways in which social media might have meaningful and unexpected consequences. The notion that social media has no measurable impact on elections is beyond far-fetched. The elephant in the room is whether or not they make for better, worse, or simply more random collective choices. Where are they taking us?

What is alarming is that we simply have no idea. Tackling these types of questions is at the heart of the quickly growing field of collective behavior. Scientists are developing tools and mathematical models to make sense of the very complex data inherent to these systems. Whether or not we solve global warming, reduce human suffering, and avoid nuclear war are all ultimately questions about collective behavior. The importance of understanding how we make decisions, and how these decisions are shaped by technology, is difficult to overstate.

One of the more beautiful and haunting collective phenomena is that of ant mills, or "death spirals." When separated from the trail, large groups of army ants occasionally begin to march in a circle until they die of starvation, each dutifully following the pheromone trails of the ants laid out ahead of them. The simple rules that they've evolved to follow, which generally lead to astonishing feats of collective behavior, can ultimately doom them under the wrong circumstances.

Today, it's not clear if social media is pushing humanity into a death spiral or pulling us out of one. Understanding how technology shapes human collective behavior is a very hard scientific problem. Swarms, flocks and schools provide valuable insight into how individual decisions lead to group action. It has never been more important to understand what humans and bees have in common.