Source

I got this problem from Rustan Leino, who Bertrand Meyer, who had heard it was once given on the Putnam exam.

I solved it and wrote up my solution.

Problem

At some point during a baseball season, a player has a batting average of less than 80%. Later during the season, his average exceeds 80%. Prove that at some point, his batting average was exactly 80%.

Also, for which numbers other than 80% does this property hold?

Solution
Reveal

We will prove that this property holds for numbers $p$ such that $1/(1-p)$ is an integer. We will furthermore prove that the property doesn't hold for any other $p$ such that $0 < p < 1$. Since $p = 0.8$ makes $1/(1-p)$ an integer (specifically, five), the property holds for an 80% batting average.

The property vacuously holds if $p \leq 0$ or $p \geq 1$, since a batting average can never be less than 0 or more than 1. So, for the rest of this solution, we'll just consider $0 < p < 1.$

First, we prove that the property holds if $1/(1-p)$ is an integer. Suppose it doesn't hold for some such $p$. Then, there can be a single at-bat before which the player's average is $< p$ and after which the player's average is $> p$. This must be a successful at-bat since it increases the player's average. Let $h$ be the number of safe hits before this at-bat, and let $b$ be the number of at-bats preceding this at-bat. Also, let $n = 1/(1-p)$, which we know to be an integer. We must have $h/b < p < (h+1)/(b+1).$ Some algebra shows that $p = (n-1)/n$, so we have $h/b < (n-1)/n < (h+1)/(b+1).$ This means that $hn < b(n-1)$ and $(b+1)(n-1) < (h+1)n.$ The first of these can be transformed into $hn + n - 1 < (b+1)(n-1)$ and the latter can be transformed into $(b+1)(n-1) < hn + n.$ Thus, we have \[ hn + n - 1 < (b+1)(n-1) < hn + n. \] In other words, there's an integer $(b+1)(n-1)$ that lies between the integer $hn + n - 1$ and its immediate successor. This is impossible, so the supposition must be false and this case is proved.

Second, we prove that the property doesn't hold if $1/(1-p)$ isn't an integer. $1/(1-p)$ must be positive, so it must be between some non-negative integer and its immediate successor. In other words, there exists an integer $n$ such that $0 \leq n < 1/(1-p) < n + 1$. Some algebra shows that because of this, $(n-1)/n < p < n/(n+1).$ Now, suppose a player has a total of $n+1$ at-bats, out of which all but the first are safe hits. His batting average will take on the values $0/1, 1/2, 2/3, \ldots, (n-1)/n, n/(n+1).$ All but the last of these is $< p$, and the last is $> p$. Thus, the property that $p$ makes this impossible doesn't hold.