Trickier problem than it seems. (goat in a circular paddock)

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

malmensa
Posts: 7
Joined: Wed Jul 06, 2016 2:50 am UTC

Trickier problem than it seems. (goat in a circular paddock)

Postby malmensa » Fri Jul 08, 2016 9:06 am UTC

You have a goat, tied to the fence of a circular paddock. The paddock has a radius of 100M. You want the goat to eat HALF of the grass.

How long does the rope need to be?

Assume an even covering of grass, and don't worry about the goat's neck length etc.
Wanna stalk me? Begin Here: http://protectorfire.com.au

User avatar
Flumble
Yes Man
Posts: 2266
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Trickier problem than it seems.

Postby Flumble » Fri Jul 08, 2016 10:23 am UTC

Simple reasoning:
Spoiler:
Formula for area of a disk: π*radius^2 = area
1/2*total area = goat area
1/2*(π*100m^2) = π*rope length^2
1/2*100m^2 = rope length^2
√(1/2)*100m = rope length


But given it's "trickier than it seems": I have no idea if the goat can/wants to eat the grass fast enough to actually eat "half the grass". :P In any case it needs extra nutrition beside grass.

User avatar
Xenomortis
Not actually a special flower.
Posts: 1456
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Trickier problem than it seems.

Postby Xenomortis » Fri Jul 08, 2016 10:34 am UTC

The rope is tied to the *edge* of the fence, so the region the goat can eat is actually the intersection of two discs.
You're looking for a radius r, of a disc centered on a point on another disc's boundary, such that the area of the intersection of the two discs is half the area of the second disc.
Image

Tub
Posts: 475
Joined: Wed Jul 27, 2011 3:13 pm UTC

Re: Trickier problem than it seems.

Postby Tub » Fri Jul 08, 2016 11:26 am UTC

Goats never eat all the grass, leaving the roots intacts, so you can just let the goat roam free in the enclosure. It'll eat roughly the upper half of each blade of grass. :roll:


Ok, trick answers aside, it still seems straightforward enough.

Let r1 = 100m, r2 = length of the rope.

Our points are
C: center of the paddock
T: tying point on the fence
I1, I2: the two intersections between the circles (C, r1) and (T, r2)

alpha: angle I1, C, I2
beta: angle I1, T, I2

If you want to graze exactly half the grass, then C, I1, T, I2 is convex, so alpha < 180°, beta < 180°. That means that the grazed part is the sum of two circular segments, with a known formula for area:

A = r1^2/2 (alpha - sin(alpha)) + r2^2/2 (beta - sin(beta))
with A being the area of the grazed part, which is half of the paddock's area:
A = 1/2 * pi * r1^2

We have an equation with three variables r2, alpha, beta. The fourth, r1, is a constant.

To get rid of two of the variables, look at the triangle C, I1, T. It has two sides with length r1 and one with r2, one angle (alpha/2) and two angles (beta/2). It's an isosceles triangle, so you can find formulas for the relations between alpha, beta and r2. Substitute in the equation above, solve for alpha, beta or r2, whatever seems easiest. To solve for alpha, you could use:
beta/2 = (180° - alpha/2) / 2
r2 = 2*r1* sin(alpha/4)

Solving for anything is tricky, because the formulas are a tangled mess of triginometric functions that are difficult to untangle. At this point, I'd just solve numerically.

User avatar
Carlington
Posts: 1588
Joined: Sun Mar 22, 2009 8:46 am UTC
Location: Sydney, Australia.

Re: Trickier problem than it seems.

Postby Carlington » Fri Jul 08, 2016 11:34 am UTC

On which note:

For the sake of dodging irrational numbers, I'm treating half the area of the paddock as being 15707.5m2. Then, with help from research done on Wolfram MathWorld, I put together the equation:

Image

I didn't want to solve that by hand, and Wolfram Alpha couldn't even interpret it to begin with. If anyone wants to solve that...or check it for mistakes...feel free.

EDIT: Ninja'd by Tub. I don't think that alpha and beta can both be convex. The radius of the paddock must less than the length of the rope, which means the centre of the paddock falls between the centre of the arc swept by the rope and the chord joining the points of intersection of the circles. We can't just be straightforwardly adding the area of two sectors, in any case.
Kewangji: Posdy zwei tosdy osdy oady. Bork bork bork, hoppity syphilis bork.

