Calculating the average speed of a trip when given 3 different speeds for 3 percentages of distances. The question:
In a trip, $10$% of the way, Lucy drives uphill at an average speed of $56$mph; $10$% of the distance is downhill where she can manage an average speed of $72$mph. On flat ground, Lucy can has a average speed of $63$mph.
What is Lucy's average speed for the whole journey?
I know that you can not average the speeds out like $\frac{56 + 72 +63}{3}$
I thought of doing it like:
$\frac{56 + 72 + (63*8)}{10}$ to get the average speed, although it might be wrong.
Does anyone know the method for calculating questions like this?
 A: The average speed is total distance divided by total time.  The percentages are distance.  Let the total distance be $D$, though it will divide out.  She went $0.1D$ at $56$ mph.  How long did that take (it will include a factor $D$)?  Do the same for the other two legs, add up the times, divide into $D$.
A: The total average speed is the total distance divided by the total time.
We don't know the total length of the trip, but let's assume for simplicity that the whole distance is $100$ miles (we'll see that value doesn't matter in the end). Let's call the single distances $d_1,d_2,d_3$ where $d_1+ d_2 + d_3 = 100$. I'll denote the speeds by $v_i$ and the times by $t_i$ and we have $v_i = \frac{d_i}{t_i}$, i.e. $t_i = \frac{d_i}{v_i}$, $i=1,2,3$.
This means that Lucy is travelling 
$$d_1 = 10 \mbox{ miles with a speed of } v_1= 56 \mbox{mph, i.e. for } t_1 = \frac{d_1}{v_1}= \frac{10}{56} \mbox{ hours}\\
d_2 = 10 \mbox{ miles with a speed of } v_2= 76\mbox{mph, i.e. for } t_2 = \frac{d_2}{v_2}= \frac{10}{76} \mbox{ hours}\\
d_3 = 80 \mbox{ miles with a speed of } v_2= 63\mbox{mph, i.e. for } t_3 = \frac{d_3}{v_3}= \frac{80}{63} \mbox{ hours}.$$
Thus, the (average) speed on the whole trip is the total distance divided by the total time:
$$v = \frac{10 + 10 + 80}{\frac{10}{56} +\frac{10}{76}+ \frac{80}{63}}.$$
This formula can be reformulated as $$v= \frac{1}{ 0.1\frac{1}{56} +0.1\frac{1}{76}+  0.8\frac{1}{63}}=\frac{1}{ w_1\frac{1}{v_1} +w_2\frac{1}{v_2}+  w_3\frac{1}{v_3}},$$
where $w_1=w_2= 10 \%, w_3=80\%$. This kind of formula is called the weighted harmonic mean, which can be generally used to calculate the average speed. Here, we also see that the assumption that the whole distance is $100$ miles doesn't matter, as all that matters is the portion of the distance, i.e. $w_i = \frac{d_i}{d_1 + d_2 +d_3}$
