Timmys Magical Adventure
by Alex Murphy
Little Timmy needs to get across the river to save his friends in the burning orphanage!
You can help Timmy by telling him how fast he can walk and row a boat (don’t ask). He will then choose the quickest path across the river and to the orphanage.
What are you waiting for? There are orphans to be saved!!
Explanation
Note: SQ is my misleading way to represent the square root of a bracket (use your imagination)
To find the quickest path we need to break Timmy’s journey into two parts: rowing across the river, and walking downstream to the orphanage.
Lets call: Timmy’s walking speed W
Timmy’s rowing speed R
the width of the river D
the horizontal distance from Timmy’s
starting point to the orphanage, C
the horizontal distance from Timmy’s
starting point to where he should
row to on the other bank X
The distance Timmy is going to have to row from his starting point to a point on the other bank is: the square root of (D2 + X2). This is obtained from using Pythagoro’s Theorem on the triangle with sides D,X and the rowing distance.
If (D2 + X2) is the distance, then the time taken will be this divided by Timmy’s rowing speed
i.e. (D2 + X2) / R
The distance Timmy is going to have to walk is the total horizontal distance C, minus the horizontal distance he covers rowing i.e. C – X
If C – X is the distance, then the time taken will be this divided by Timmy’s walking speed i.e. C – X / W
The total time will be these two times added together:
T = ( SQ(D^2 + X^2) ) / R + C/W – X/W
We want to make the time taken to get to the orphanage as short as possible, so we are going to differentiate T, and find its minimum value.
The only thing that we can change is the point which Timmy rows to on the other bank. Therefore we can only change X. So to find the value of X which will make T as small as possible we differentiate T with respect to X:
dT/dX = 1/R . 1/2 . 2X /(SQ (D^2 + X^2) ) – 1/W
We want to find the minimum value of T, so we let
dT/dX = 0
Which gives: X /(SQ (D^2 + X^2) ) = 1/W
After a wee bit of rearranging we get:
X = RD /(SQ (W^2 + R^2) )
So when given the values for R,D and W we can calculate the point on the far shore Timmy should row to, to get to the orphanage in the quickest time.
Notice that if the rowing speed is greater than the walking speed, this formula doesn’t work as we get the square root of a minus number under the line.
What happens if Timmy can walk and row at the same speed? We get zero under the line which means X = infinity. We interpret this as meaning Timmy has to row to the furthest point to the right as possible, which means right to the (charred) door of the orphanage.