Supermarket Queues

This activity introduces the ideas of queueing theory and simulation. As a class, students will simulate a supermarket queueing system with 2 servers, first with a single queue and then with 2 separate queues, 1 for each server.

Introduction

Show students pictures of the queueing system at a supermarket (where there are separate queues for each server) and at a bank/post office (where there is a single queue leading to multiple servers). Ask students what the difference between the two systems is.

At a bank there is a single queue; when you get to the front of the queue you can go to any of the servers, whichever one is available first. At a big supermarket there is a separate queue for each server and you have to decide which queue to join.

The difference is that with separate queues you have to make a decision about which queue to join.Some people don’t like having to make this decision and feel like they never choose the right queue. What do you need to think about when you decide which queue to join?

Ask students why supermarkets have this system with separatequeues for each server.

Activity

Explain to the class that they will be performing an investigation. A local supermarket wants to know if the mean wait time for customers would be reduced if the supermarket changed to a single queue.

To answer this question students will use simulation. Explain that simulation is a technique used frequently in business when an organisation wants to change or improve some process. Organisations will build a computer simulation of the problem in order to predict what will happen. By using simulation they save all the time and money of actually changing anything in real life and are able to try many different things to see what the effect is / what the best solution is.

Ask students to think about why pilots are trained using flight simulators. It would be very expensive and very dangerous to train pilots ‘on the job’.

It is impossible to recreate a problem exactly so the problem must be simplified in order to be able to simulate it. How well the simulation results apply to the real problem depends on the assumptions made when creating the simulation model i.e. how accurately the model represents the real problem. So long as the assumptions are reasonable then the results should apply to the real problem.

This exercise makes many assumptions about how the queueing systems would work in real life. One assumption is that there is only one kind of checkout that serves everybody; in real life there are different kinds of checkout like basket and self-service checkouts.We also assume that there is no time delay between events like customers going from the front of the line to the available server i.e. everything is instant.

Some examples of where simulation is used include predicting the weather at the Met Office, predicting how many people will become infected during a flu outbreak, predicting the flow of people on match day when designing a new sports stadium, predicting how many staff you need at airport customs.

Some examples of simulation models to show the students, perhaps to finish:

A&E -

Burger restaurant -

Flumodel -

Nightclub -

Photocopy -

Petrol -

Now students will simulate the two queueing systems by acting them out. To make the exercise simple we will assume that there are only 2 servers.

For each queueing system (1 queue or 2 queues) we will have 2 students acting as servers and 10 students acting as customers. More customers can be included to ensure that each student gets to take part once.

Create the following two tables on the board side by side for the two different queueing systems.

(Delete any rows as required)

First simulate the single queue system. Select 2 students to act as servers. Give 10 students (who will be customers) an activity worksheet (from Supermarket Queues Activity Worksheets.docx).

Each activity worksheet has a different letter. There are two tables for the customers to fill in as they simulate the two queueing systems.

Set up a table for the servers, ideally near the board, with room in front for the customers to queue.

Keep count of the time for the class by shouting out each minute (or writing it on the board). Each minute ask if any customers are leaving or finishing.

When it is a customer’s time to arrive they will join the queue.

As each customer goes through the queueing system they can record their service start time, their wait time and their finish time on their activity worksheet.

Explain why the wait time (i.e. the time spent in the queue) is the difference between the arrival time and the service start time.

Each customer will join the queue (if there is one) when it is their arrival time. Then they go to whichever server is free first when they get to the front of the queue. When they reach the server they can write down their service start time.

The servers are each given a copy of the following table containing service times for each customer. (Supermarket Queues Activity Worksheets.docx).

Customer / Service Start Time / Service Time / Finish Time
A / 4
B / 2
C / 5
D / 3
E / 2
F / 6
G / 2
H / 3
I / 2
J / 1
K / 3
L / 1
M / 3
N / 1

The servers will write down each customer’s service start time when they reach the server. Then they can write down the finish time (by adding the service time to the service start time) and it is their job to tell the customer that they are finished when the time comes (preferably with a “thank you” and “have a nice day!”).

When the customers leave the queueing system they go up to the whiteboard and fill in the table with their times. Collect the activity worksheets from students to distribute to other students for the second simulation.

When every customer has written their times on the board, calculate the mean wait time.

Now the class will simulate the 2 queues system i.e. a separate queue for each server. Select 2 different students to act as servers and hand out the activity worksheets to 10 different students.

The only difference now is that when a customer arrives they must decide which queue to join as quickly as possible and they are not allowed to change.Perhaps get all the students to shout out which queue they think the arriving customer should pick.

Calculate the mean wait time and compare it with the mean wait time for the single queue system.

