A Solution Algorithm for Dudley’s Hat Problem

A Solution Algorithm for Dudley’s Hat Problem

A dynamic algorithmic solution to Dudley’s Hat problem that reached a maximum value of 27 without requiring brute-force supercomputing.

QR code for this page

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.