The average speed is 54 miles per hour. If you just average the two speeds 10 mph and 20 mph you would get 15 mph. To get elapsed time t t divide total distance by speed.
D s D s.
It travels 30 miles in the first hour 45 miles in the second hour and 75 miles in the third hour. Mr John drives at a constant speed of 108 kmh to his office every morning. My approach is first to find the average distance it travels and take the time derivative of the result. The sum of the numbers at time t 1 is the sum at time t plus the number added to the ring buffer minus the number that leaves the ring buffer or zero if the buffer is not full yet.