Browse · MathNet
PrintSAUDI ARABIAN MATHEMATICAL COMPETITIONS
Saudi Arabia counting and probability
Problem
A lock has 16 keys arranged in a array, each key oriented either horizontally or vertically. In order to open it, all the keys must be vertically oriented. When a key is switched to another position, all the other keys in the same row and column automatically switch their positions too. Show that no matter what the starting positions are, it is always possible to open this lock. (Only one key at a time can be switched.)
Solution
The problem is solved if there is a way to change the orientation of any specified single key, without changing any of the others. This is equivalent to finding a way to switch the chosen key an odd number of times, while switching all other keys an even number of times. This can be done by switching all keys on the same row and column of the chosen key (including the chosen key). To see why, choose a key . If we switch it and all of its sisters that share the same row and column, will be switched 7 times. Now, examine the other 15 keys in the lock. There are two cases: either the key is a sister of , or not. Suppose that is a sister of , say, sharing a row with . Then will be switched 4 times. For the other case, suppose is not a sister of . Then will be switched twice, because among the 6 sisters of which are turned, exactly two of them share a row or column with . Consequently, of all the keys in the lock, only is switched an odd number of times. All other keys are switched either 2 or 4 times, leaving their orientation unchanged. Thus we will be able to open the lock by selecting each horizontal key one-by-one, and turning it and all of its sister keys.
Techniques
Invariants / monovariantsGames / greedy algorithmsAlgorithms