Joe Raedle/Getty Images

Think of all the time that you’ve ever spent waiting in line. How many hours have you spent waiting to board an airplane, get a table at a restaurant, use an ATM or a bathroom, or talk to a customer service representative?

The typical first-come, first-serve system of waiting in line is incredibly inefficient, in terms of both time and space. First, it essentially rewards people for wasting their time: Those who arrive first get the goods, but they also spend more hours of their precious time on Earth standing around and waiting. Second, long lines tend to create congestion and bottlenecks that cause problems for others. Think of the traffic jams that form as cars try to leave a football game, or the long boarding line at an airport that snakes across the walkway, getting in everyone else's way.

In fact, there are far more efficient solutions out there than the standard system of waiting in line. But you're probably going to hate them.

Two Danish researchers have used the economic discipline of game theory to weigh the costs and benefits of some different methods of waiting in line. The paper analyzes three different systems for waiting in line: the usual first-come, first-serve system; one in which people are served in a random order, regardless of when they arrive in line; and a backwards-sounding idea called a “last-come, first-serve system” that actually serves those who entered the line most recently first. Their research shows that the typical first-come, first-serve system is the least efficient, while the maddening last-come, first-serve system is the best.

In all cases, the researchers were thinking of a situation where a limited number of people begin being served at a given point in time – like people waiting to board an airplane. The people who are doing the serving -- i.e., the airline employees -- have a fixed capacity, meaning they can only serve a limited number of people per minute. If a bunch of customers arrive at the same time, a bottleneck will form. The researchers assume that everyone in line has two goals: They want to be served as early as possible, but they also want to spend the least amount of time in line that they can.

When it comes to accomplishing these goals, the researchers clearly find that the standard, first-come, first-serve system is the worst of the three systems. The system in which people are served in a random order regardless of when they arrive performed somewhat better, while the last-come, first-serve system turned out to be the most efficient. (It’s kind of difficult to picture how a last-come, first-serve model would work in practice. But it's easier to understand if you think of virtual line, like people waiting for service online or on the phone, where the person who calls in most recently gets served first, as customer service people become available.)

The difference is that the first-come, first-serve system incentivizes people to spend their time waiting in line, while the last-come, first-serve system penalizes people for it. The first-come, first-serve system basically sets up a trade-off between the order in which people are served and the amount of time they have to spend in line. Customers can choose to a) get served early and spend a lot of time waiting or b) skip the line, but be served late. The last-come, first-serve system, on the other hand, punishes people for something they hate doing anyway: waiting in line. Instead, it incentives people to space out their arrivals, coming exactly when the system has the capacity to serve them, and not before.

Even so, we're unlikely to see the last-come, first-serve system pop up in airports, or anywhere else, anytime soon. First, there are some practical obstacles: In many situations, it would be hard to stop people from “leaving” the line and rejoining it later, to reduce their wait time. But there's another, more important objection to the practice: As numerous studies in behavioral economics have shown, people often care more about fairness than they do about efficiency, even when it costs them personally.

The way you get people to line up is an important business question: McDonald's, Disney World and other companies stand to make a lot more money by moving people through lines more quickly.

In some cases, companies have found new approaches to lessen lines -- for example, Apple asking customers to register online for an appointment at the Genius Bar, or airlines dividing people into different boarding groups. But many companies are still faced with the situation that the Danish researchers studied above, in which a big group of customers arrive in line at the same time, creating a bottleneck. And in many situations, companies have found that, while customers hate waiting in lines, there are other practices that they hate more.

For example, most businesses can serve people more quickly if customers form several parallel lines, rather than one long line. Say there are four cashiers at a fast food restaurant. This would mean customers would form four short lines in front of each, instead of one long line in which the person at the front goes to the next available register.

The short lines actually allow businesses to serve customers more quickly. But Richard Larson, a professor at MIT who studies lines, argues that the anger and stress that customers feel in this situation -- trying to figure out the best line, and then agonizing over their choice if another line moves faster -- outweighs any time benefit.

There are other benefits to having one long line, rather than several short ones. Studies suggest that consumers waiting in line care more about the feeling of motion than the actual wait time. So people tend to prefer one long, serpentine line, in which they will move slowly but continuously forward, rather than several short lines. Wendy's, American Airlines and Citibank have all been proponents of this method. Giving people an estimated wait time and distracting them with videos and diversions, as Disney does for the people waiting for its rides, also helps to quell stress and anxiety.

Our illogical thinking about waiting in line extends to other situations -- for example, the way cars in two lanes merge into one lane. Often, drivers will move over into one lane and form one long line that begins far before they actually need to merge.

Actually, it's far more efficient if cars remain in two lanes, and then merge when they need to, and not before. This is called a “zipper merge” because cars in the two lanes alternately join together like the teeth on a zipper. Many states have tried to implement it, but drivers have been slow to catch on. Most drivers continue to see those who zoom ahead and merge later, rather than getting in line, as rude and unfair.

Waiting in line might be frustrating, but most people find it more bearable than the alternatives.

You might also like: 

-Why half of the life you experience is over by age 7

-How tiny, individual biases have huge cumulative effects on racial segregation

-The dirtiest places on an airplane, ranked