Solution to Puzzle No. 8

Share this page

Solution to Puzzle No. 8

September 1999

For the question see Puzzle No 8 - The Gobbling Goat in issue 8.

Solution diagram 1
Let the circular field have radius r. \par Let the length of the rope, which is anchored at point A on the circumference of the field, be R. \par Now, with the rope at full stretch, the goat will be able to move in an arc from point B on the circumference to point C.

Solution diagram 2
Let O be the centre of the field. \par Clearly, the angle OAB is equal to the angle OAC. Let the magnitude of OAB be x radians. \par Thus, the area accessible to the goat will be a circle sector with radius R and angle 2x (yellow), plus two circle segments (pink) from a circle of radius r, cut off by the chords AB and AC respectively.

Now, the area of the circle sector is: 12(R2.2x)=R2x The area of each circle segment is: (1/2)r2(π2x)(1/2)r2sin(π2x) (because each is a sector of a circle minus a triangle) and so the total area accessible by the goat is: R2x+r2[π2xsin(2x)] (the yellow sector plus the two pink segments).

Solution diagram 3
Currently, we have two different variables in our area equations: r and R. Let's try to eliminate one. \par Obviously, the length of the line segment AO is r, the radius of the field. Similarly, the radius of the line segment OC must be r. \par Therefore, by similar triangles, if we drop a perpendicular from O to the line segment AC, the perpendicular will bisect AC. Therefore the length of AP (and PC, of course) is R/2. \par We now have a right-angled triangle and enough information to calculate the relationship between r and R: cosx=R/(2r)R=2rcosx \par So the total area accessible to the goat is: (4r2cos2x)x+r2[π2xsin(2x)]. \par We wish for this area to be half the area of the total field; therefore we have: 4r2xcos2x+r2[π2xsin(2x)]=πr2/24xcos2x+π2xsin(2x)=π/24xcos2x+π/22xsin(2x)=0

We can't easily solve the equation but we can use a graphical calculator or numerical method such as Newton-Raphson to find an approximate solution.

Using the Newton-Raphson method as described in the Coda, we find that x is approximately 0.953, and therefore cosx=0.579. \par Now, since R=2rcosx and r, the radius of the field, is 100m, we have R=200cosx and thus the required length of rope is approximately 116m.


Coda: Solving the equation using Newton-Raphson

The basic idea

In the goat puzzle, we were left with the following equation to solve: 4xcos2x+π/22xsin(2x)=0 The Newton-Raphson method is an approximate method for finding roots of equations that are differentiable. \par Let f(x) be a differentiable function. Since f(x) is differentiable, every point on the graph of f(x) must have a gradient and a unique tangent line. \par Now, the tangent at x0 is an approximation to the graph of f(x) near the point (x0,f(x0)). \par Therefore the zero of the tangent line (the point where the tangent line crosses the x-axis) is an approximation (perhaps a very bad one, however!) of the zero of f(x) (the point where f(x) crosses the x-axis, i.e. the root of f(x)). It's like we're pretending that f(x) is really a straight line, like the tangent line, and therefore crosses the x-axis at the same place the tangent does.
Newton-Raphson diagram

In the Newton-Raphson method, we start with a "best guess" x0 as to the zero of f(x). We then calculate the first approximation, x1, as the zero of the tangent line to f(x) at x0. \par We then calculate the second approximation, x2, as the zero of the tangent line crossing the x-axis at x1, and so forth. \par The diagram above shows the initial guess x0, the first approximations x1 and the relevant tangents. The second approximation x2 is the coordinate where the second tangent crosses the x-axis. As you can see, the approximations are getting closer to the actual zero point of f(x). If we continue iterating like this, we will get better and better estimates for the zero point of f(x).

How do we do it?

We wish to solve 4xcos2x+π/22xsin(2x)=0. Obviously, plotting f(x)=4xcos2x+π/22xsin(2x) and drawing tangents is not going to be very much fun! However, we can perform Newton-Raphson numerically. \par Our initial point is x0. The gradient of f(x) at x0 is given by f(x0), and the tangent line to f(x) at x0 is therefore given by: yf(x0)=f(x0)(xx0) To find x1, we must find the point where this tangent crosses the x-axis, i.e. to let: 0f(x0)=f(x0)(x1x0) and therefore x1x0=f(x0)f(x0) so that x1=x0f(x0)f(x0) Similarly, in the general case we obtain: xn+1=xnf(xn)f(xn) \par Now, our function is f(x)=4xcos2x+π/22xsin(2x). Via standard differential calculus, the gradient f(x) of this function is 4cos2x8xcosxsinx22cos(2x). Therefore, to find the approximate root of f(x) we can use the following: xn+1=xn4xncos2xn+π/22xnsin(2xn)4cos2xn8xncosxnsinxn22cos(2xn) \par So, we know how to calculate xn+1 from xn. But how do we find our starting value, x0? Well, in this particular case we know that the magnitude of x must be between 0 and π/2 radians (go back to the second diagram and think about it if you're not sure why!). So a good initial guess might be (for example) π/4. \par As it turns out, all sorts of values will do: here's a table of the iterative steps of Newton-Raphson on our function f(x) for a range of initial values of x0. As you can see, they all converge quite rapidly to the same twelve-significant-digit approximation.
x0=π/4 x0=π/6 x0=π/3 x0=π/5
x0 0.785398163398 0.523598775598 1.047197551200 0.628318530718
x1 0.967088277216 1.200834484702 0.952802703860 1.050054911254
x2 0.952847864655 0.929999518111 0.952847865014 0.952745530049
x3 0.952847864655 0.952962588691 0.952847864656 0.952847866503
x4 0.952847864655 0.952847866978 0.952847868401 0.952847864653
x5 0.952847864655 0.952847864656 0.952847864655 0.952847864656
x6 0.952847864655 0.952847864655 0.952847864655 0.952847864655