Блог пользователя snorkel

Автор snorkel, история, 4 года назад, По-английски

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

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Anyone knows the solution to that problem?

  • »
    »
    4 года назад, # ^ |
    Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

    The editorial says

    Spoiler

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

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      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.

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

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

        • »
          »
          »
          »
          »
          4 года назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          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.