Codeword Research / Apple LampsGitHub repository

Binary constant-weight codes

646 codewords for A(32,12,15)

Each word is 32 bits long with exactly 15 ones. Any two words differ in at least 12 positions. The construction proves A(32,12,15) ≥ 646; it does not establish the maximum.

Word length
32
Ones per word
15
Minimum distance
12
Pairs checked
208,335

What are we trying to pack?

A codeword is one allowed bit pattern. For example, 110000 and 001100 both have two ones, but differ at four positions. That difference count is their Hamming distance.

The challenge is to fit as many allowed patterns as possible under fixed rules. Here, the rules are 32 bits, exactly 15 ones, and at least 12 differing positions in every pair. More patterns means more messages under the same constraints; this spacing allows unique recovery after up to five bit flips.

Apple Lamps maintains this research project. Mathematician Andries E. Brouwer, professor emeritus at Eindhoven University of Technology, maintains the reference table of bounds. The 646 construction was submitted to him for consideration.

Verify the result

Save both files in the same folder and run with Python 3.10 or newer. No third-party packages needed.

python verify_646.py a32.12.15.646.hex

SHA-256: 44c6fe6c2a3bfbfaaad7f88ec069a04c47b210f779105b870f2d4e7f261eabc2

Pairwise Hamming distances
DistancePairs
1255,017
16108,295
2044,006
241,017

Construction archive