Nautilus Members enjoy an ad-free experience. or Join now .

Now is not the time to go to the grocery store, to restock the pantry, to get fresh milk and eggs. Yet I need to replenish my food supplies. Well then, I should go. Wait, is everyone else thinking this same way? Then everyone would go. I shouldn’t go. But then everyone would do the same and the store would be empty. I should go. I seem to be stuck in a loop.

Is there a way out of it?

Nautilus Members enjoy an ad-free experience. Log in or Join now .

An approach would be to apply game theory. In 2001, the film A Beautiful Mind was released. Based on the book by Sylvia Nasar, it chronicled the life of mathematician, economist, and cryptologist John Nash, the innovator of the Nash Equilibrium, the founding concept of game theory, a field of study for mathematical modeling to determine possible outcomes and how people make decisions. I bet you’ve played rock, paper, scissors. But have you wondered if there is a winning strategy? Well, game theory is the field of study that searches for, and sometimes finds, that winning strategy. Winning is a strong word—really you are finding the strategy that you cannot improve on. For rock, paper, scissors, you would use a mixed strategy (meaning you can be random) of throwing each choice a third of the time.

It turns out that deciding whether to go to the grocery, and when, was solved using game theory in 1994 by W. Brian Arthur—he just did not know it. He figured out what he called the El Farol Bar problem, based on a Santa Fe bar that had a popular music event on Thursday evenings. The problem assumes a group of 100 people who do not know what the others will do. In this problem, if more than 60 people (60 percent) show up, the overcrowding in the finite space would cause a displeasing evening. Guests will have a more enjoyable time if they stay home. Yet if less than 60 people show up, the attendees would have a better time going than staying home. They want to go, but not if the bar is too crowded. They need to decide. Below is the payoff grid for the two-player El Farol Bar problem.

Nautilus Members enjoy an ad-free experience. Log in or Join now .
If a player stays home, they receive a payoff of 0. If one player goes and the other does not, they receive a payoff of ‘x.’ If both players go, they have a bad time and receive a negative payoff of ‘y.’

That sounds familiar. I do not want to go to the grocery store if it is crowded. In fact, I want to social distance and be sure I will have six feet, on all sides, to myself. In order to convert the El Farol bar problem into a form for deciding my pandemic-shopping problem, I will need some information. Hopefully, Fermi estimation (a back of the envelope method for getting within an order of magnitude for a mathematical problem) will allow me to be approximately right and smooth out the roughness of these numbers. 

First, I need two key numbers: how many people I am comfortable with being at the grocery if I go, and how many people want to go to the grocery. My first assumption is that shoppers want to abide by social distancing. That being the case, everyone’s maximum acceptable number of people in the store will be the same, just as in the El Farol bar problem where no one would have fun if more than 60 people showed up. To find that key number I start with a six-feet radius around myself and calculate the area of the circle, which is about 113 feet squared. 

Next, I need to find the square footage of the store. I measure the outline on an Internet map; but wait, these groceries have a big storage area, and lots of aisles and fixtures. I will need to subtract them from the overall store square-footage. Fortunately, the fire code’s occupancy limit already factored those in. Using the store square-footage and the fire-code occupancy limit, we can determine the store has a maximum occupancy of 650 people. For example, in my home state of Virginia where I go shopping, they started using the International Building Code in 2015. It recommends 60 feet squared per person on the floor of a mercantile building. Converting that figure to 113 square feet per person gives a social-distancing occupancy of about 345 people. Below are the calculations for determining the social-distancing occupancy load for the store. 

Nautilus Members enjoy an ad-free experience. Log in or Join now .

SQFT / OLF (Occupant Load Factor) = OL (Occupant Load)
(OL x OLF) / OLF’ = OL’
(650*60) / 113 = 345

The second key number is the number of people who are going to the same store as me. This one is a bit tricky, but luckily Google maps can estimate a location’s popularity. It’s not a very accurate figure, but I will use the normal max load for the most popular times and a current popularity of about 60 percent. I end up with 390 people interested in going.

The game theory mixed-strategy solution is where the payoff from going to the bar (x) and the payoff from staying home (y) are set, through probability (p) of choosing between them to be equal. Satisfying the equations:

x(1-p) – yp = 0 (number of people that want to go) p = (max number)

Nautilus Members enjoy an ad-free experience. Log in or Join now .

For the N-player version, with the same payoffs for everyone:
P (at most max number go) = yy + x

However, if the individual payoffs, and thus individual probabilities, form a probability distribution with a µ of p, the payoffs do not have to be equal because each person can determine how valuable it is for them to go shopping during a pandemic. In other words, if a shopper deviates from their strategy the distribution will change. If we assume rational mixed strategies for the other shoppers, we would on average get the same number of shoppers at the store so long as their personal odds are within the probability distribution. 

Solving these equations leads me to a mixed strategy when I would go to the store 88 percent of the time. This is a high probability, but I decided to use a random number generator anyway. Popping over to Wolfram Alpha (a math solving web application) and plugging in rand(0,1), which is a function that will output a random number between 0 and 1, got me a .366 (or 36.6 percent) which is less than the p of .88 (88 percent). This means it is time to go shopping because our probability of going shopping was 88 percent and a number below .88 means we should go shopping. A number above .88 would instruct us to stay home. 

I hope that their distribution is flat, because only a flat distribution works for using a number below the .88, and any number below .88 would indicate we should go shopping. But the demand for going to the store is about to change, as we are basing it on the fact that the popularity of shopping changes with the time of day.

Nautilus Members enjoy an ad-free experience. Log in or Join now .

As the pandemic continues, we are all trying to figure out when it is our turn to use the resources and services we are so used to. I think many of us have changed our focus from our needs, to our health, to how our health affects others’ health. The better decisions we each can make, the less the decision-making burden will be on strained governments around the world. We can learn to apply good recommendations, wisely, with a little help from math and game theory.

I ended up using the results of the model to make my decision, which was to go to the store. I did not believe that people would try to outthink the problem, and my observation had been that most people were doing a very good job at following the CDC and task-force guidance. So, I gathered my pandemic shopping kit, including face covering, latex gloves, disinfectant wipes, and hand sanitizer and headed to the store. The model worked. The store was not overly crowded, so I was able to buy what I needed while maintaining the recommended social distancing. 

It looks like the El Farol Bar problem is a suitable model for shopping during a pandemic. By using this methodology, combined with available information from Google maps to measure store size and popularity, one can model the best time to go shopping. Though the focus here was on shopping during a pandemic, anyone who might be a bit crowd-averse can use this methodology the next time it’s time to restock on groceries. 

Thomas F. Bersson is a research systems engineer and an adjunct professor at the University of Virginia. He lives in Virginia Beach.

Nautilus Members enjoy an ad-free experience. Log in or Join now .

Jonathan S. Bersson applies mathematical modeling. He has attended the University of California, Davis, and the University of Louisville. He lives in Louisville, Kentucky.

close-icon Enjoy unlimited Nautilus articles, ad-free, for less than $5/month. Join now

! There is not an active subscription associated with that email address.

Join to continue reading.

You’ve read your 2 free articles this month. Access unlimited ad-free stories, including this one, by becoming a Nautilus member.

! There is not an active subscription associated with that email address.

This is your last free article.

Don’t limit your curiosity. Access unlimited ad-free stories like this one, and support independent journalism, by becoming a Nautilus member.