There's a mathematical formula for choosing the fastest queue

May 8, 2017 by Enrico Scalas And Nicos Georgiou, The Conversation
Credit: Shutterstock

It seems obvious. You arrive at the checkouts and see one queue is much longer than the other, so you join the shorter one. But, before long, the people in the bigger line zoom past you and you've barely moved towards the exit.

When it comes to queuing, the intuitive choice is often not the fastest one. Why do queues feel like they slow down as soon as you join them? And is there a way to decide beforehand which line is really the best one to join? Mathematicians have been studying these questions for years. So can they help us spend less time waiting in line?

The intuitive strategy seems to be to join the shortest queue. After all, a short queue could indicate it has an efficient server, and a long queue could imply it has an inexperienced server or customers who need a lot of time. But generally this isn't true.

Without the right information, it could even be disadvantageous to join the shortest queue. For example, if the short queue at the supermarket has two very full trolleys and the long queue has four relatively empty baskets, many people would actually join the longer queue. If the servers are equally efficient, the important quantity here is the number of total items in the queue, not the number of customers. But if the trolleys weren't very full but the hand baskets were, it wouldn't be so easy to estimate and the choice wouldn't be so clear.

This simple example introduces the concept of service time distribution. This is a random variable that measures how long it will take a to be served. It contains information about the average (mean) service time and about the standard deviation from the mean, which represents how the service time fluctuates depending on how long different customers need.

Never mind the queue, I picked the wrong shop. Credit: Shutterstock

The other important variable is how often customers join the queue (the arrival rate). This depends on the average amount of time that passes between two consecutive customers entering the shop. The more people that arrive to use a service at a specific time, the longer the queues will be.

Depending on what these variables are, the shortest queue might be the best one to join – or it might not. For example, in a fish and chip shop you might have two servers both taking orders and accepting money. Then it is most often better to join the shortest queue since the time the servers' tasks take doesn't vary much.

Unfortunately, in practice, it's hard to know exactly what the relevant variables are when you enter a shop. So you can still only guess what the fastest queue to join will be, or rely on tricks of human psychology, such as joining the leftmost queue because most right-handed people automatically turn right.

Did you get it right?

Once you're in the queue, you'll want to know whether you made the right choice. For example, is your server the fastest? It is easy to observe the actual queue length and you can try to compare it to the average. This is directly related to the mean and of the service time via something called the Pollaczek-Khinchine formula, first established in 1930. This also uses the mean inter-arrival time between customers.

The inspection paradox

Unfortunately, if you try to measure the time the first person in the queue takes to get served, you'll likely end up feeling like you chose the wrong line. This is known as Feller's paradox or the inspection paradox. Technically, this isn't an actual logical paradox but it does go against our intuition. If you start measuring the time between customers when you join a queue, it is more likely that the first customer you see will take longer than average to be served. This will make you feel like you were unlucky and chose the wrong queue.

The inspection paradox works like this: suppose a bank offers two services. One service takes either zero or five minutes, with equal probability. The other service takes either ten or 20 minutes, again with equal probability. It is equally likely for a customer to choose either service and so the bank's average service time is 8.75 minutes.

If you join the queue when a customer is in the middle of being served then their service can't take zero minutes. They must be using either the five, ten or 20 minute service. This pushes the time that customer will take to be served to more than 11 minutes on average, more than the true average for the of 8.75 minutes. In fact, two out of three times you encounter the same situation, the customer will want either the 10 or 20 minute . This will make it seem like the line is moving more slowly than it should, all because a customer is already there and you have extra information.

So while you can use maths to try to determine the fastest , in the absence of accurate data – and for your own peace of mind – you're often better just taking a gamble and not looking at the other options once you've made your mind up.

Explore further: To queue or not to queue?

Related Stories

To queue or not to queue?

September 22, 2008

If there's one thing that separates humankind from the animals, it's that human beings wait in lines. To make a deposit at the bank, to pay for groceries, even to vote -- we've all learned to queue, one behind the other. ...

A quick fix for queues

June 1, 2010

Queuing, standing in line... it's what we do well, but complain about the most. Thankfully, science is coming to the rescue as researchers in Taiwan have devised a formula that could revolutionize restaurants, post offices, ...

Researcher works to optimize data storage

August 5, 2016

Most of us have seen the "Not Enough Storage" message on our smart phone or tablet. Cloud computing services provide a way to alleviate this overwhelming need for space by letting programs store their data on remote servers ...

Recommended for you

T. Rex couldn't stick out its tongue, new research shows

June 20, 2018

Dinosaurs are often depicted as fierce creatures, baring their teeth, with tongues wildly stretching from their mouths like giant, deranged lizards. But new research reveals a major problem with this classic image: Dinosaurs ...

2 comments

Adjust slider to filter visible comments by rank

Display comments: newest first

kenknudson
May 08, 2017
This comment has been removed by a moderator.
TheGhostofOtto1923
not rated yet May 08, 2017
What is the variable for the little old lady who has to write a check but she cant find her wallet in the bottom of her bag because she forgot she just sat it on the counter?

Please sign in to add a comment. Registration is free, and takes less than a minute. Read more

Click here to reset your password.
Sign in to get notified via email when new comments are made.