Daily

Random

Practice set

Baltic Way 2021 · Problem 8

Combinatorics

We are given a collection of 22k2^{2^{k}} coins, where kk is a non-negative integer. Exactly one coin is fake. We have an unlimited number of service dogs. One dog is sick but we do not know which one. A test consists of three steps: select some coins from the collection of all coins; choose a service dog; the dog smells all of the selected coins at once. A healthy dog will bark if and only if the fake coin is amongst them. Whether the sick dog will bark or not is random.

Devise a strategy to find the fake coin, using at most 2k+k+22^{k}+k+2 tests, and prove that it works.

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Games and strategies · Pigeonhole and extremal arguments

Solutions

Solution

Number the coins by 2k2^{k}-digit binary numbers from 00…0⏞length 2k\overbrace{00 \ldots 0}^{\text {length } 2^{k}} to 11…1⏞length 2k\overbrace{11 \ldots 1}^{\text {length } 2^{k}}. Let AiA_{i} be the set of coins which have 0 in ii-th position of the binary number. The first 2k2^{k} tests we perform with the help of 2k2^{k} different dogs. In the ii-th test we determine whether the set AiA_{i} contains the fake coin. With out loss of generality we may assume that the dogs determined that all the digits in the number of the fake coin are 0 's. Due to the possible presence of the sick dog in these tests, it means in fact that the binary number of the fake coin contains at most one 1 .

 length 2k\text { length } 2^{k}

In the next test we let a new dog determine whether the coin 00…000 \ldots 0 is genuine. If the new dog barks then the coin is really fake, for otherwise two dogs had given us a false answer. If the new dog does not bark we find a dog we have not used before to test the suspected coin.

(i) If the last two dogs disagree one of them must be sick and hence the first kk dogs must be healthy. length 2k2^{k}

In this case the coin 00…0⏞\overbrace{00 \ldots 0} is the fake one.

(ii) If the last two dogs agree (by not barking) it follows that both of them are healthy. The reason is that if one of the last two dogs was sick and did not bark, it would mean that the first kk dogs were length 2k2^{k}

healthy, implying that the coin 00…000 \ldots 0 is fake, but then the other of the last two dogs is healthy and did not bark at the fake coin, a contradiction.

Therefore one of the first 2k2^{k} dogs gave a wrong verdict. In this case we have 2k2^{k} possible candidates for the fake coin. We can find the fake coin using the last dog and kk tests using binary search.

It follows that no more than 2k+k+22^{k}+k+2 tests are needed.

Contest context

Results from Baltic Way 2021

12 teams

Mean score
3.4 / 5
Scores of 4 or 5
8 / 12
Estonia
5 / 5

Score distribution

02
12
20
30
41
57
All team scores
TeamScore
St. Petersburg5 / 5
Estonia5 / 5
Germany5 / 5
Latvia5 / 5
Lithuania1 / 5
Poland0 / 5
Denmark4 / 5
Norway1 / 5
Finland5 / 5
Sweden5 / 5
Iceland5 / 5
Ireland0 / 5