Nobody likes to wait in line. Whether you are sitting in your car waiting to reach the toll booths, on a plane waiting to disembark along with the other passengers, or in a queue at the ticket office, you may experience a range of feelings ranging from perplexity (“What am I doing here?”) to impatience (“Why is this not moving forward?”), to annoyance (“What is that idiot in the front chatting about with the operator?”). 

Nobody likes to wait in line.
Whether you are sitting in your car waiting to reach the toll booths, on a
plane waiting to disembark along with the other passengers, or in a queue at
the ticket office, you may experience a range of feelings ranging from perplexity
(“What am I doing here?”) to impatience (“Why is this not moving forward?”), to
annoyance (“What is that idiot in the front chatting about with the operator?”). 

The loathing of queues is so universal that we are willing to part with
significant amounts of money to avoid them, buying line-skipping privileges
such as preferred membership cards or priority access benefits. Yet sometimes
we still must bite the bullet and wait right there. Usually we try to keep
calm, enjoy the environment or our company, or find something constructive to
do, like texting on our mobile phone or checking our reachable orifices. Still,
there is an objective loss of time involved. 

What’s worse, we are often pressed
to make choices that may reduce or increase that loss. Change lane? Take a
detour? Purchase some free pass on the fly with a web app? Decisions need to be
taken! What to do? There are no catch-all guidelines that minimize our waiting
time. However, if we study the typical situations, we may get
insight in what can be the best strategies to follow. 

Below I will consider two cases: queueing at the airport security check, and queueing on the highway.

At the airport

As a first case, let me describe here
the following situation, which is a template for many similar setups. When I
fly out of my local airport I find myself facing a riddle. There are two arrays
of x-ray luggage scanners on two sides of the access to the gates area. The
number of scanners in operation is different on the two sides; in addition, sometimes
a scanner is temporarily disabled to give rest time to the personnel operating
it. As I approach the area I quickly assess the situation, often getting my
brain busy with a question like the following: “There are two operating
scanners on the left, with 10 people waiting in line, and seven on the right,
with 42 people waiting in line; where should I queue up?” (Yes, I do count
people ahead of me in the queues, don’t we all?)

Of course, the above
question is a not terribly interesting one, as in typical situations I am not
in any danger of losing my flight if I end up taking the “wrong” decision; the
only loss I may sustain is the time idly spent waiting for my turn at the
scanner. While I do, in general, detest losing time, in truth all I would be
able to do with the spare minutes would be to spend them comfortably seated in
the waiting area beyond the security controls. Yet it does not harm trying to
take a principled decision on which queue to pick. With the data given above, and
ignoring for the time being the possibility that the number of active scanners changes
while we are waiting in line, a simple calculation should do the job: just
compute the number of customers per scanner. 

Assuming that the customers in the
left and in the right queue take the same time at the controls (but advanced
life hackers might indeed scan for obvious laggers, like persons with
disabilities, families with small children, or suspicious-looking weirdos with
electric wires protruding from their shoes or bags, and assess the situation
according to that additional information!), we should queue on the left side,
as there are fewer customers per scanner there: 10 people for two scanners is 5
per scanner, against 6 (42 people for 7 scanners) on the right. Simple, and
usually effective – a pair of trivial divisions are enough to solve the problem.

Yet, sometimes
one is not interested in optimizing the average queueing time, which the above solution
correctly does. Rather, there are cases when all we care about is to minimize
the chance that the queueing time ends up being way too long, causing us to
miss our connection. In that case our expected loss is not quantified by the
waiting time, but rather by the probability that the waiting time becomes
larger than a certain threshold – say, 15 minutes. That is to say, we are
equally happy if we end up waiting 10 or 5 minutes, and formally assign a null
loss to both events; on the other hand we incur in a large loss if we take over
20 minutes to pass the controls. 

The new problem above is entirely different from
the previous one, and its solution is naturally also quite different. Indeed,
as is often the case with statistical calculations, the correct answer
crucially depends on the details of the question being asked. So an interim
point to make here is that we should avoid being tricked into confusing
apparently similar problems – the devil is in the details! In the case at hand,
the second problem is decidedly harder to solve than the first, as its solution
depends on unknown parameters we have no good knowledge of. For a meaningful
calculation we not only need the average scanning time per customer, which after
all we may easily guesstimate from previous experience or by observing the
situation for a little while; crucially, we also need the probability distribution of that quantity, and specifically, the relative
fraction of infrequent, very long control times. What we need now, if we want
to take an informed decision, is to cook up a full model of that distribution. Let me explain why that is so, by
considering two different models.

               Imagine an idealized situation
