Taxi Problem Calculator

This calculator accompanies a blog post about how to fairly split cab fare.

Calculator


Select an algorithm:











Results

Enter distances and hit "Calculate"

The algorithms

Equal fare

Every rider pays the same amount.

Marginal fare

Each rider pays the amount they contributed to the distance. This algorithm is order-dependent, so if the second passenger goes less far than the first then the second passenger will pay nothing.

Equal discounts

We first calculate the savings from sharing as compared to the sum of the costs of separate rides. That savings is distributed equally among all riders.

Equal discounts, avoid negatives

Like equal discounts, but without the issue that short-riders sometimes profit instead of paying in. If a contribution would be negative, that rider pays $0.00 and their remaining savings is distributed among the other riders.

Proportional to person-miles

We first calculate the savings from sharing as compared to the sum of the costs of separate rides. That savings is distributed among the riders in proportion to their distances traveled. As a result, each mile costs the same amount.

Split by segment

While there are n riders in the cab, the fare for that segment is equally split n ways among them. When someone gets out, a new segment begins.

Game-theoretic (Talmudic)

The riders pairwise satisfy the Nash bargaining solution. It's explained excellently by this Mathologer video. This algorithm achieves values given in a Talmudic example.