Eebster the Great: What specifically is moving faster than light in these examples?
doogly: Hands waving furiously.

Please use he/him/his pronouns when referring to me.

Tub
Posts: 475
Joined: Wed Jul 27, 2011 3:13 pm UTC

Re: Trickier problem than it seems.

Postby Tub » Fri Jul 08, 2016 12:22 pm UTC

Carlington wrote:The radius of the paddock must less than the length of the rope, which means the centre of the paddock falls between the centre of the arc swept by the rope and the chord joining the points of intersection of the circles.

That is true. And as the chord from I1 to I2 is between C and T, that means that the inner angles at both C and T must be smaller than 180°.

Carlington wrote:We can't just be straightforwardly adding the area of two sectors, in any case.

Not sectors, segments. Follow the link I gave. On each side of the chord is a circular segment.

User avatar
Flumble
Yes Man
Posts: 2266
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Trickier problem than it seems.

Postby Flumble » Fri Jul 08, 2016 12:27 pm UTC

Xenomortis wrote:The rope is tied to the *edge* of the fence

Ah, that does make it trickier than it seems, when you misinterpret the question. :oops:

Alternatively to Tub, integrate over the radius with a lot of arcs (1:100 scale model):
Image
(definite integration by parts, simplifying integrand)
Though something went wrong here, because the left hand never reaches an area of 1 and is negative by the time you fill the whole paddock, and consequently wolfram says its solutions are complex. :oops:

Paradoxica
Posts: 35
Joined: Wed Apr 09, 2014 1:33 am UTC

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby Paradoxica » Sat Jul 09, 2016 11:46 am UTC

The first approximate solution I have managed to come up with thus far is:

The length of the rope is approximately 2/√3 times the radius of the circular paddock fence.
GENERATION -705 - 992 i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.

User avatar
Eebster the Great
Posts: 3487
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby Eebster the Great » Sun Jul 10, 2016 5:03 am UTC

If I'm understanding the Mathworld formula correctly and haven't made any input errors, then setting d = r for their equation we get the following formula for the area, A, in terms of the radius of the paddock (the smaller circle), r, and the length of the rope (the radius of the larger circle) R: Image.

Wolfram|Alpha easily simplifies this, under the assumption that r and R are positive real numbers, and then if I simpify it further by setting r = 1 (and therefore A = π) I get: Image.

Now, Wolfram|Alpha really tries hard to solve this ugly but seemingly innocuous equation. I mean it really spends a tremendous amount of time computing considering I haven't paid for extra computing time. It doesn't seem to give up. But I can't seem to coax it into giving a solution.

Whatever the solution to this is, simply multiply by r = 100 m and that is the answer.
Last edited by Eebster the Great on Sun Jul 10, 2016 5:23 am UTC, edited 2 times in total.

User avatar
jestingrabbit
Factoids are just Datas that haven't grown up yet
Posts: 5967
Joined: Tue Nov 28, 2006 9:50 pm UTC
Location: Sydney

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby jestingrabbit » Sun Jul 10, 2016 5:07 am UTC

It won't have a closed form. Its a polynomial intersecting a trig function. No closed form for that unless you're super lucky.
ameretrifle wrote:Magic space feudalism is therefore a viable idea.

User avatar
Eebster the Great
Posts: 3487
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby Eebster the Great » Sun Jul 10, 2016 5:22 am UTC

I was hoping for a numerical approximation.

Paradoxica
Posts: 35
Joined: Wed Apr 09, 2014 1:33 am UTC

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby Paradoxica » Sun Jul 10, 2016 8:49 am UTC

Eebster the Great wrote:If I'm understanding the Mathworld formula correctly and haven't made any input errors, then setting d = r for their equation we get the following formula for the area, A, in terms of the radius of the paddock (the smaller circle), r, and the length of the rope (the radius of the larger circle) R: Image.

Wolfram|Alpha easily simplifies this, under the assumption that r and R are positive real numbers, and then if I simpify it further by setting r = 1 (and therefore A = π) I get: Image.

Now, Wolfram|Alpha really tries hard to solve this ugly but seemingly innocuous equation. I mean it really spends a tremendous amount of time computing considering I haven't paid for extra computing time. It doesn't seem to give up. But I can't seem to coax it into giving a solution.

Whatever the solution to this is, simply multiply by r = 100 m and that is the answer.


