snorkel's blog

By snorkel, history, 3 years ago, In English

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$$$?

  • Vote: I like it
  • +4
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Anyone knows the solution to that problem?

  • »
    »
    3 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    The editorial says

    Spoiler

    But I don't understand how they are connected to the answer, although I understand those two statements.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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.

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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$$$

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          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.