where all travelers take the same time to clear the security controls; make it
2 minutes each. With the numbers above it makes no real difference if we take
the queue on the left or the one on the right: in the first case we will wait
for 10 minutes before it is our turn (5 customers times 2 minutes), in the
second we will wait for 12 - hence we are in both cases going to catch our
flight without sweating. On the other hand, suppose that there are two kinds of
customers: most of them clear security in 2 minutes as above, but a small
fraction of them –say, 5%- will raise some uncommon issue that will keep the
scanner and the attending personnel busy for, say, 5 minutes. This could be due
to something anomalous they may have unwittingly stored in their carry-on
luggage, or result from the need of a more detailed search, as e.g. if
they have a pacemaker and cannot go through the scanning machine. 

It is
possible to make a careful computation of the exact expected wait time on each
of the queues due to the possible presence of this special kind of customers,
but we will omit to do so here, as it would be rather complicated and not
terribly informative. Instead, let us only assume that special customers
practically block the scanner they are going through, forcing all other
customers to go through the remaining ones. If we are on the queue on the left,
there is roughly a 50% chance that one of the 10 customers ahead of us is a
special one.

[The exact odds are computed as follows: we want to know what is the chance that at least one customer blocks the queue; this is one minus the chance that no customer blocks the queue, so it equals 1 – (0.95)10, or 0.401.]

If indeed that happens, our expected queueing time suddenly grows by a
significant amount, as all the other customers have to rely on the one
remaining scanner. While our total expected wait does not actually double, as
the lagging customer might be one of the last of the set (so that it
“obliterates” one scanner only for part of our wait), the damage we incur in is
significant – our expected loss is large, as we have a more significant chance
to lose our connection after all! Instead, if we are on the queue on the right,
there are on average 2.1 lagging customers in the set of 42 ahead of us. Again,
a precise calculation of our average waiting time is complicated, but we can
simplify it. Assume two problematic passengers block one scanner each. The 40
other travelers would distribute on the five remaining scanners, so we should
expect to clear security in less than 20 minutes anyway: our expected loss, if
we wisely chose the queue leading to a larger pool of scanners, is smaller.

The above example glosses
over a lot of detail, but the general message can be summarized as follows:
sometimes we have a chance to take logical decisions with relative ease if we
develop the habit of considering our expected loss in the various possible
situations that could arise. Doing so will improve our quality of life: by
computing the number of customers per scanner in the first example, we may correctly
decide to queue on the left. 

In certain situations, however, we require a more
detailed understanding of the system to take the correct decision. As we
usually lack the necessary information, we need to consider some simplified
model of the system. Above, we did so by considering the potentially disruptive
effect of special customers on our chance to clear security in less than 15
minutes.  We had to guess the rarity of
such customers to make an approximate calculation of our expected loss if we
chose either queue; this led us to prefer the queue on the right, leading to a
larger number of scanners. The decision we took is correct, if our model is
right. If the model is badly wrong, our decision may be wrong, too; yet it is
important to be rational and act according to our understanding of the world
around us: chances are we will be better off. And in any case, by acting
according to our beliefs, we will acquire the serenity of knowing in our bones
that we did all we could in the situation we were facing, and we acted
coherently with our beliefs. As another side note, it should also be clear that
the more precise is our knowledge of a system, the more precise can be our
assessment of our expected loss following a decision. Information is like a
special kind of currency, which is only valuable to those who can use it!

[The second part of this two-part post is here]

Tommaso Dorigo

Tommaso Dorigo is an experimental particle physicist, who works for the INFN at the University of Padova, and collaborates with the CMS experiment at the CERN LHC. He coordinates the European network AMVA4NewPhysics as well as research in accelerator-based physics for INFN-Padova, and is an editor of the journal Reviews in Physics. In 2016 he published the book "Anomaly! Collider physics and the quest for new phenomena at Fermilab". Read more