I don't think your equation is correct. By inspection, R=2 satisfies the equation and we are all fairly certain at this point that it is not an integer.

The negative solution is about -0.85, which I don't believe has a geometric interpretation in this scenario.
GENERATION -705 - 992 i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.

User avatar
PeteP
What the peck?
Posts: 1451
Joined: Tue Aug 23, 2011 4:51 pm UTC

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby PeteP » Sun Jul 10, 2016 1:31 pm UTC

Eh, the solution won't be quite correct anyway since it probably is bound around the throat and can reach a bit further than the rope length. So, 100 is obviously to little, at 141 it includes the half you get from drawing a straight line through the center+quite a bit more. The missing area under the line must be as big as the extra area over the line. I think 120 would be a bit much since the not filled areas will be long but narrow I think. So I guess 115 or so, close enough for goat feeding.

I'm just curious how near guessing will be to the solution. (Oh and here my being bored and matching numbers solution:115.8728473018121 derived from matching the area of the small lune to the area of the intersection https://rechneronline.de/pi/lune.php To make the equations in this thread even longer I suggest equating the lune formula to the intersection formula for double the fun.)

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 4060
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby Soupspoon » Sun Jul 10, 2016 5:52 pm UTC

PeteP wrote:Eh, the solution won't be quite correct anyway since it probably is bound around the throat and can reach a bit further than the rope length.
When we were given this in a secondary school maths class, in the '80s, the teacher ummed and ahhed a bit over this detail then proclaimed that the length of rope needed to tie the knot around the goat's neck/onto the goat's collar was (by complete coincidence) the same as the extra reach the goat could gain advantage of.

No, I can't remember our answer, but it was roughly calculated as above.

User avatar
PeteP
What the peck?
Posts: 1451
Joined: Tue Aug 23, 2011 4:51 pm UTC

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby PeteP » Sun Jul 10, 2016 6:03 pm UTC

Btw wolfram alpha also has the goat problem itself if someone wants to compare their answer. http://mathworld.wolfram.com/GoatProblem.html

User avatar
Eebster the Great
Posts: 3487
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby Eebster the Great » Sun Jul 10, 2016 6:08 pm UTC

Paradoxica wrote:
Eebster the Great wrote:If I'm understanding the Mathworld formula correctly and haven't made any input errors, then setting d = r for their equation we get the following formula for the area, A, in terms of the radius of the paddock (the smaller circle), r, and the length of the rope (the radius of the larger circle) R: Image.

Wolfram|Alpha easily simplifies this, under the assumption that r and R are positive real numbers, and then if I simpify it further by setting r = 1 (and therefore A = π) I get: Image.

Now, Wolfram|Alpha really tries hard to solve this ugly but seemingly innocuous equation. I mean it really spends a tremendous amount of time computing considering I haven't paid for extra computing time. It doesn't seem to give up. But I can't seem to coax it into giving a solution.

Whatever the solution to this is, simply multiply by r = 100 m and that is the answer.


I don't think your equation is correct. By inspection, R=2 satisfies the equation and we are all fairly certain at this point that it is not an integer.

Whoops, well no because I set A = the area of the enclosure instead of half that area. Obviously in that circumstance R = 2 ought to be a solution. But if we replace π with π/2, it should be right.

User avatar
Flumble
Yes Man
Posts: 2266
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby Flumble » Sun Jul 10, 2016 8:49 pm UTC

Second go at the integrals, this time not messing up straight and curved lines (the arctan would've made sense if I were integrating vertical segments, not curved segments). Once again geogebra comes to the rescue (and wolfram, but that's a given):
circle segment size.png

Spot the error in the integral calculation:
Image
(luckily wolfram also wanted to calculate the integral of 2x*arccos(x/2) in the end, so the last expression is exactly that output and not what came out of integration by parts. But please, if you see the error I presumably made, tell me where it is.)
And huzzah, it's the same equation mathworld has! (given that arccos(1-r^2/2)=2arcsin(r/2) for non-negative reals)
In this form wolfram even allows you to get an approximation of 1.15872847301812....

But yeah, A133731 (linked on the mathworld page) has more digits.

User avatar
Eebster the Great
Posts: 3487
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby Eebster the Great » Mon Jul 11, 2016 7:19 pm UTC

A133731 - OEIS wrote:Decimal expansion of goat tether length to graze half a unit field.
heh

