Denote by the set of
pairs from satisfying . From part (b), there
are
pairs in . In the relabelled
natural graph of , we want the
distances of the pairs in to be
equally distributed among all possible distances in the graph. There are
possible distances between
distinct vertices in the graph, so the fact that is a multiple of is a good sign.
We want to permute the elements of in such a way that for each from through , exactly pairs in
have a distance of in the relabelled graph.
There are many ways to do this. The approach given here is inductive,
starting by examining . Consider
the example from the problem statement. In that example, and were switched and and stayed the same.
Although it is not very interesting in , there is an observation we can make
that will generalize. The vertices that are connected by horizontal
edges in the diagram of the natural graph of remain connected by an edge after
permuting. The vertices in the top change order but their distance apart
does not change. Meanwhile, the vertices that are connected by a
vertical edge are moved to occupy opposite corners of the square so
their distance goes from to . While this is only an increase of
, it will be useful going forward
to think of the vertices connected by vertical edges as having gone from
as close together as possible (connected by an edge) to as far apart as
possible.
Now consider the natural graph of , which is pictured below.
There are edges in the graph.
After permuting the labels of the graph, we want pairs of adjacent
vertices to be sent to adjacent vertices, pairs of adjacent vertices to be sent
to vertices with a distance of ,
and pairs of adjacent vertices to
be sent to vertices with a distance of .
Looking at the diagram, we can think of the natural graph of as being composed of two copies of
the natural graph of laid
horizontally on top of each other. The labelling also has some coherence
with the labelling of . First,
label the bottom and top square as if they were copies of the natural
graph of , making sure to label
vertically-adjacent vertices in the same way. Next, append a to the right of every label in the
bottom layer and append a to the
right of every label in the top layer.
To permute the labels in the way we want, we will first perform the
same permutation on each layer as we did in . In each layer, this moves two pairs
of labels from adjacent vertices so that they are at a distance of . There are also two pairs of adjacent
vertices in each layer that remain adjacent after permuting. The four
pairs of vertically-adjacent vertices will remain vertically adjacent
because we will have performed the exact same permutation in each layer.
At this point, the labels on four pairs of adjacent vertices have been
sent to vertices that are apart
and the other pairs of labels
remain on adjacent vertices. The diagram below shows what we have done
so far:
The second and final step is to swap the corners in the top layer.
This will have the effect of moving the labels on vertically-adjacent
vertices to be as far apart as possible. In a "cube", this means they
will end up at opposite ends of a "space diagonal". Swapping the corners
in a layer preserves the distance between all pairs of vertices in that
layer. This means the net effect of the second step is to move four
pairs of adjacent vertices so that they are at a distance of . The overall effect is shown below:
In the table below, the first column has the pairs from and the second column has the
distance of the corresponding pair in the relabelled graph.
As grows, the natural graph of
gets harder and harder to draw
in a useful way, so we need some notation to help translate the
geometric idea into symbols. First, we will clarify what we actually
want.
Suppose is a function with
domain and
codomain . This means
is a function that takes elements
of as input and also outputs
elements of . When we talk about
a permutation of , we really
mean a function with domain and
codomain both equal to that is
a bijection. For a brief discussion about what a bijection is,
you can consult Appendix 1 from the solution to the February 2023
problem. In the context of this solution, a function from to is a permutation if every possible
output is attained by exactly one input. For example, the function with domain and codomain given by is a bijection from to . Every possible output is attained
(the four elements of appear on
the right side of the displayed equations above) and no output is
attained more than once. If you think about it, every way to order the
elements of (a permutation)
corresponds to exactly one such function: choose an order of the
elements, then write them in that order in the second column above. It
will not be important for this solution, but it might help you to
understand this connection if you convince yourself that there are
exactly bijections from to itself.
A rearrangement of the labels in the natural graph of can be thought of as a bijection from
to itself. If is such a function, then is equal to the original label
of the vertex to which the label is sent by the permutation. For
example, the permutation for
corresponding to the relabelling from earlier (shown below)
is given by For example, the fourth of
the displayed equations above is because in the second diagram
appears where originally appeared.
This is an important observation because we can now recognize
distance in the relabelled graph as a Hamming distance. The distance
between and in the relabelled graph is equal
to the distance between
and in the original
graph. By part (a), this means the distance between and in the relabelled graph is equal
to .
We can now formally articulate what we seek. For each , we would like a function with domain and codomain both equal
to with the following
properties.
is a permutation of
(a bijection).
Among the pairs
from , takes on each
value from through exactly times.
It may be a good idea to digest what has been said so far, possibly
going back to see how this applies to and .
We can now define for each
, but the definition will be
recursive, so we need a bit more notation. For an element in where , we will write to mean the element of that is obtained by appending a
to the right end of . For example, . Similarly, is the element of obtained by appending to the right end of . Also, we will denote by the element of obtained by changing every coordinate
of from to or to , as appropriate. For example, if , then .
Starting with (which we have
not addressed up to this point) we will let . That is, is the identity
function. The elements of are
and , and and . We now continue recursively.
For , we define from as follows.
If is of
the form for some , then .
If is of
the form for some , then .
Notice that the above instructions indeed explain how to evaluate
at every element of because each element of can be constructed in exactly one
way by appending either a or a
to the right of an element from
. As an example, we will
determine exactly what does to
each element in . For , we have to use the rule in the first
bullet point because the rightmost digit is . , so we have that . Since the second digit of
is also and , we get that . For , we have to use the rule in the second
bullet point. This means . Finally, . This is exactly the function from to itself discussed earlier. We leave
it as an exercise to verify that is exactly the permutation of discussed earlier.
We can now prove by induction that does what we want for every . Before doing that, we will discuss how
this function corresponds to the geometric idea from earlier. The
elements in can be obtained
by taking each element of and
appending a to the right and a
to the right, in a way getting
two elements in from every
element in . By this reasoning,
can be thought of as two
copies of : elements ending in
and elements ending in . If you look at the natural graph of
above, these two copies are
exactly the "bottom" and the "top" squares. The way is defined is to operate
differently on the two copies of , since how is computed depends on
the rightmost digit of . In
other words, it depends on which copy of belongs to. If has a rightmost digit of , then essentially does what did. This corresponds to the bottom
face of the cube being permuted exactly as the square was. If the
rightmost digit of is , then is in the other copy,
corresponding to the top face of the cube in the case of . In this situation, we apply to the element of obtained by removing the last digit,
just as we would if the rightmost digit were . However, we then switch every digit,
and this corresponds to "swapping the diagonals" in . Finally, a is appended to the right of the result,
which corresponds to making sure that elements in the top of the cube
stay in the top of the cube during the permutation.
For , it is an exercise in
understanding definitions to see that satisfies the given conditions. We
have already established this for , and can be verified by confirming that
is exactly the permutation from
earlier that we verified worked.
We now assume, for some ,
that is a permutation of with the property that among pairs
from , takes on every
value from through exactly times. We will show that is a permutation of with the property that among
pairs from , takes
on every value from through exactly times.
To see that is a
permutation, let be
arbitrary. Since is a
permutation, there is a unique element such that and a unique element
such that . Using the
definition of , we have
and . Since every element in
is of the form or for some , we have shown that every
element of is in the range
of . Now suppose
are the elements of (in
some order). We have shown that every element of appears in the list
at least once. There are
elements in the list above and elements in , so every element of must appear in the list above
exactly once. In other words, is a permutation of .
To prove the other fact about , we will use the fact that for any and . It is left as an exercise to
verify this.
Suppose is a positive integer
such that . By
induction, there are exactly pairs in with . If is one of these pairs, we have where the second equality is because the
elements in question agree in the last coordinate, so their Hamming
distance is equal to the Hamming distance between the elements obtained
by removing the rightmost elements. We similarly have that Therefore, there are pairs from satisfying for
each .
Next, for any , we
have where the second equality is because we
know that the two elements being handed to have different rightmost coordinates,
so their Hamming distance is one more than the Hamming distance between
the elements obtained by removing the rightmost coordinates. The third
equality is because and differ in all coordinates by definition.
There are elements of , and each pair is in , so we get pairs from such that .
For each from through , we have found pairs from with the property that .
This completes the proof.