$\textbf{Shatter the Ball}$
You are in a $100$-story building with two identical bowling balls. You want to find the lowest floor at which the ball will shatter when dropped to the ground. What is the minimum number of drops you need in order to find the answer?
$\textbf{Answer}$
$14$.
$\textbf{Analysis}$
If only one ball is provided, then the only way is to find the answer is to try floor by floor. In the worst case, this method will require $100$ attempts.
With two balls at hand, we can use the first ball to help determine the range into which the breaking point floor falls. For example, if we know the breaking point must be between floor $x$ and floor $y$, then we can use the second ball to try floor by floor within this range which will take at most $(y-x+1)$ attempts to find the answer. Accordingly, the total number of attempts will be this number plus whatever number of times the first ball has tried in order to determine the values of $x$ and $y$.
Assuming that we first try the $n^{th}$ floor (i.e. drop the first ball from the $n^{th}$ floor). If the ball shatters, then we know the breaking range is $[1, n]$. It will take the second ball at most $(n-1)$ attempts to test from floor $1$ to floor $(n-1)$. This is because if the ball survives the drop from the $(n-1)^{th}$ floor, we know the breaking point is the $n^{th}$ floor because the first ball shatters at that height. The total number of attempts will be $(n-1)+1=n$.
If the first ball survives the drop from the $n^{th}$ floor, we then can try the $(2n-1)^{th}$ floor. This number is chosen so that the total number of possible attempts will still be $n$ if the first ball shatters at that point. This is because if the first ball shatters at this height, we know the breaking point is in $[n+1, 2n-1]$. It will take the second ball up to $(n-2)$ tries to search in this range. Considering the first ball has been dropped twice, the total number of drops will be $n$.
Therefore, using this strategy, we should test the first ball at the following floors:
- $n$
- $n + (n-1)$
- $n+(n-1)+(n-2)$
- $n+ (n-1) + (n-2) + (n-3)$
- $\cdots$
When the value of $n$ is too small, it will take more attempts to determine the breaking range using the first ball. However, when the value of $n$ is too large, it will take more attempts to determine the exact floor using the second ball. By trial and error, it can be shown that $n=14$ is the optimal number. In this case, the first ball will be dropped at floors: $$14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99$$
If the ball shatters at any of these floors, it will take up to $14$ times in total to determine the exact floor. Otherwise, if the ball survives the drop from floor $99$, it just need one more test to check whether the ball will shatter at the $100^{th}$ floor. In this case, the total number of trials is $12$ which is less than $14$.
$\textbf{Note}$
The key to solve this problem is to come up with this segmentation strategy. Afterwards, the optimal value of $n$ can be obtained by trial and error. Mathematically, it can also be estimated. Assume the number of such segments is $k$, then the last floor to test the first ball is $$n + (n-1)+(n-2)+\cdots + (n+(k-1))=kn - \frac{k(k-1)}{2}$$
This value should be approximate to $100$. Meanwhile we must have $k < n$. This is because the first ball needs to test for up to $k$ times. It must be smaller than the target total number of trials $n$. Setting $k=n$ in the above relation gives $$100\approx kn - \frac{k(k-1)}{2}\approx n^2-\frac{n^2}{2}=\frac{n^2}{2}\implies n \approx 14$$
Then, we can check numbers around $14$ to determine the final answer.