User avatar
PM 2Ring
Posts: 3715
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby PM 2Ring » Fri Jul 22, 2016 9:26 am UTC

We can simplify the equation for r a little. There's a simple relation between the two angles because they are in an isoceles triangle, so we can eliminate one of the cos-1 calls.
Specifically,

cos-1(1 - r2/2) + 2cos-1(r/2) = π

Using 1 for the radius of the field, the equation for r, the tether length, can be written as

π / 2 + (r² - 2) cos-1(r / 2) - r .sqrt(1 - r² / 4) = 0

Here's some Python code that solves that equation using the 3rd-party arbitrary precision library mpmath

Code: Select all

from mpmath import mp

pi 
= mp.pi

def func
(r):
    r2 = r * r
    y 
= r * mp.sqrt(- r2 / 4)
    return pi / 2 + (r2 - 2) * mp.acos(/ 2) - y

mp
.dps = 100

= mp.findroot(func, 1)
print(
r)

Output

Code: Select all

1.158728473018121517828233509933509149688292266492096511820695884820669802559196093199321610730860438


The OEIS link given above doesn't list a formula for this constant, but one of the linked pages, http://oeis.org/A173201 does. The "goat tether number" r is closely related to psi, "the unique solution on (0,Pi) of sin(psi)-psi*cos(psi) = Pi/2". The relationship is r = 2.cos(psi / 2)

The function for psi can easily be solved using Newton-Raphson. Here's some Python code that uses that method to calculate r to the precision supported by normal Python floats (IEEE 754 double-precision).

Code: Select all

from math import sin, cos, pi

= 2
for i in range
(4):
    sx = sin(x)
    x = x - (sx - x * cos(x) - pi / 2) / (* sx)
    print(i, x)

= 2 * cos(/ 2)
print(
r)

Output

Code: Select all

0 1.906084209585137
1 1.9056957426183945
2 1.905695729309884
3 1.905695729309884
1.1587284730181215

Finally, here are 1000 decimal places, calculated using the earlier code, plus a little bit of extra code to do the formatting.

Code: Select all

1.
15872 84730 18121 51782 82335 09933 50914 96882 92266 49209
65118 20695 88482 06698 02559 19609 31993 21610 73086 04381
75967 49518 03405 18290 13925 08985 19099 26483 15448 46906
47994 14791 31748 52921 23564 02155 50163 23125 55506 86141
07819 72335 23550 17317 30653 43998 83035 05798 22481 55293
32171 41835 93309 12956 38485 59445 48041 27554 70688 16521
41840 20376 39610 49267 76710 56442 75329 13272 31265 32403
81347 70707 99486 14142 63256 46378 66611 22832 29089 75517
41115 73624 52541 70228 20719 55925 03623 94916 48880 32069
37051 06905 28405 19907 64163 92339 78104 68333 34144 96228
36912 51972 07948 89224 49372 78035 71735 33743 86181 60160
19796 46465 81839 20200 29405 17264 92245 39295 88320 29979
07620 31259 86973 61437 38544 37450 00060 31757 67277 53349
39964 80440 83983 48421 42312 19487 92589 57215 46425 81160
58695 65776 92540 47710 15738 25828 42835 43829 60688 13280
31687 48990 75429 37542 61432 91028 88349 02554 80282 11005
81989 45895 45781 48215 44625 12803 60480 55047 26965 79583
70011 43121 89242 63795 05106 75034 00669 45418 41932 37899
74734 05934 80088 31827 28764 03156 60630 74016 42923 26283
80151 50178 20537 15568 98600 74230 99366 62491 89439 58602

User avatar
PM 2Ring
Posts: 3715
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: Trickier problem than it seems. (goat in a circular paddock)

Postby PM 2Ring » Wed Aug 10, 2016 2:19 pm UTC

I've created a diagram in SVG for this puzzle.

Here's the SVG code. Just save it to a file with the .svg extension and you can view it in your browser.

Code: Select all


<?xml version="1.0" encoding="UTF-8" ?>
<svg xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    width="400" height="400" viewBox="0 0 240 240">

<!-- The goat tether problem 
See http://forums.xkcd.com/viewtopic.php?f=17&t=117520
Created by PM 2Ring 2016.07.25 -->

<defs>
    <circle id="dot" r="0.75" fill="#000"/>
</defs>

