• Lvxferre@mander.xyz
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 hours ago
    solution

    Number all bottles in binary, starting from 0000000000. Then the Nth prisoner drinks all wines where the Nth digit is “1”. have each prisoner drinking the wines where a certain digit is “1”.

    So for example. If you had 8 bottles and 3 prisoners (exact same logic):

    • number your wines 000, 001, 010, 011, 100, 101, 110, 111
    • Prisoner 1 drinks wines 100, 101, 110, 111; if he dies the leftmost digit of the poisoned wine is 1, if he lives the poisoned wine starts with 0
    • Prisoner 2 drinks wines 010, 011, 110, 111; if he dies the mid digit is 1, else it’s 0
    • Prisoner 3 drinks wines 001, 011, 101, 111; if he dies the right digit is 1, else it’s 0

    If nobody dies the poisoned wine is numbered 000. And if all die it’s the 111.