# Lomont.org

(Also lomonster.com and clomont.com)

Published

Here's a math puzzle.

# Walking Ant Probability Problem

Chris Lomont, Nov 2017

An ant is dropped onto a 3-4-5 right triangle, then walks in a straight line until he leaves the triangle. What is the probability of exiting on the length 5 side?

We assume all probabilities are uniform: the area of the triangle and the direction as an angle in $$[0,2\pi]$$.

Let the triangle be $$\Delta ABC$$ with point $$D=(x,y)$$ chosen uniformly by area on the triangle, with $$A=(0,3), B=(0,0), C=(4,0)$$. Then the ant walks off the 5 length edge with probability $$p_x=\frac{\angle ADC}{2\pi}$$.

Let $$\alpha=\angle DAC,\beta=\angle DCA,\gamma=\angle ADC$$. Then $$\alpha + \beta + \gamma = \pi$$, $$\tan(\angle A-\alpha)=\frac{x}{3-y}$$, and $$\tan(\angle B-\beta)=\frac{y}{4-x}$$. Using $$\angle A + \angle B + \pi/2 = \pi$$, and combining, gives

$\gamma=\frac{\pi}{2}+\tan^{-1}\frac{x}{3-y}+\tan^{-1}\frac{y}{4-x}$

Integrating over the triangle, and dividing by the triangle area and $$2\pi$$, gives the desired probability

$p=\frac{1}{2\pi}\times\frac{1}{6}\int_\Delta\frac{\pi}{2}+\tan^{-1}\frac{x}{3-y}+\tan^{-1}\frac{y}{4-x} dA$.

This gives

$p=\frac{1}{4}+\frac{1}{12\pi}\int_0^3\int_0^{\frac{4}{3}(3-y)} \tan^{-1}\frac{x}{3-y} dx dy +\frac{1}{12\pi}\int_0^4\int_0^{\frac{3}{4}(4-x)} \tan^{-1}\frac{y}{4-x} dy dx$

The last 2 terms have the same form: $_0^a_0^{m(a-t)} ^{-1} ds dt$. Solving,

\begin{aligned} \int_0^a\int_0^{m(a-t)} \tan^{-1}\frac{s}{a-t} ds dt &= \int s\tan^{-1}\frac{s}{a-t}-\frac{a-t}{2}\ln((a-t)^2+s^2)|^{m(a-t)}_0 dt \\ &= [m\tan^{-1}m - \frac{1}{2}\ln(m^2+1)]\int_0^a (a-t) dt \\ &= [m\tan^{-1}m - \frac{1}{2}\ln(m^2+1)] a^2/2 \end{aligned}

Plugging in and simplifying gives

$p=\frac{12\pi + 16 \ln(4/5)+9\ln(3/5)}{24\pi}\approx 0.39$

Categories:

Tags: