Traffic is not just a nuisance for drivers: It’s also a public health hazard and bad news for the economy.

Transportation studies put the annual cost of congestion at $160 billion, which includes 7 billion hours of time lost to sitting in traffic and an extra 3 billion gallons of fuel burned.

One way to improve traffic is through ride-sharing — and our mathematical model suggests that using carpooling options from companies like Uber and Lyft could reduce the number of vehicles on the road by a factor of three without significantly impacting travel time.

Our algorithm found that 3,000 four-passenger cars could serve 98 percent of taxi demand in New York City, with an average wait-time of only 2.7 minutes. It also found that 95 percent of demand would be covered by just 2,000 10-person vehicles, compared to the nearly 14,000 taxis that currently operate in New York.