Similar questions 1 more →
Hashing


Answer & solution
Answer: C (no official key was published)
For 52 to reach slot 5, the final occupants 42,23,34 of slots 2,3,4 must already be present. For 33 to reach slot 7, occupants 23,34,52,46 of slots 3,4,5,6 must already be present. Together these constraints make 33 last, and require 42,23,34 before 52; 46 can be anywhere among the first five. Among permutations of the first five keys, 52 must be last among {42,23,34,52}, which happens in 1/4 of the 5! orders. Thus 5!/4=30, option C. These constraints are sufficient because the home-slot keys then occupy their intended slots. Exhaustive simulation of all 720 permutations independently yields 30.
A second count inserts 46 into a sequence containing the other five keys. The first three among those five are 42,23,34 in any of 3! orders, followed by 52 and then 33. The 46 key may be inserted in any of the five gaps before 33, giving 3!×5=30. Inserting it after 33 would allow 33 to occupy slot 6 instead of 7.