Fix an ambient finite set $X$, without loss of generality $X = \{1, \ldots, |X|\}$. You wish to identify some subset $B \subseteq X$ hidden to you. You can gain information about the subset as follows: you can choose any subset $C \subseteq X$, and you receive the number $|B \cap C|$.
In terms of $|X|$ (and possibly $|B|$), what is the least number of queries required to determine $B$? How about a special case, for example when $|B| \leq \log_2(|X|)$?
Some observations:
- The case $|B| = 1$ allows binary search, and thus can be done in $\lceil\log_2(|X|)\rceil$. Already for $|B| = 2$, a way with fewer than $2\log_2(|X|) + C$ queries is not clear to me (although I can see how to do $\frac32 \log_2(|X|) + C$ on average).
- Trivially $|X|$ queries always suffices: just start with $C = X$ and remove one element for each query.
- This question was inspired by a recent Google Code Jam problem: there your query consists of a bit for each element of $X$, and you get $|X| - |B|$ bits back. However, in the Google Code Jam problem the returned bits are still ordered correctly, just with missing values. This allows you to match up the responses of multiple queries. Then $\lfloor\log_2(|B|) + 1\rfloor$ queries suffice.