A Solution Algorithm for Dudley’s Hat Problem
The problem distributes integers starting from 1 among three different arrays. A number can be added only when its value differs from the values of the subset sums in the corresponding array. The added number must also be greater than the last number previously added to that array.
When the problem is solved without a computer, the largest value added to an array is reported as 21. Other algorithms considered for the problem also reached a maximum of 21.
The algorithm I developed reached 27. It checks the results dynamically. Brute-force algorithms that test all possibilities, including parallel implementations, were considerably slower than this dynamic approach.
The optimized algorithm reached the larger value within a short time without requiring a supercomputer.




Share on Facebook
Share on LinkedIn
Share on X
Frequency Table Generation
NFA-to-DFA Converter
Multithreaded Sorting Algorithm Optimization
Huffman Compression Algorithm Optimization