The problem can be found here.
Abridged problem statement: You are given $$$n$$$ bandits and each of them you should give some number of keys (subset of $$$1$$$ to $$$k$$$) such that to get every key ($$$1$$$..$$$k$$$) you should use at least $$$m$$$ bandits and not less! What is the value of $$$k$$$?
Anyone knows the solution to that problem?
The editorial says
$$$n$$$ choose $$$m-1$$$, because:
For each subset of $$$m−1$$$ bandits, there must be at least one lock that they cannot open (lower bound).
For each subset of $$$m−1$$$ bandits, have one lock such that the keys are distributed to all others who are not in the subset. Any group of $$$m$$$ bandits must have a key to every lock (upper bound).
But I don't understand how they are connected to the answer, although I understand those two statements.
If you didn't understand, think this way. Let initially all bandits have all K keys. Now pick a subset of M-1 bandits and remove a specific key. Now notice that no matter what, these M-1 bandits can never open the treasure because of that missing key.
Do this for all subsets of M-1, and whenever you'll pick M or more bandits, there will always be all keys. Notice that we have to remove distinct keys from subsets otherwise the second condition that M or more bandits can always open key will not be possible.
So answer is n choose m-1.
Can you say how do we remove the key? We remove a specific key from all of the bandits in the subset right? What I don't understand is how do we repeat this process for all subsets of size $$$m-1$$$
We aren't actually simulating the whole process.
What i said above was a way to construct one solution. For the mentioned problem, we don't need to actually construct it.
Removing 1 distinct key from every subset of size m-1 can give us a valid answer. So we need (n choose m-1) distinct keys to construct the answer. Work this out manually on some small examples to understand.