Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2007-08-04 03:56:58

mpthomas
Member
Registered: 2007-07-27
Posts: 7

Poor ant

An ant stands in the middle of a circle (3 metres in diameter) and walks in a straight line at a random angle from 0 to 360 degrees. Problem is, it can only walk one metre before it needs a break.

To make things even more exasperating, the ant has the memory of a fish and forgets what direction it has just walked in. After the break, it gets all dizzy and thus chooses another random direction from 0 to 360 in an attempt to escape the circle again).

As you can well imagine, it could escape the circle after just 2 walks (just one break needed). Or... it could take 20,000 walks (19,999 breaks needed)!! There might even be the very slim possibility it might take 20,000^20,000 walks. You can probably guess what I'm going to ask.

What is the average amount of walks required for the ant to escape the circle?

Offline

#2 2007-08-04 04:42:51

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

Re: Poor ant

Do you know the answers to these questions you keep giving us? If so, they really belong in the puzzles section instead of here.

This looks interesting, but I have no idea how I'd start to solve it. I'll come back if I suddenly get an insight. big_smile


Why did the vector cross the road?
It wanted to be normal.

Offline

#3 2007-08-04 06:48:42

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Poor ant

I’ve only got as far as calculating the probability that the ant achieves freedom with only one break (two walks); it’s approximately 0.46.

Or, to be precise,

.

Offline

#4 2007-08-04 09:08:05

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: Poor ant

I haven't worked this fully out, but I'm almost certain it works.  The basic method it uses is to use the symmetry of a circle to do the work for us.  The principle is that as soon as get get D distance away from the center, any point of D distance is exactly the same.

So we start off at (0,0).  After the first step, we are a distance of 1 away.  Using the above principle, I will say that without loss of generality, we are at (1,0).

Now we want to find the average distance away from the center we are after we move another distance of 1.  So we make the function:

Integrate this function from 0 to 2pi, I come up with 8.  Divide this by 2pi to get the average, giving 4/pi, or about 1.27324.  This means that after two steps, we will be an average distance of 1.27324 away from the center.  Unfortunately, we can't simply repeat this step again.  If we were to do so, then we are no longer find the average, as the average from a distance of 0.75 is certainly different than the average from 0.65.  As such, we need to use multiple integrals:

So the integral becomes:

I approximated this for sake of my sanity, and came up with 62.1626.  Dividing this by 4pi^2, I get 1.57619.  So the answer is three.  This agrees with my following simulation:

NextPos[] := (px = Random[
  Real, {-1, 1}]; b = Random[Integer, {0, 1}]; If[b == 1, py = Sqrt[
      1 - px^2], py = -Sqrt[1 - px^2]]; x += px; y += py;)
RunSimulation[] := (x = 0; y = 0; steps = 0; While[x^2 + y^2 < 1.5, 
    NextPos[]; steps++]; Return[steps])
t = 0; m = 0; Do[k = RunSimulation[]; t +=
     k; If[m < k, m = k], {n, 0, 10000}]; Print[m, " ", t/10000.0]

Also, that is precisely how many licks it takes to get to the center of a tootsie roll pop.  Coincidence?  I think not.

Edit: Whoops, looks like I did work it out fully after all.


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

Board footer

Powered by FluxBB