WOLFRAM|DEMONSTRATIONS PROJECT

Patterns Produced by Hamming Distance

​
length of bit sequence
3
Hamming distance h
1
In a bit sequence
b
1
b
2
…
b
n
of length
n
, each bit
b
i
is either 0 or 1. The Hamming distance between two bit sequences is the number of bits in which they differ.
This Demonstration constructs a graph by placing
n
2
vertices uniformly around the unit circle beginning with the vertex at
(1,0)
. List the bit sequences in base-2 order at the vertices going counterclockwise. Two vertices are connected with an edge if the Hamming distance between their corresponding bit sequences is
h
(the value of the lower control).
Some of the patterns created are remarkable.