# Help with best angle to run from encroaching wave at speed x

• Oct 15th 2012, 08:58 PM
jingato
Help with best angle to run from encroaching wave at speed x
Hi,

I recently applied to a job and took a programming test. I didn't hear back, so I'm assuming I didn't get the position. I was able to answer all of the questions except one. I'm trying to find out what the answer is because its been bugging me, but I'm not having any luck. The question is a math calculation.

A man is standing in the middle of a long dry riverbed when he sees a wall of water heading towards him. If the water is moving at 8 times the speed at which the man can run, then he’ll have the best chance of escape by running:

A) Straight toward a river bank
B) Toward a bank, but at a slight angle away from the water
C) Away from the water, but at a slight angle toward the bank

Does anybody know what exactly needs to be done to find the optimal path? Is there an exact equation to use?

regards
• Oct 15th 2012, 10:25 PM
chiro
Re: Help with best angle to run from encroaching wave at speed x
Hey jingato.

I take it the riverbed is on the x-axis and the water is travelling along the y-axis (or vice-versa).

In this scenario you have three options. The choices of running will depend on any solution where the guy gets over the edge of the river.

Now in a normal situation of normal geometry, the smallest distance is given by a straight line and if the edge of the bed is parallel with the y-axis, then the short distance is a perpendicular one.

This means the best strategy if they have to get to the edge of the river-bed (and this river is in a straight-line segment) is to go directly for the edge straight away.

You can prove it mathematically by looking at the time to getting to the edge of the river by using the time to get to river bed based on the angle from the x and y axes respectively.

For a right-angled triangle the hypotenuse = SQRT(x^2 + y^2) = r and x = r*cos(theta) while y = r*sin(theta). You want to minimize the distance r since you will always travel at the same speed regardless of the direction you can take, and you must have the condition that r*cos(theta) >= distance to the edge.

If the edge distance is e then e - rcos(theta) is a minimum. Differentiate this with respect to theta gives rsin(theta) = 0. Since r > 0 the solution for this where the angle is in-between 0 and pi/2 gives a solution angle = 0. This means the best way to get to the bank is to run straight towards it.

If those guys aren't satisfied with that then you would need to derive an arc-length formula that minimizes the distance to get where the final x-offset is -e (i.e. a distance of e to the river-bed).

Also you would have to say whether you are closer to the left or right hand sides as well if they get really picky.
• Oct 15th 2012, 11:43 PM
MaxJasper
Re: Help with best angle to run from encroaching wave at speed x
f = distance of flood from man
d = half river width = shortest distance of man to bank

1) if f > 8d then man runs to bank directly (best),i.e., normal to river's bank..but can run even at angle=0 (see graph)(Giggle)

2) if f <8d then man better runs toward bank with angle $\[Theta]$ relative to direction of water movement such that :

$f/d\geq -\text{Cot}[\theta ]+8 \text{Csc}[\theta ]$

in this way the man reaches the bank at the same time or earlier than the flood can catch up with him (Itwasntme)

http://mathhelpforum.com/attachment....1&d=1350406899
• Oct 16th 2012, 07:23 AM
jingato
Re: Help with best angle to run from encroaching wave at speed x
Thanks, I think i understand it now. :)