Note that the wait times for 1 queue should always be the same but the wait times can be different for 2 queues since they depend on the decisions made by each customer.

It may be easiest to explain how this exercise works as the first couple of customers go through the system.

Have any finishing customers leave before any new customers arrive so that when a customer has to make a decision about which queue to join it is clear how many customers are in both queues at that minute. If more than one customer is arriving at the same minute try to have them arrive in alphabetical order, for example two customers arrive on minute 11 but customer F arrives before customer G.

Comparison of the 2 Systems

The points below should cover everything needed for the Supermarket Queues Questions Worksheet.docx.

Theoretically, the two queueing systems should give the samemean wait time.It is more likely though that one queueing system will give a shorter mean wait time than the other. Explain that although this is the correct method (simulation) of tackling this problem, we cannot be confident that one system gives shorter wait times than the other based on our results since there are so few customers. A real life computer simulation model would simulate months and thousands of customers to ensure the results were reliable. As we simulate more customers the mean wait times should start to match up. This is similar to the idea that you might not get 50% heads if you do 10 coin flips but as you do more and more you should get closer to 50% heads.

Although one system will give a shorter mean wait time, it will not give the shortest wait time for each customer. Some customers will have shorter wait times with the 2 queue system and some customers will have longer wait times. This is due to the fact that everybody has to make a decisionabout which queue to join and some people will make the right decision and some people will make the wrongdecision. In real life it is impossible to predict how long people before you will take. With separate queues there are winners and losers.

Normally a customerwill have a shorter waiting time with 2 queues because somebody before them made the wrong decision. If the customer before you doesn’t make the optimal decision for them then you get a chance to take that place and start service before them. It is not necessary to find an example of this in our simulation since it may be difficult to find by looking back through the table.

Compare the service start times for the customers. In the single queue system every customer is served in the same order that they arrive in. However this should not necessarily be the case for the separate queues system. Customers who arrive later than other customers may start service before them. For this reason the single queue system can be considered fairer.

You can also talk about variability andcompare the standard deviations of the waiting times for the two queueing systems. You should find that the waiting times are more variable in the second system (2 queues). This is because you can get stuck in a slow moving line with 2 queues but with 1 queue there isn’t a slow line. This can feed into the idea that the single queue system is fairer i.e. everybody’s wait times are more similar.

Ask students why supermarkets have this system with multiple checkouts.

Reasons for multiple queues:

A single queue can take up more space in a supermarket, meaning less room for things to sell.

A single queue will contain a lot of customers and will look very long which may put customers off and decide not to join the queue.

Multiple queues means customers are able to queue for their favourite server.

Multiple queues means customers can save time byqueueing for a server early (before the server is free) and loading their shopping onto the conveyor belt while they wait. In a single queue, customers would have to wait until a server is empty before going to that server and then unloading their shopping. So the server is idle while the customer walks from the queue to the server and then unloads their shopping which can take a long time if there are lots of servers (big distance from the queue to the server on the end) and people are buying lots of items.

The last reason involves some assumptions we made when performing the simulation. We assumed that no time was wasted when going from the queue to the server or when unloading your shopping.

Note that this is less of a problem in small supermarkets or corner stores (where there are less servers and people buy fewer items) hence why most small supermarkets have a single queue.

Reasons against multiple queues:

A single queue can be considered fairer since customers are served in the same order as they arrive.

A single queue makes sweethearting (shoplifting in collusion with a server) harder since the server you go to is random.

More difficult to walk off in single queue sinceit’s more likely that there will be customers directly behind you.

To conclude: the mean wait time in both queueing systems should be approximately the same although the variance should be higher in the multiple queues system. Therefore a single queue system might seem like the better system since it is fairer (i.e. customers are served in the same order that they arrive in and there’s no pressure of making the right decision). However,for a large supermarket there are reasons why separate queues may be more practical. Though it should be noted that there are some large supermarkets that do operate with a single queue.

It may also be worth noting again that in reality supermarkets have lots of different kinds of checkouts includingself-service checkouts which usually have a single queue.

Notes

Instead of having students complete the worksheet students can be asked to write a report for the supermarket manager which should include advantages and disadvantages of both systems and a recommendation for which queueing system is most suitable.

Perhaps complete the exercise first and then explain to the students what simulation is – they’ve just done it!

An alternative is to split the class into two separate groups and have them perform both simulations. In this case print the tables for the groups to fill in and have the servers keep time for everybody. Or have onestudent in charge of keeping time for everybody and making sure everybody recordstheir times.

See below for the completed table for the single queue system.

See below for two examples of the completed table for the separate queues system, the left table with a shorter mean wait time and the right one with a longer mean wait time.