Tuesday, 19 May 2015

combinatorics - Key and lock puzzle


The idea is to place all the yellow keys into the red locks. There is at least one guaranteed way to do this as the locks as created from the keys and then 'blurred' by adding extra gaps. Solutions however are not (yet!) unique - I haven't figured out how to add gaps without getting more than one solution.


The full white spaces in the red locks take the yellow key bits, the half-red squares are blocked.


keysandlocks1


For example key 1 goes into locks 4 and 8.



Answer



I found two solutions.



I numbered the keys and locks from 1 to 9 and built a simple matrix:



Key / Lock matrix



A "0" means that the key would not fit into the corresponding lock. A "1" means that the key fits. Then, a -1 means that a key would fit, but that the lock is already occupied by another key.



In the last row you can see how the deduction works. First (1.) I assumed that K3 fits only into L5 and K5, and (2.) K5 only into L4. This (3.) blocks K1 for L4, so it needs to be put into L8, and so on (4. to 7.). Two keys (K4 and K7) and two locks (L2 and L3) remained, which can be put into either of them.



So my solutions would be:




1. K1-L8, K2-L1, K3-L5, K4-L2, K5-L4, K6-L7, K7-L3, K8-L6, K9-L9



and



2. K1-L8, K2-L1, K3-L5, K4-L3, K5-L4, K6-L7, K7-L2, K8-L6, K9-L9



No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...