CEMC Banner

Problem of the Month
Problem 7: April 2023

Let An denote the set of all n-tuples of 0s and 1s. For example, A2 is the set of all ordered pairs of 0s and 1s or A2={(0,0),(0,1),(1,0),(1,1)}. To improve readability, we will omit the commas and parentheses from the elements of An. For example, the elements of A3 will be denoted by 000, 001, 010, 011, 100, 101, 110, and 111.

Variables referring to elements of An will be bold lowercase letters. For example, we might refer to elements in A2 as a, or b, and so on. To refer to the coordinates of elements in An, we will use square brackets. For example, if a=11010, an element in A5, then a[1]=1, a[2]=1, a[3]=0, a[4]=1, and a[5]=0.

For two elements a and b in An, the Hamming distance, denoted d(a,b) between a and b is equal to the number of coordinates where they differ. For example, if a=11010 and b=01110, then d(a,b)=2 because a[1]≠b[1] and a[3]≠b[3], but a[i]=b[i] for i=2, i=4, and i=5. It is important to convince yourself that d(a,b)=d(b,a) for any a and b.

The notion of a graph was defined in the extra information about the February 2023 problem, but there are also plenty of places online that have definitions. We will keep things simple here and define a graph to be a collection of vertices, some of which are connected to each other by edges. When we draw a graph, a vertex will be represented by a circle and an edge will be represented by a line segment from one vertex to another. Two examples of graphs are depicted below. The one on the left has four vertices and the one on the right has eight. Note that two edges intersecting does not necessarily imply the presence of a vertex.

Four vertices connected by four edges forming a square. Four vertices connected by four edges form a first square, and another four vertices connected by four edges form a second square. The second square is slightly offset from the first so the squares overlap in a smaller square area. Corresponding pairs of vertices of the two squares are connected by four additional edges.

For each n, we define a graph with 2n vertices called the natural graph of An. In the natural graph of An, it is possible to label every vertex by exactly one element of An such that there is an edge between two vertices exactly when their Hamming distance is 1. The two examples above are the natural graphs of A2 and A3. They are shown again below with their vertices labelled.

Starting at the bottom left corner and moving clockwise around the perimeter of the square, the vertices are labelled 0 0 then 0 1 then 1 1 then 1 0. In the first square, starting at the bottom left corner and moving clockwise around the perimeter, the vertices are labelled 0 0 0 then 0 0 1 then 1 0 1 then 1 0 0. In the second square, starting again at the bottom left corner and moving clockwise around the perimeter, the vertices are labelled 0 1 0 then 0 1 1 then 1 1 1 then 1 1 0.

A walk in a graph from vertex v to vertex w is a sequence of vertices starting at v and ending at w with the property that there is an edge connecting every pair of consecutive vertices in the sequence. The length of a walk is the number of edges it uses. For example, let v, w, x, and y be the vertices labelled by 000, 110, 100, and 010 in the natural graph of A3, respectively. Then v,x,w and v,y,w are walks of length 2 from v to w. The distance between v and w in a graph is equal to the shortest possible length of a walk from v to w. In the example above, v and w have a distance of 2 because there are walks of length 2, but there are no shorter walks from v to w.

  1. Let a and b be elements of An. Show that d(a,b) is equal to the distance between a and b in the natural graph of An.

  2. For each k with 1≤k≤n, determine the number of two-element subsets {a,b} of An that satisfy d(a,b)=k.

  3. Suppose we were to relabel the vertices of the natural graph of An by permuting the labels. That is, we keep the graph the same but use the elements of An to label a vertex of the graph in some other way. For example, in A2, we might leave 00 and 10 where they are and swap the positions of 01 and 11, as shown.

    First graph: Starting at the bottom left and moving clockwise, the vertices are labelled 0 0 then 0 1 then 1 1 then 1 0. Second graph: Starting at the bottom left and moving clockwise, the vertices are labelled 0 0 then 1 1 then 0 1 then 1 0.

    When this is done, the distance in the new graph between elements of a and b is not necessarily equal to d(a,b) any more. The table below has the two-element subsets of A2 in the first column, d(a,b) in the second column, and their distance in the relabelled graph in the third column.

    {a,b} d(a,b) new distance
    {00,01} 1 2
    {00,10} 1 1
    {00,11} 2 1
    {01,10} 2 1
    {01,11} 1 1
    {10,11} 1 2

    Among the four subsets {a,b} with d(a,b)=1, there are two that have a distance in the relabelled graph of 1 and two that have a distance in the relabelled graph of 2.

    Now for the question: For each n, find a way to permute the elements of An so that the following happens: Among all two-element subsets {a,b} of An with d(a,b)=1, there are the same number with each possible distance in the relabelled graph.