<g transform="translate(120,120)">
    <g style="fill: none; stroke: #000; stroke-width: 0.5">
        <circle r="100"/>
        <line x1="-100" x2="100"/> 
        <line x1="-32.86741629" y1="-94.4443378" x2="-32.86741629" y2="94.4443378"/>

        <path d="M-100, 0
            L-32.8674163, -94.4443378
            A115.8728473,115.8728473 0 0,1 -32.8674163, 94.4443378
            Z"
            style="stroke:#f00; fill:#f00; fill-opacity:0.2;"/>

        <path d="M0, 0
            L-32.8674163, -94.4443378
            A100, 100 1 0,0 -32.8674163, 94.4443378
            Z"
            style="stroke:#00f; fill:#00f; fill-opacity:0.2;"/>

        <!-- Dots -->
        <use xlink:href="#dot"/>
        <use xlink:href="#dot" x="-100" y="0"/>
        <use xlink:href="#dot" x="-32.8674163" y="94.4443378"/>
        <use xlink:href="#dot" x="-32.8674163" y="-94.4443378"/>
        <!-- <use xlink:href="#dot" x="15.8728473" y="0"/> -->
    </g>

    <!-- Annotations -->
    <g style="stroke: none; fill: #000; font-size: 10px">
        <text x="5" y="0">O</text>
        <text x="-110" y="0">T</text>
        <text x="-40" y="-98">A</text>
        <text x="-40" y="103">B</text>
    </g>
</g>
</svg>


Here's a PNG version.
Spoiler:
Image


And here's a simple interactive JavaScript / HTML5 diagram (so save it with the .html or .htm extension) that shows the grazing area for a range of tether lengths. See how well you can estimate the correct length by eye. :)

Code: Select all


<!DOCTYPE html>
<
html>
<
head>
<
title>Goat Tether Problem</title>
<
meta charset="utf-8" /> 
<style>
    #slider_div { margin-left: 25%; }
    #slider {
        width: 50%; border: 1px solid white; border-radius: 3px; 
        outline
: 1px solid white; outline-offset: -1px;
    }
    h3, #canvas_div { text-align: center; }
</style>

<
script>
    var Pi2 = 2 * Math.PI, ox, oy, bigrad, canvas,
        outer_colour = "hsl(120, 80%, 60%)",
        inner_colour = "hsl(90, 80%, 60%)";

    function outputUpdate(rad) 
    
{
        document.querySelector('#radius').value = rad;
        draw(bigrad * rad);
    }

    function setup()
    {
        var canvas_size;

        canvas = document.getElementById('canvas');
        if (canvas.getContext)
        {
            ctx = canvas.getContext('2d');

            //Get window height & calculate canvas dimensions
            canvas_size = 2 * Math.floor(0.8 * window.innerHeight / 2);
            canvas.height = canvas.width = canvas_size;
        }
        else
        
{
            alert("Sorry, I can't set up the canvas!");
            return;
        }

        ox = oy = canvas_size / 2; bigrad = 0.95 * oy;

        //Draw initial state
        outputUpdate(0.50);
    }

    function circle(x, y, rad, fill, stroke)
    {
        ctx.beginPath();
        ctx.arc(x, y, rad, 0, Pi2);
        if(fill)
            ctx.fill();
        if(stroke)
            ctx.stroke();
    }

    function draw(radius)
    {
        ctx.globalCompositeOperation = "source-over";
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        ctx.fillStyle = outer_colour;
        circle(ox, oy, bigrad, true, false);

        ctx.globalCompositeOperation = "source-atop";
        ctx.fillStyle = inner_colour;
        circle(ox - bigrad, oy, radius, true, true);

        ctx.globalCompositeOperation = "source-over";
        circle(ox, oy, bigrad, false, true);
    }
</script>
</head>

<body onload="setup();">
<h3>The Goat Tether Problem</h3>

<div id=canvas_div>
    <canvas id="canvas">
        If you can read this, your browser does not support the HTML5 Canvas.
    </canvas>
</div>

<div id="slider_div">
    <label for="slider">Length</label>
    <input id="slider" type="range" min="0.50" max="1.50" value="0.50" step="0.001" 
        oninput="outputUpdate(value)">
    <output for="slider" id="radius">50%</output>
</div>

</body>
</html>


Return to “Mathematics”

Who is online

Users browsing this forum: No registered users and 10 guests