
How to escape a monster (using calculus) - ivoflipse
http://www.datagenetics.com/blog/october12013/index.html
======
undershirt
Excellent explanation of a fun problem!

Amazing that the optimal path to land creates a perfect "J". It's solutions
like this that leave me in awe-- another felt connection to mathematical truth
through an emotional reaction to simplicity. It's empowering to understand a
piece of it, but humbling to know it's only part of a larger system that I
can't fathom. I think that's the loop that beckons mathematicians.

~~~
ivan_ah
I think the "perfect J" comes from the fact that we are solving the instance
with the critical value K = 4.60333... If K were any greater than this, we
couldn't escape.

If K were less though, an "open J" path (like Path #2) would also work.

~~~
thaumasiotes
You can recover the "perfect J" by phrasing the problem as "find the path that
results in the monster having been waiting for you at the shore for the least
time, or if he's too slow, that results in the maximum distance from the
monster when you exit the lake". The best path is always the best path.

What really bothers me about the solution presented is that the (optimum)
angle of escape is clearly _exactly_ pi / 2, computed as the arcsine of 1.
That's going to be _exactly_ 1, but it's computed here as 4.603339 cos
1.351817, which is only approximate. There must be a solution that gives you
the exact value; that's the one I want to see.

~~~
squeakynick
The 'exact' answer for the angle you need to row (alpha) is
Sin(alpha)=KCos(Phi).

Yes, the 'exact' answer is the tangent. If you want the relationship between K
and Phi, then:

K = Cos(Phi) + SQR( (pi+phi)^2 - sin^2(phi))

The derivation of both of these is contained in the article.

------
yetanotherphd
continuous time games are very messy. Defining the correct notion of Nash
equilibrium can be very hard since a player might "respond" to another
player's strategy epsilon time after that player "moves". Of course when there
is a Nash equilibrium that makes sense, it's all the more interesting.

------
projectileboy
I first saw this puzzle when it was the monthly "Ponder This" challenge from
IBM Research. If you like it, you might enjoy looking through their archives:
[http://domino.research.ibm.com/Comm/wwwr_ponder.nsf/pages/in...](http://domino.research.ibm.com/Comm/wwwr_ponder.nsf/pages/index.html)

------
rflrob
In the middle section, what prevents the monster from running clockwise, and
thus making paths 2 and 3 suboptimal?

~~~
lotsofpulp
It's not clear, but the assumption is that the monster is already running.
Once the monster picks a direction (assuming instantaneous acceleration and
whatnot), Path 3 is the limit for which turning around makes sense for the
monster. So you row the boat in tight circles getting the monster going until
you get to the circle of safety, then you can choose from anywhere between
Path 1 to Path 3 to get to the shore before the monster can make it to you,
with our without running in the opposite direction.

~~~
gcb0
Yeah, so the solution to the problem ignore the rule mentioned on the 1st
paragraph of the page about it always going the shortest route or doing the
most clever thing or something.

------
triplesec
This was fun. I thought I could work it out, but this was neater. Let's have a
whole school based on such puzzles!

~~~
ivan_ah
Okay, I'm on it ;)

------
jmount
Nice! I worked out something much more basic for how to outrun a crashing
spaceship: [http://www.win-vector.com/blog/2012/06/how-to-outrun-a-
crash...](http://www.win-vector.com/blog/2012/06/how-to-outrun-a-crashing-
alien-spaceship/)

------
skelsey
I feel like a zigzag pattern would work here as well. Keep the monster
switching directions. Essentially, the monster is balanced perfectly on the
opposite side of the lake from the one you are headed towards.

~~~
squeakynick
The monster is a smart monster. He knows that, once you leave the safe circle,
he has a higher angular velocity. So, as soon as you pass that threshold, he
will start to run around the lake. It does not matter which direction he
initially takes, but once moving is committed to that direction (if he were to
reverse direction, he would end up, in the future at the same point he was
once at, but at a later time, and you would be nearer your goal; he's too
smart to let that happen). Once you are outside the safety circle, he will
run, and not stop running in that direction.

------
yeukhon
This problem is similar to the one OP had to solve in his interview:
[https://news.ycombinator.com/item?id=6583580](https://news.ycombinator.com/item?id=6583580)

DAMN..

------
sillysaurus2
Did anyone else figure it out without any calculus?

~~~
Volpe
How? You mean you intuitively understood, or you can prove it your solution
without calculus?

~~~
sillysaurus2
Just intuitively. Geometrically... Maybe it's from playing online games. I
would kite it one direction, then escape in the other. The natural way to do
that is a J shape.

~~~
omegant
I just thought in a spiral at first and then run, not exactly a J but
something close.

------
jamesrom
An animation of the solved path would be awesome.

------
fmax30
umm another naive solution for this would be to go from the center to any
arbitrary end, do not cross on to the lake just wait around 2-3 meters from
the bank and wait for the monster. Once the monster reaches the bank just in a
straight line to the other side.

This way you will have to cover 2 _r distance where as the monster will cover
3.14_ r (pi*r ) distance .

You will be able to out run a monster around 1.57 times your speed. Sure it is
not that good enough but if your calculus isn't that good (To be honest
calculus is the last thing on your mind when a monster is chasing you) and the
monster is slow then you will be able to out run him.

------
s800
Where's the calculus?

~~~
squeakynick
The calculus is used to determine the maximum ratio of speeds.

