Re: Hungry Wolf Vs Scared Chicken
(Spoiler warning, uses knowledge of the simple solution to work backwards)
I read the simple solution a few weeks ago and have been mulling it over since. I can see where someone would figure it out from the algebra, but I haven't been able to find a reason to "see" it, and I've gone through more than a few ideas. Sometimes the solution of a particular problem is out of reach while the solution to a more general version is easy to see. In that spirit, I've generalized the problem to allow the sheep (or chicken, whatever poor little animal you want) to move at some given angle. That is, my question is--at what time tc, given some initial separating distance d, wolf speed w, sheep speed s, and sheep angle theta [theta = pi/2 in the original version] does the wolf hit the sheep.
The question then becomes a problem of analyzing the function tc(theta), considering the other parameters as pre-chosen constants. First we see that tc(0) <= tc(theta) <= tc(pi) for all theta by thinking about the problem's physical meaning. We also know that tc(pi/2) = [tc(0) + tc(pi)] / 2 from the "simple" solution. My first guess was to say that tc(theta) is a linear function of theta. I tested this, and unsurprisingly it's not. After further experimental testing, though, I've found out something that to me was shockingly concise: tc(theta) is a sinusoid. In fact I've found that
tc(theta) = tc(0) + [1-cos(theta)] * [tc(pi) - tc(0)] / 2
In some special cases, this gives the following:
tc(0) = tc(0) + 0 * [tc(pi) - tc(0)] / 2 = tc(0)
tc(pi) = tc(0) + 2 * [tc(pi) - tc(0)] / 2 = tc(pi)
tc(2pi) = tc(0) + 0 * [tc(pi) - tc(0)] / 2 = tc(0)
...and most importantly...
tc(pi/2) = tc(0) + 1 * [tc(pi) - tc(0)] / 2 = [tc(pi) + tc(0)] / 2 as in the "simple" solution.
Limitations on tc(theta): it has to have the edge case behavior that we've found at theta=0, pi, and 2pi, as well as pi/2. It has to be infinitely differentiable everywhere since it's describing something without any discontinuities in any of its derivatives. It has to be periodic with period 2pi. These alone are quite restrictive, though they don't force a sinusoid.
From this equation for tc, the "simple" solution follows directly, since tc(0) = d / (w + s), tc(pi) = d / (w - s) from some basic reasoning. It's a very powerful statement for this problem, neatly bundling up the time (and therefore points) of collision for every orientation at any parameter value. *Proving* that equation, though... I haven't thought about that much, yet.
One nice thing is that we don't need this equation in its entirety to solve the original problem. We only need one fact about tc(theta): that it's symmetrical about pi/2 in the sense that [tc(pi/2 - theta) + tc(pi/2 + theta)]/2 = tc(pi/2) is enough. This alone forces tc(pi/2) = [tc(pi) + tc(0)] / 2. Put it in other words, after grinding all of this out and refining it, we get this wonderful result:
The "simple" answer follows from the fact that if we take the original problem and change it by causing the sheep to run at an angle deflected toward the wolf, we decrease the time till capture by the same amount we would increase the time till capture by doing the opposite deflection away from the wolf. I feel like there's some nice physical reason for this property but I'm out of steam for a while on this problem.
I'll clean up my experimentation code some and post it with a nice graph hopefully tomorrow.
2 Attachment(s)
Re: Hungry Wolf Vs Scared Chicken
Attached is my testing code and a screenshot.
The code runs trials of the wolf chasing the sheep, with the wolf starting on the x axis and the sheep running away at some angle theta. Whenever the wolf catches the sheep, a red dot is graphed. The accuracy is only a few significant figures, but it's good enough to see general trends.
The top slider controls the "theta" in 1 degree increments. Whenever it's changed, the wolf and sheep get run and their collision point appears in red--individual trials should be almost instant. The collision for the initial problem--that is, with theta = 90 degrees--is graphed in green.
The "Go!" button moves the slider from 0 degrees to 360 degrees, graphing the collision positions for the current wolf speed setting at all angles. It also graphs the experimental collision time in the graph window.
The bottom slider controls the wolf speed. You can consider the sheep to have speed 50, so the slider starts at 51.
The Theory/Actual/Diff label should probably be ignored.
The graph has theta on the x axis (0 to 360 degrees), and experimental collision time on the y axis. However, the graph isn't centered at the origin--the lowest y-value shown is the theoretical collision time for the current parameters with theta = 0, and the highest y-value shown is the theoretical collision time for the current parameters with theta = 180 degrees. You can see the shape of the graph is identical as the wolf speed varies.
The Graph! button graphs a sinusoid on the graph. It matches perfectly with the results of the experimental trials.
In the screenshot, I've run the wolf and sheep for 4 different wolf run speed values, and have used the Go! button to run those trials for every degree from 0 to 360. The graph shows the experimental results for the most recent wolf run speed which happened to be 55. If I hit the Graph! button, a sinusoid would be graphed over the blue curve, and (having done it myself), it fits perfectly. This resulted in the master equation I gave in my previous post, which in a special case gives the "simple" solution to the original problem.
I still haven't been able to derive this equation or it's symmetry property, though. Even just saying that the collision time is a function of cos(theta) is enough to give the answer, but I can't say why that would have to be the case. Maybe someone has an idea?