A person travels from Pune to Mumbai at 60 km/h and returns at 40 km/h. What is the average speed for the whole trip?
48 km/h, not 50. For equal distances the average speed is the harmonic mean: 2 x 60 x 40 / (60 + 40) = 4,800 / 100 = 48 km/h, because more time is spent at the slower speed.
Explain it simply
Average speed is total distance divided by total time, never the plain average of the speeds. On the slow return leg you spend more hours, so the slow speed gets more weight. That pulls the true average below the simple 50 km/h.
Example
Question: Going at 60 km/h, returning at 40 km/h over the same route. Average speed?
Take the one-way distance as 120 km (LCM of 60 and 40).
- Time going = 120 / 60 = 2 h.
- Time returning = 120 / 40 = 3 h.
- Total distance = 240 km, total time = 5 h.
- Average speed = 240 / 5 = 48 km/h.
Formula for two equal distances: 2xy / (x + y) = 2 x 60 x 40 / 100 = 48. For three equal distances at x, y, z: 3xyz / (xy + yz + zx).
const avg = (x, y) => (2 * x * y) / (x + y);
console.log(avg(60, 40)); // Output: 48What to say in the interview
"Average speed is total distance over total time. For equal distances that's the harmonic mean, 2xy over x plus y, which gives 48, lower than 50 because the slow leg takes longer."
Common mistakes
- Answering 50 km/h by averaging the speeds.
- Using the harmonic mean when the times, not the distances, are equal.