As of 11 a.m. Friday, March 20, 44 Maine residents have been confirmed positive and 12 others are presumed positive for the coronavirus, according to the state. Click here for the latest coronavirus news, which the BDN has made free for the public. You can support this mission by purchasing a digital subscription.

“What happened to the soap?” That’s what many Americans may be thinking as they wander forlornly through the aisles of local grocery stores (always careful, of course, to maintain a 6-foot distance from other customers). Fresh food may be abundant, but the necessities of a disease quarantine — hand soap, sanitizer, toilet paper and so on — are increasingly hard to find. For some items, such as peanut butter, this isn’t much of a problem. But for soap, hoarding could set back the country’s ability to suppress the coronavirus by making it harder for people to clean their hands — which medical professionals say is important to prevent the disease from spreading.

As it happens, economists have been thinking about the problem of hoarding for a while. In 1991, the late Harvard University economist Martin Weitzman wrote a paper called “Price Distortion and Shortage Deformation, or What Happened to the Soap?”, in which he tried to model why stores in the Soviet Union seemed chronically low on this crucial consumer good. (The USSR didn’t need a pandemic to run out of the basics!)

To analyze shortages, Weitzman tossed out the classic assumption that supply and demand simply match each other as if by magic. Instead, he modeled a more realistic process in which consumers buy a certain amount of something and then use it up over time, then go buy more. He found that shortages caused by government price distortions can be self-reinforcing — the more people have to wait in line or hunt around to find soap, the more soap they’ll stock up on when they finally do get a chance to buy. Hoarding only makes the shortage more acute.

Weitzman’s example is simple, but the existence of complex modern supply chains can magnify the problem. Simple models show that a small distortion in demand can cause suppliers to hoard their inventory.

Weitzman’s solution — as one might expect from an economist contemplating Soviet failures — was to simply let prices rise until the inefficient hoarding behavior disappeared. But the soap shortages now facing Americans are not caused by government attempts to hold down the price of the good; they’re caused by a combination of psychology and rational precaution. On the rational side, going to the store less frequently means a lower chance of getting infected. And in the event that the viral outbreak gets so severe that governments are forced to close many stores, the market system may break down, forcing people to wait in long and potentially hazardous lines at government distribution centers for soap and toilet paper.

Meanwhile, the epidemic has created a sense of panic that makes people stock up on necessities in order to feel a little safer and more in control. Experimental studies suggest that rational worry and emotional panic amplify each other in hoarding situations. And even a small number of irrational hoarders can force more level-headed buyers to clean out the shelves preemptively.

In fact, my Bloomberg Opinion colleague Scott Kominers has argued that in a situation like the present one, price controls will actually make society better off by preventing price-gouging behavior. If there’s going to be hoarding, one might as well put the rich and poor on a level playing field.

But this also doesn’t seem like a satisfactory solution. Forcing down the price of soap might allow poor people in on the hoarding game, but it’s unlikely to stop hoarding itself. The soap shelves will still be bare, which will pose a public health risk by making it harder for consumers who missed out on the rush to wash their hands. To ensure that everyone has soap, the shortage itself must be relieved.

Weitzman’s model suggests two ways to accomplish that. First, because hoarding is caused by the difficulty of hunting around for supplies, providing information can help stop the behavior. Cities can set up websites or apps where every store has to report how much soap it has on the shelves, and provide this information freely to all consumers. This will quiet people’s fear of being forced to search far and wide for the places that still have soap, making them less likely to buy huge amounts all at once.

Second, stores need to ration how many bars or bottles of soap customers are allowed to buy. That will make it harder for both irrational hoarders and rich people to buy up all available supplies. (Citywide rationing systems would be even more effective, but this would take time to implement.) Secure in the knowledge that other people won’t be able to hoard, rational consumers will feel less pressure to stock up.

Even these measures won’t make shortages disappear; the U.S. simply wants a lot more soap than it wanted a few weeks ago. But they can help short-circuit the inefficient hoarding behavior that’s keeping shelves bare and hands dirty.

Noah Smith is a Bloomberg Opinion columnist. He was an assistant professor of finance at Stony Brook University.