Suppose you want to open a safe with 10 switches. For each switch there're 3 settings, say, 1,2,3. There're 2 key switches. The safe is unlocked once you set the key pair correctly, but you can't distingush the key ones from the others. The question is, how many tries do you need to be sure to open the safe, and how should you choose the combinations (an althorithm)? (For example, if the safe has only 2 switches instead of 10, you need $3\times3=9$ tries) Will the number of tries grow less than linearly as the number of switches increases? Could there be a formula for a general problem of $n$ switches, $m$ settings and $k$ keys?
Shasha's safecracking problem
8
$\begingroup$
combinatorics
puzzle
-
1Curiously, you only need 9 tries even if there are 4 switches (0000, 0111, 0222, 1012, 1120, 1201, 2021, 2102, 2210), but you need more if there are 5 (or more) switches. – 2012-09-04
-
0Gerry's 9 tries form a code in which the next codeword is the first which differs from each of the previous codewords in exactly three places. – 2012-09-04