IT IS a familiar ritual for many: after a late night out you reach for your smartphone to hail an Uber home, only to find—disaster—that the fare will be three times the normal rate. Like many things beloved by economists, “surge pricing” of the sort that occasionally afflicts Uber-users is both efficient and deeply unpopular. From a consumer’s perspective, surge pricing is annoying at best and downright offensive when applied during emergencies. Extreme fare surges often lead to outpourings of public criticism: when a snowstorm paralysed New York in 2013, celebrities, including Salman Rushdie, took to social media to rail against triple-digit fares for relatively short rides. Some city governments have banned the practice altogether: Delhi’s did so in April.

Uber is sticking with surge pricing for now, but Jeff Schneider, one of its machine-learning experts, recently suggested that the company is interested in developing systems that rely on technology, rather than price, to allocate cars. Even if such a technological fix proves elusive, however, local governments do not need to regulate or ban surge pricing to reduce its sting.

Surge (or dynamic) pricing relies on frequent price adjustments to match supply and demand. Such systems are sometimes used to set motorway tolls (which rise and fall with demand in an effort to keep traffic flowing), or to adjust the price of energy in electricity markets. A lower-tech version is common after natural disasters, when shopkeepers raise the price of necessities like bottled water and batteries as supplies run low. People understandably detest such practices. It offends the sensibilities of non-economists that the same journey should cost different amounts from one day or hour to the next—and more, invariably, when the need is most desperate.

Yet surge fares also demonstrate the elegance with which prices moderate a marketplace. When demand in an area spikes and the waiting time for a car rises, surge pricing kicks in; users requesting cars are informed that the fare will be a multiple of the normal rate. As the multiple rises, the market goes to work. Higher fares ration available cars by willingness to pay: to richer users, in some cases, but also to those less able to wait out the surge period or with fewer good alternatives. Charging extra to those without good alternatives sounds like gouging, yet without surge pricing such riders would be less likely to get a ride at all, since there would be no incentive for all the other people requesting cars to drop out. Surge pricing also boosts supply, at least locally. The extra money is shared with drivers, who therefore have an incentive to travel to areas with high demand to help relieve the crush.

A recent analysis published by Uber illustrates how the system is intended to work. Jonathan Hall, head of economic research at Uber, Cory Kendrick, a data scientist at the firm, and Chris Nosko, of the University of Chicago, compared two high-demand cases in New York city to illustrate how surge pricing is intended to work. In March 2015 it kicked in after a sold-out concert by Ariana Grande, a singer, in an arena in the middle of Manhattan. As the show came to an end, the number of people in the area opening the Uber app quadrupled in just a few minutes. Uber’s algorithm swiftly applied surge pricing; the average waiting time for a car rose only modestly, while the “completion rate”—the share of requests for rides that are met—never fell below 100%. On New Year’s Eve in 2014, in contrast, Uber’s surge-pricing algorithm broke down for 26 minutes, leaving New York without surge pricing. The average wait time for a car soared from about two minutes to roughly eight, while the completion rate dropped below 25% (see chart).

The comparison may overstate the power of surge pricing. Even without the help of algorithms, cab drivers know to converge on a venue as an event finishes; more Uber drivers than normal were surely in the area at the end of Ms Grande’s concert in expectation of the extra business. Yet the possibility of earning a surge fare may also strengthen drivers’ incentives to anticipate and respond pre-emptively to high demand. Ironically, the better Uber’s surge-pricing algorithm works, the less the company will need to use it, since drivers’ pre-emptive responses will tend to eliminate the demand imbalances that make surge pricing necessary in the first place.

There are tantalising hints that Uber hopes to follow this logic to its conclusion. Mr Schneider noted that clever machine-learning tools could process Uber’s piles of data and determine when and where demand is likely to outstrip the supply of cars. There would be no need to wait until demand starts to rise, nor for drivers to scan concert schedules. The ability to anticipate demand would be of some use to Uber today: it could tell drivers where they are likely to be needed. But they would presumably not respond as rapidly as they do to the inducement of surge fares. Eventually, however, Uber hopes to replace its human drivers with autonomous vehicles, which could be directed around the city by the company’s computers without any pecuniary incentives. (The company still has an incentive to maximise earnings, though, so it might opt to keep surge pricing even if technology made it redundant, at the risk of further public rage.)

Apps and downs

Whether Uber remains a big part of the transport network in future, and whether it retains surge pricing, depends in part on how well local governments manage the transport system as a whole. In districts or cities where travellers have appealing alternatives, in the form of good public transport or private competitors to Uber, users will be more sensitive to price. Surge pricing will therefore not generate a big financial windfall for Uber (or its drivers). But where public transport is thin on the ground, or where Uber has little private competition, it is a different story. In other words, surge pricing is really only as painful as local officials allow it to be.

Visit our Free exchange economics blog