TITLE: Determine hollow marble with least number of weighings
QUESTION [6 upvotes]: We have 135 boxes each containing 100 marbles which look identical and weigh 10 grams, with the exception of one box, which contains hollow marbles of 9 grams each.
  By using a scale that can weight up to 999 grams, what is the least number of weightings required to determine the box with the hollow marbles?

Well, I know the method of numbering the boxes and then taking 1 marble from box 1, 2 from box 2 etc and then compare the result with
$\sum_{k=1}^{135} k*10$,
but this is 91800, so we would roughly need 100 weighings!
Maybe we can split the 135 boxes into two groups, 68+67, then from the first group weigh one of each, to see if the scale displays 680 or 679, then continue with either group which contains the hollow marble and do the same?
2nd weighing: 34 or 33
3rd: 17 or 17 
And then we can apply the 1+2+3… method to determine in which of the two groups 9 or 8 are the hollow marbles.
But this way we will need 5 weighings, which I doubt is the optimum method.
Any help please?

REPLY [6 votes]: If you place at most $100$ marbles on the scale, then you will be able to see exactly how many of them weigh $9$ grams. I will assume this is the only viable option. Indeed you can place more than $100$ marbles on the scale and get information out of this, but I am very confident that this is never part of an optimal strategy.
Then we can generalize the problem. Assume we have $n$ boxes with $m$ marbles. All marbles from all boxes are identical, except one box has special marbles. We have a machine that we can give an arbitrary collection of $m$ marbles, and it will tell us how many are special. The following describes the optimal strategy for this game.
For $x$ a positive integer, let $[x]$ denote the set $\{0,...,x\}$.
Any move can be described by a function $f:[m]\to[n]$ such that $f(k)$ describes the number of boxes from which we take $k$ marbles. Then we need $\sum_kf(k)=n$ and $\sum_kkf(k)\leq m$. If the machine tells us there are $k$ special marbles, then there are $f(k)$ possible boxes left to check. This means that the worst case is that there are $\max_kf(k)$ possible boxes left to check.
Thus, the goal in each step is to minimize $\max_kf(k)$ over all functions $f:[m]\to[n]$ with $\sum_kf(k)=n$ and $\sum_kkf(k)\leq m$. We can do this by means of binary search, by checking for specific values of $M$ whether or not it is possible to have $\max_kf(k)\leq M$.
To check whether $\max_kf(k)\leq M$ is possible, let $n=aM+b$ with $0\leq b<M$. Then assign $f(k)=M$ for $k<a$, $f(a)=b$ and $f(k)=0$ for $k>a$. This gives $\max_kf(k)\leq M$ and $\sum_kf(k)=n$ while minimizing $\sum_kkf(k)$. Thus, we can simply check whether we get $\sum_kkf(k)\leq m$.
Now we can apply this to the case $n=135$, $m=100$. For $M=57$ we find $f=[57,57,21]$ suffices, and for $M=56$ we find $f=[56,56,23]$ does not suffice. Therefore, the optimal strategy is to place $1$ marble from $57$ boxes and $2$ marbles from $21$ other boxes. As a result, the worst case scenario is that there are $57$ boxes left to check.
Then for $M=13$ we find $f=[13,13,13,13,5]$ suffices, and for $M=12$ we find $f=[12,12,12,12,9]$ does not suffice. Therefore, the optimal strategy is to place $1$ marble from $12$ boxes, $2$ marbles from $12$ other boxes, $3$ marbles from $12$ other boxes, and $4$ marbles from $5$ other boxes. As a result, the worst case scenario is that there are $12$ boxes left to check.
Then for $M=1$ we find $f=[1,1,1,1,1,1,1,1,1,1,1,1]$ suffices, and thus we can place $0$ marbles from the first box, $1$ marble from the secend, etc. up to $11$ marbles from the twelveth box. As a result, we will know exactly which box contains the special marbles.
This proves the optimal worst case number of weighings is three. This way, we can also find that the largest number of boxes with which it is possible in three weighings is $140$.