Finding a good hash function can be difficult. Most of the common methods (polynomial multipliers, shifitng bits, mid-square techniques) don't seem to change the number of collisions significantly on the file /usr/dict/words. A technique that can be used is a STOCHASTIC LEARNING algorithm. One variable that will change the number of collisions is to change the order in which each letter of each word is used in a polynomial hash sequence. For example, the word "cat" can be hashed as: c + a*39 + t*39^2 OR a + t*39 + c*39^2 OR t + a*39 + c*39^2 etc. Essentially this is assigning an exponent to be associated with a character position in the word..In the example above, there are exactly 3! = 3 x 2 x 1 = 6 sequences of exponents associated with a 3 character word. So we can try different sequences on a set of words to be hashed. For the Java reserved words, we have a maximum word length of 12 ("synchronized"). So there are 12! possible exponent sequences to test. PROBLEM: this is an enormous number of sequences! its equal to: (12!=479,001,600). This is probably too many for a brute force trial and error approach. So what do we do? We try RANDOM sequences and see how many collisions we get. If we get a reduced number of collisions we remember that sequence, and keep generating new sequences. So the algorithm competes against itself, remembering the best sequence over time.