# The Toothpick Problem

*Achyut Bharadwaj*

##### March 2023

## The Problem #

Take a square piece of paper. Take a toothpick of a given length. At intervals equal to the length of the toothpick, draw lines on the piece of paper. Now, randomly toss a bunch of such toothpicks so that they fall over the paper. What fraction of the toothpicks will fall in a way so that they intersect one of the lines drawn? In other words, what is the probability of a single toothpick falling over a line?

## Acknowledgement #

Grateful thanks to my 12th grade mathematics teacher at GEAR, Ms. Arathy Balasubramanian, for this very interesting problem.

## Simplification #

Let us first simplify the problem. Consider the simplest case when there is only one line drawn. If there is more than one line drawn, the probablity will still be the same. This is because, a toochpick has equal probability of falling over any given line. Thus, we may assume that there is only one line drawn, without loss of generality.

The problem therefore simplifies to as follows: Refer to the above figure. Suppose we have a piece of paper, over one of whose edge, a line is drawn. We must find the probability that a toothpick, of length equal to the width of the paper, falls on the line drawn.

## Making the problem mathematical #

The most obvious relation a piece of paper has to a mathematical idea is a cartesian plane. Therefore, let the piece of paper be a cartesian plane. For simplicity, we may assume without loss of generality that the edge of the paper is the $y$-axis of the cartesian coordinate. Also, we may assume that the other edge of the paper, on which the line is drawn, is the line $x=1$ without loss of generality. Note that we have implicitly assumed that the length of the toothpick is $1$ (without loss of generality).

We may also represent the toothpick as a set of two points at a distance of $1$ (representing it as a vector is unnecessary).

Therefore, we must find the probability that the line segment joining a set of two randomly chosen points at a distance $1$ intersects the line $x=1$. However, note that we must ignore the cases when both points are chosen outside the region $0\leq x \leq 1$, since this will mean that the toothpick falls outside the paper.

So, let the toothpick be represented as the tuple of points $(A,B)$. We shall assume that $A \in 0\leq x\leq 1$ without loss of generality. So, $B$ is a free point at a distance $1$ from $A$.

Thus, the mathematical statement of the problem can be stated as follows: Suppose a set of two random points $(A, B)$ is chosen such that $A$ lies in the region $0 \leq x \leq 1$ and $\overline{AB} = 1$. Find the probablity that the line segment joining $A$ and $B$ intersects $x=1$.

## Further simplification #

Let us further simplify the problem. Note that the $y$-coordinate of point $A$ has absolutely no effect on the probability of $AB$ intersecting $x=1$. So, we shall assume without loss of generality that $A$ lies of the $x$-axis.

We then need to find the probability that $AB$ intersects $x=1$. Note that while the $y$-coordinate of $A$ has no effect on the probability, the $x$-coordinate does. In other words, the probablity that $AB$ intersects $x=1$ does depend on the $x$-coordinate of $A$.

In order to further simplify things, we would be tempted to assume that $A$ is a fixed point, and find the probability of $AB$ intersecting $x=1$ given this information. However, we know that the probability is affected by the $x$-coordinate of $A$. Nevertheless, let us go forward with this assumption and account for the varying $x$-coordinate later.

We shall first give coordinates to this fixed point $A$. Let us assume that the distance between $(1, 0)$ and $A$ is $x$. In other words, $A (1-x, 0)$ (we could also have chosen $A$ to be $(x,0)$. Our choice is purely for convenience).

We now find the probability that a randomly chosen point $B$ at a distance $1$ from $A$ intersects $x=1$.

The fact that $A$ is fixed and that $B$ is at a fixed distance of $1$ motivates us to think of circles. We may rephrase the problem in terms of circles as follows: Consider a fixed point $A (1-x, 0)$, and a circle of radius $1$ centered at $A$. A point $B$ is chosen randomly on the circumference of the circle. What is the probability that $AB$ intersects $x=1$.

Clearly, as can be supported by the above diagram, the line joining $AB$ intersects $x=1$ if and only if the $x$-coordinate of $B$ is greater than $1$.

In other words, we must find the probability that $B$ lies in the following region:

If $\theta$ is the angle subtended above the $x$-axis (see figure above), then the probability is clearly: $2\theta/2\pi = \theta/\pi$ since the full circle makes an angle of $2\pi$ radians.

We therefore have to find $\theta$. Notice that since the radius of the circle is $1$, we have $cos\theta = x$. So, $$\theta = \cos^{-1}x$$

Therefore, the probability that $AB$ intersects $x=1$ if $A$ is a fixed point on the $x$-axis at a distance $x$ from $(0,1)$, is given by: $$P(x) = \frac{\cos^{-1}x}{\pi}$$

## The final step #

We have therefore found the probability that $AB$ intersects $x=1$ when $A$ lies at $(1-x, 0)$. What if $A$ is an arbitrary point on the $x$-axis as it is?

In order to find this, we may simply add up the probablities of $AB$ intersecting $x=1$ for each value of $x$ ranging from $0$ to $1$. Mathematically, this may be represented as: $$P = \int_0^1P(x)dx = \int_0^1\frac{\cos^{-1}x}{\pi}dx = \frac{1}{\pi}\int_0^1\cos^{-1}x dx$$

We will first evaluate the antiderivative of $\cos^{-1}x$, i.e. $$I = \int\cos^{-1}x dx$$ Let $x = \cos t$. Then, $$dx=-\sin t dt$$ Hence, $$I = -\int t\sin t dt$$ We can use integration by parts on the above to get: $$I = t\cos t - \sin t = x\cos^{-1}x - \sqrt{1-x^2}+C$$

Thus, $$P = \frac{1}{\pi}\left.\left(x\cos^{-1}x - \sqrt{1-x^2}\right)\right\rvert_0^1 = \boxed{\frac{1}{\pi}}$$