A friend gave me the following problem to solve. I have been stuck at it for days. With little or no progress. Well, I did get an estimated answer by running a simulation but not the formal solution.

Two players are playing a game of football. The goals are located at positions $0$ (Player A) and $100$ (Player B), and the ball is initially at position $50$.

In one move, a player draws a number from the uniform random distribution $(0, 100)$ and kicks the ball by the same amount towards the other player's goal post.

If at any point the ball crosses a goal post the game ends and the player who made the last move wins. Find the probability of player A winning.


I tried creating an infinite series of probabilities of winning in each move like in the first move there is a 50% chance that Player A wins. This quickly turned into a integral starting at the second move, i.e $ \int_x x * P(player-B's-win | ball-is-at x) * P(ball-at-x) \;\mathrm{d}x$

  • $\begingroup$ Who moves first? This is very important to know as if A moves first, he would have to get a number greater than 49 in order to win and after his turn, B would have to get a number greater than 49+A's number. So the winning probability of B decreases. $\endgroup$ Aug 13, 2021 at 11:25
  • 1
    $\begingroup$ Yes player A goes first. One more thing to add is that the non-integral numbers can be drawn from the distribution (0, 100) $\endgroup$ Aug 13, 2021 at 11:32
  • $\begingroup$ What is the estimate that came out of your simulation? $\endgroup$ Aug 13, 2021 at 11:36
  • $\begingroup$ I ran the game around 1 million times and player A won 736789 times hence the probability is approx 0.736789. $\endgroup$ Aug 13, 2021 at 11:49
  • 1
    $\begingroup$ @HennoBrandsma, I'm not sure what you mean. Your suggestion, $e^{-1}\approx0.367879$, was not at all close to what the OP got. In any event, see the answers that Mike Earnest and I posted nearly simultaneously. $\endgroup$ Aug 13, 2021 at 16:44

2 Answers 2


For any $0\le x\le 1$, let

  • $A(x)$ be the probability A wins when it is A's turn, and the ball is $100x$ units from $A$'s goal.

  • $B(x)$ be the probability A wins when it is B's turn, and the ball is $100x$ units from $A$'s goal.

You want $A(\frac12)$. We then have that $$ A(x) = x + \int_x^{1} B(t)\,dt,\qquad A(1)=1\\ B(x) = \int_0^x A(t)\,dt\qquad\;\qquad B(0) = 0 $$ If we take $\frac{d}{dx}$ of both equations, you get $$ A'(x) = 1 - B(x),\\ B'(x) = A(x)\;\;\;\;\;\;\; $$ The general solution to that system of differential equations is $$ A(x) = c_1\cos x-c_2\sin x\;\;\;\;\;\;\\ B(x) = c_1 \sin x + c_2 \cos x + 1 $$ The initial conditions $A(1)=1$, $B(0)=0$ then imply $c_1=\frac{1-\sin 1}{\cos 1}$ and $c_2=-1$, which means that $$ A(\tfrac12) = \frac{1-\sin 1}{\cos 1}\cdot \cos \tfrac12 + \sin \tfrac12\approx 0.736915 $$

  • $\begingroup$ Great minds think alike! $\endgroup$ Aug 13, 2021 at 16:41
  • $\begingroup$ @BarryCipra Ya beat me to it! I even cheated and used Wolfram|Alpha to solve the system, but your answer shows it is totally doable by hand. $\endgroup$ Aug 13, 2021 at 16:42
  • $\begingroup$ I would have been even quicker, but I kept screwing up the calculations doing them by hand. It helped a lot knowing what the target answer was. $\endgroup$ Aug 13, 2021 at 16:46

The answer, somewhat surprisingly, is


Let's normalize the football field to total "yardage" $1$, and suppose Player A has a distance $x$ to the endzone. If they kick the ball a random distance $k$, they will win with certainty if $k\ge x$ and with probability $1-P(1-x+k)$ if $k\lt x$, where $P(1-x+k)$ represents the probability that Player B wins if the ball lands short of the endzone, setting up B's attempt from a distance $1-x+k$ to the opposite endzone. Thus


It follows that $P'(x)=-P(1-x)$, hence


which means $P(x)=A\cos x+B\sin x$ for some coefficients $A$ and $B$. Now $P(0)=1$ (i.e., Player A is guaranteed a win when there's no distance to kick). Thus $A=1$, so it remains to find $B$. The equation

$$-\sin x+B\cos x=P'(x)=-P(1-x)=-(\cos(1-x)+B\sin(1-x))$$

which holds for all $x$, tells us, on setting $x=0$, that


so $B=-\cos1/(1+\sin1)$ and thus

$$P(x)=\cos x-{\cos1\over1+\sin1}\sin x={\cos x+\sin(1-x)\over1+\sin1}$$

Plugging in $x=1/2$ gives the aforementioned result.

Remark (added later): I really was surprised at the form of the answer; I can't recall ever seeing the sine and cosine of $1$ (and $1/2$) arise so naturally in a probability setting before. Incidentally, if you want to know where Player A should start from so that $P(x)=1/2$, the answer turns out to correspond to

$$\cos x={1+\sin1+\sqrt{(1-\sin1)(7-\sin1)}\over4}\approx0.707388183$$

or $x=\arccos(0.707388183)\approx0.785000122$. That is, to make the contest fair, Player A should make the first kick from ever so slightly inside their own twenty-two-and-a-half yard line.

  • $\begingroup$ BTW, here is a similar problem where weird sine/cosine values show up in the solution: math.stackexchange.com/questions/3866128/… $\endgroup$ Aug 14, 2021 at 17:27
  • $\begingroup$ @MikeEarnest, excellent! I see they arise in much the same way there as here, out of a differential equation. (And I am relieved, for the sake of my memory, to find that I had not provided an answer there.) $\endgroup$ Aug 14, 2021 at 21:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .