 (If neither is the case, then a weighted harmonic mean or weighted arithmetic mean is needed.For the arithmetic mean, the speed of each portion of the trip is weighted by the duration of that portion, while for the harmonic mean, the corresponding weight is the distance.In both cases, the resulting formula reduces to dividing the total distance by the total time.)