[Math] An ant on an infinite chessboard

combinatoricsprobability

enter image description here

There is an infinite chessboard, and an ant $A$ is in the middle of one of the squares.

The ant can move in any of the eight directions, from the center of one square to another.
If it moves 1 square north, south, east or west; it requires $1$ unit energy.
If it moves to one of its diagonal neighbor (NE, NW, SE, SW); it requires $\sqrt 2$ units of energy.
It is equally likely to move in any of the eight directions.
If it initially has $20$ units of energy, find the probability that, after using the maximum possible energy, the ant will be $2$ units away from its initial position.

Assumption

If in case it doesn't have enough energy to move in a particular set of directions, it will move in any of the other directions with equal probability.

I approached this problem, considering that the case that it finally ends up $2$ units to the east (we can multiply by four to get all the cases).

If it ends up $2$ units to the east, then $\text{Total steps to right}=2+\text{Total steps to left}$.

We will somehow balance these steps, considering that the ant has a total of $20$ units of energy at the start.

I don't know how to effectively calculate the sample space either.

If the ant takes a total of $n$ steps, such that while taking all $n$ steps it is equally likely to move in any of the eight directions, then the sample space would be $8^n$.

But here we do not know $n$. Further, if the energy left after the second-last step is less than $\sqrt 2$ and more than $1$, then the ant will not be able to move diagonally.

I wasn't able to think of much after this. Help is appreciated.

Best Answer

Thanks for the interesting and creative problem.

It made me curious as to how large the path could get for Energy = 20, so I mapped it:

enter image description here

The origin is the green cell and the possible end cells are yellow. The cells that your question asks for percentages on are the orange squares.

With problems like these with a gajillion possibilities, I lean heavily toward using a simulator.

I ran 4 simulations, each for 100 million trials, and since all 4 of them gave similar results, I concluded that the number of trials for each run was large enough. Here are the results:

enter image description here

------------------------ Original answer end ------------------------

Edit: This may be overkill, but I was curious how many distinct stopping points there were, and I wanted to see how the probabilities decreased as the endpoint got further from the origin.

So, I altered the sim again and re-ran it for 2,147,483,646 runs, and here are those results. The percentages are out of all possible paths, not just for the white slice shown. I am showing only the slice because it considers all 161 distinct points (and makes it small enough to read, but you'll probably need to save it to your machine to view it). All other possible ending points are a reflection of these points.

Quite a few possible ending points far from the origin were never hit once, and some were hit only once (15,10; 16,7; and 17,0)

enter image description here