A for-hire driver who runs his own service and also drives for Uber on the side, drives through Times Square August 8, 2018 in New York City.

When Uber and Lyft first entered the market, offering a ride-hailing service that would come to include tens of thousands of amateur drivers, most major American cities had been tightly controlling the competition. New York City allowed exactly 13,637 licenses for taxicabs. Chicago permitted 6,904, Boston 1,825 and Philadelphia 1,600.

These numbers weren't entirely arbitrary. Cities had spent decades trying to set numbers that would keep drivers and passengers satisfied and streets safe. But the exercise was always a fraught one. And New York City now faces an even more complex version of it, after the passage of legislation this week that will temporarily cap services like Uber and Lyft.

The city plans to halt new licenses for a year while it studies the impact of ride-hailing and establishes new rules for driver pay. In doing so, it renews an old question: What's the right number of vehicles anyway?

More from The New York Times:

It was billed as the 'taxi of tomorrow.' Tomorrow didn't last long.

Riders wonder: With Uber as New York's plan B, is there a plan C?

Uber and the false hopes of the sharing economy

The answer isn't easy because it depends largely on which problem officials are trying to solve. Do they want to minimize wait times for passengers or maximize wages for drivers? Do they want the best experience for individual users, or the best outcome for the city — including for residents who use city streets but never ride taxis or Uber at all?

All of these goals are in tension. If you're a ride-hailing passenger, you may want cars to materialize at your doorstep instantaneously. But a system that can do something like that probably also has a lot of empty cars waiting around, contributing to congestion and lowering driver wages.

The right number then is best thought of as more of a sweet spot in the trade-offs between convenience and congestion; high wages and short waits; what's best for individuals and what's best for everyone.

"There isn't a right number — you want to get several right relationships here," said Bruce Schaller, a former deputy commissioner in the New York City Department of Transportation and a longtime consultant. For years, he had this same conversation with cities eager to optimize their taxi fleets.

With too few cars, cities have risked frustrating passengers who cannot get a cab when they need one. With too many, drivers struggle to earn enough, giving them an incentive to cherry-pick only the most profitable trips, like airport rides. For these reasons, cities began capping taxis in the 1930s, and many that tried deregulating the industry in the 1970s ultimately decided they needed to impose caps again.

San Francisco notoriously never got this balance right (by the dawn of the Uber era, it had about 1,700 licensed cabs). "It is no accident that Uber and Lyft began in San Francisco," Mr. Schaller said. "It wasn't just because it was Silicon Valley. It was because they had seriously too few taxicabs."

He and other researchers suggest that the best way to capture these trade-offs is to focus on measures of how heavily taxis or ride-share fleets are utilized — how much time or how many miles they spend with a passenger in tow. Systems that rack up a lot of unproductive travel essentially waste street space, and they're less profitable for drivers.

Alejandro Henao, a postdoctoral researcher with the National Renewable Energy Laboratory, illustrates what this looks like using data from RideAustin, a nonprofit ride-hailing service in Austin, Tex. This graph covers 1.5 million trips on the service over the course of 10 months. When drivers don't receive enough trip requests, they spend a lot of miles driving around without any passengers, contributing to congestion. As they receive more requests, those wasted miles decline:

Mr. Henao suggests the optimal target, at least in Austin, occurs when drivers average 3.4 trip requests per hour. That translates to having about 30 drivers for every 100 trip requests there. Beyond that point, adding more trips per driver doesn't save drivers — or the city — much in empty miles traveled with no passenger in the back. And beyond that point, the system would most likely have too many passengers and not enough drivers, and passenger wait times would increase.

These specific numbers would differ in other cities or circumstances (including if you looked at only, say, downtown Austin). But the principle is the same anywhere, Mr. Henao argues: Cities should neither cap these services nor welcome a free-for-all. They should try to optimize the number of drivers to the amount of demand — or nudge companies to do that more effectively, by requiring them to share their utilization rates. Cities could withhold licenses from companies with low utilization, for instance, and reward those with high rates.

In New York, politicians have been reacting to the suspicion that ride-hailing companies have goosed the number of cars on the road to minimize wait times for passengers, at the expense of driver wages and public streets. "The Uber business model," Mayor Bill de Blasio said, is "flood the market with as many cars and drivers as possible."

Uber and Lyft counter that they're motivated to balance all of these interests, and certainly more so than the taxi industry has been.

"Picking a number of vehicles is not the best way to serve residents across entire cities — just look at yellow taxis in NYC who do 92 percent of their trips in Manhattan," the Uber spokesman Josh Gold said in a statement. "Ultimately, we have a natural incentive to keep drivers busy; otherwise they won't choose to continue driving with us."

Capping ride-sharing vehicles won't ease congestion, said Adrian Durbin, Lyft's director of communications. And it will make it only harder for companies like Lyft to nudge more passengers into shared rides if they're not able to match passengers efficiently. He points to people who live in neighborhoods that aren't well served by transit, or who need late-night rides.

"Those are the people who are going to be most harmed by caps or cuts to ride-sharing," he said. "We weren't just putting drivers on the road for the sake of it. It's not good for our business or Uber's to have drivers out there whose cars are empty most of the time."

Lyft and Uber have not released data on their utilization in New York, although other provisions of the city's legislation could require them to do so. That also makes it harder to repeat Mr. Henao's analysis with trip data in New York. But Mr. Schaller has made his own calculations. Cars for the two companies were used by passengers about 68 percent of the time in New York, excluding airport rides, he estimates for June 2017. Ideally, that number could be as high as 80 percent, he said.

Yellow cabs by definition are less productive because they don't use the same sophisticated dispatch system to pair drivers and riders citywide. For them, Mr. Schaller suggests, the sweet spot may be more like 55 percent in New York, and lower in less dense cities.

Research published this summer in the journal Nature by researchers at M.I.T. suggests another possibility: If yellow cabs in New York could centrally optimize routes — more akin to what Uber and Lyft do — they could deliver the same number of rides with 30 to 40 percent fewer vehicles. Of the roughly 13,600 registered yellow cabs, about 8,000 are on the road at a time. That means the fleet could provide the same trips, even without combining rides in shared trips, with closer to 5,000 vehicles.

Technology has made it easier to identify and manage the optimal supply, far more so than when cities began capping taxis 80 years ago. But cities have to be clear what they're optimizing for. And in none of these proposed calculations would the city maximize the interests of the group financially hurt the most by Uber's rise: taxi medallion owners, some of them immigrant drivers, who've seen the value of their assets plummet. That is a trade-off, too.