# What is a Ham Word™?

This is in the spirit of the What is a Word™/Phrase™ series started by JLee with a special brand of Phrase™ and Word™ puzzles.

If a word conforms to a special rule, I call it a Ham Word™.
Use the examples below to find the rule.

$$\begin{array}{|c|c|}\hline \bbox[yellow]{\textbf{Ham Words }^™}& \bbox[yellow]{\textbf{Not Ham Words }^™}\\ \hline \text{ Bert }&\text{ Ernie }\\\hline \text{ DAMP }&\text{ RAMP }\\\hline \text{ towel }&\text{ towels }\\\hline \text{ GUNS }&\text{ SWORDS }\\\hline \text{ toxic }&\text{ healthy }\\\hline \text{ Porto }&\text{ Lissabon }\\\hline \text{ HAM }&\text{ BACON }\\\hline \text{ fillet }&\text{ fish }\\\hline \text{ SPAM }&\text{ MAIL }\\\hline \text{ roll }&\text{ wrap }\\\hline \text{ PUNS }&\text{ PUNCH }\\\hline \text{ troll }&\text{ goblin }\\\hline \text{ Kiel }&\text{ Hamburg }\\\hline \text{ MAP }&\text{ FLATTEN }\\\hline \text{ flow }&\text{ stream }\\\hline \text{ SPAN }&\text{ SPLIT }\\\hline \end{array}$$

In case you want it in CSV:

Ham Words,Not Ham Words
Bert,Ernie
DAMP,RAMP
towel,towels
GUNS,SWORDS
toxic,healthy
Porto,Lissabon
HAM,BACON
fillet,fish
SPAM,MAIL
roll,wrap
PUNS,PUNCH
troll,goblin
Kiel,Hamburg
MAP,FLATTEN
flow,stream
SPAN,SPLIT


The puzzle relies on the series' inbuilt assumption, that each word can be tested for whether it is a Ham Word™ without relying on the other words.

These are not the only examples of Ham Words™, many more exist and can be found.

• Are we to assume that capitalization matters? – greenturtle3141 Nov 28 '16 at 19:58
• @greenturtle3141 if not, you may certainly wonder why I would add this feature :) (i.e. yes) – user6196 Nov 28 '16 at 19:59
• I would appreciate feedback... – user6196 Nov 28 '16 at 21:04
• I think people are starting to get tired of these types of puzzles – Areeb Nov 28 '16 at 22:22
• Is this to do with Pig Latin?... – boboquack Nov 29 '16 at 4:44

Ham words are words that consist solely of characters, whose binary representation (ASCII) has even parity, i.e. contains an even number of 1's.
These are called Ham words, because they are related to the Hamming weight of the binary representation of their letters. The Hamming weight of a binary code is the sum of all 1's in it. All Ham words are words in which all letters have even Hamming weight, which we might call Ham letters.
The full list of (uppercase) letters goes:
A = 1000001 --> Hamming weight = 2 --> Ham letter
B = 1000010 --> Hamming weight = 2 --> Ham letter
C = 1000011 --> Hamming weight = 3 --> Not a Ham letter
D = 1000100 --> Hamming weight = 2 --> Ham letter
E = 1000101 --> Hamming weight = 3 --> Not a Ham letter
F = 1000110 --> Hamming weight = 3 --> Not a Ham letter
G = 1000111 --> Hamming weight = 4 --> Ham letter
H = 1001000 --> Hamming weight = 2 --> Ham letter
I = 1001001 --> Hamming weight = 3 --> Not a Ham letter
J = 1001010 --> Hamming weight = 3 --> Not a Ham letter
K = 1001011 --> Hamming weight = 4 --> Ham letter
L = 1001100 --> Hamming weight = 3 --> Not a Ham letter
M = 1001101 --> Hamming weight = 4 --> Ham letter
N = 1001110 --> Hamming weight = 4 --> Ham letter
O = 1001111 --> Hamming weight = 5 --> Not a Ham letter
P = 1010000 --> Hamming weight = 2 --> Ham letter
Q = 1010001 --> Hamming weight = 3 --> Not a Ham letter
R = 1010010 --> Hamming weight = 3 --> Not a Ham letter
S = 1010011 --> Hamming weight = 4 --> Ham letter
T = 1010100 --> Hamming weight = 3 --> Not a Ham letter
U = 1010101 --> Hamming weight = 4 --> Ham letter
V = 1010110 --> Hamming weight = 4 --> Ham letter
W = 1010111 --> Hamming weight = 5 --> Not a Ham letter
X = 1011000 --> Hamming weight = 3 --> Not a Ham letter
Y = 1011001 --> Hamming weight = 4 --> Ham letter
Z = 1011010 --> Hamming weight = 4 --> Ham letter
The lowercase letters are the exact opposite, because all the 0's in the second position will be replaced by 1's, increasing the Hamming weight by 1 and thereby reversing the parity.
In other words:
Ham letters: ABDGHKMNPSUVYZ and cefijloqrtwx
Not Ham letters: CEFIJLOQRTWX and abdghkmnpsuvyz

Reasoning that led to this conclusion:

First of all, there's a lot of similar letters in all of the Ham words, so I'm assuming a word is a Ham word if it consists solely of letters that are within a certain subset.
If this is indeed true, all we need to do here is determine the subset and why it was chosen in that specific way.
First, we can collect all letters that are definitely in the subset (namely the letters we observe in Ham words), they are the following (and I will split this out in uppercase and lowercase letters, since they should clearly be treated separately): BDAMPGUNSHK, ertowlxicf, or, reordering: ABDGHKMNPSU and cefilortwx Next, we can collect all letters that are definitely not in the subset. The way we do this is, we look for Not-Ham words that are made up out of letters from the subset (as mentioned above) and one single letter not from the subset: CR, s. Unfortunately, there aren't many of them.