Coordinates Determine the Neighbors
A hypercube is described by binary strings: its vertices record choices of 0 or 1 in each coordinate, and an edge represents changing exactly one choice. This description gives two useful structural facts. Each coordinate supplies one neighbor of every vertex, so the degree is the dimension. Also, changing one coordinate switches the parity of the number of 1s, so the vertices split into two parts with every edge crossing between them. We will prove both statements directly and check them on the first three positive-dimensional cubes.
For example, the vertices of \(Q_2\) are \(00,01,10,11\). The string \(00\) is adjacent to \(01\) and \(10\), because each differs from \(00\) in one coordinate; it is not adjacent to \(11\), which differs in two coordinates. The definition specifies both the vertices and adjacency rule, so it determines the whole graph without a drawing.
The Degree of Every Vertex
Proof. Fix a vertex \(x=x_1x_2\cdots x_n\) of \(Q_n\). For each coordinate \(i\) with \(1\leq i\leq n\), let \(x^{(i)}\) be the string obtained by replacing \(x_i\) by the other binary value and leaving every other coordinate unchanged. Then \(x^{(i)}\) differs from \(x\) in exactly one coordinate, so \(x^{(i)}\) is adjacent to \(x\). If \(i\neq j\), the strings \(x^{(i)}\) and \(x^{(j)}\) differ at coordinate \(i\), so they are distinct. Conversely, any neighbor of \(x\) differs from it in exactly one coordinate \(i\), and therefore equals \(x^{(i)}\). There are exactly \(n\) such neighbors. When \(n=0\), there are no coordinates and no neighbors, so the degree is \(0=n\) as well. \(\square\)
The proof is a complete description of the neighborhood: changing coordinate \(i\) gives one neighbor, and every neighbor arises from one such change. The distinctness matters. If two coordinate changes produced the same neighbor, counting coordinates would overstate the degree; the proof rules that out.
Worked Example: The One-Dimensional Cube
Let \(Q_1\) have vertex set \(V=\{0,1\}\) and edge set \(E=\{01\}\). The single edge joins the strings that differ in the only coordinate.
At vertex \(0\), changing coordinate 1 gives \(1\), so its neighbor set is \(N(0)=\{1\}\) and \(\deg(0)=1\). At vertex \(1\), changing coordinate 1 gives \(0\), so \(N(1)=\{0\}\) and \(\deg(1)=1\). Each degree equals the dimension \(1\).
Check: The edge set contains one edge, and the endpoint degrees sum to \(1+1=2\). Counting the two incidences of the one edge also gives \(2\).
Parity Gives a Bipartition
The weight of a binary string is the number of its coordinates equal to 1. The parity of its weight is even or odd according to whether that number is even or odd. Define \(X\) to be the set of even-weight strings and \(Y\) the set of odd-weight strings.
Proof. Every binary string has either even weight or odd weight, but not both, so \(X\) and \(Y\) are disjoint and together contain every vertex. Consider any edge \(xy\). By the definition of \(Q_n\), its endpoints differ in exactly one coordinate. If that coordinate changes from 0 to 1, the weight increases by 1; if it changes from 1 to 0, the weight decreases by 1. In either case, the weight changes by an odd number, so its parity switches. Thus one endpoint has even weight and the other has odd weight. Every edge therefore crosses between \(X\) and \(Y\), as required. For \(Q_0\), the sole string has weight 0, so \(X\) contains that vertex and \(Y\) is empty; there are no edges that could violate the condition. \(\square\)
A bipartition is allowed to have an empty part. This point handles \(Q_0\): it has one vertex but no edges, and the condition that every edge crosses the parts is satisfied because there are no edges.
Proof. Suppose \(n\geq 1\). Map each string to the string obtained by changing its first coordinate and leaving its other coordinates fixed. Applying this map twice returns the original string, so it is a bijection. Changing one coordinate switches parity, so this bijection pairs every even-weight string with exactly one odd-weight string. Hence \(|X|=|Y|\). There are \(2^n\) binary strings, since each of the \(n\) coordinates has two independent choices. Therefore \(|X|+|Y|=2^n\), and equality of the two sizes gives \(|X|=|Y|=2^{n-1}\). When \(n=0\), the only string is empty and has weight 0, giving the stated sizes. \(\square\)
Worked Checks on Small Cubes
Worked Example: The Two-Dimensional Cube
Let \(Q_2\) have vertex set \(V=\{00,01,10,11\}\) and edge set \(E=\{00\text{-}01,00\text{-}10,01\text{-}11,10\text{-}11\}\). Each listed edge joins strings that differ in one coordinate, and these are all such pairs.
At \(00\), changing the first coordinate gives \(10\), and changing the second gives \(01\). Thus \(\deg(00)=2\). At \(01\), the two changes give \(11\) and \(00\), so \(\deg(01)=2\). At \(10\), they give \(00\) and \(11\), so \(\deg(10)=2\). At \(11\), they give \(01\) and \(10\), so \(\deg(11)=2\). Every degree is \(2\), the dimension.
The weights are \(0,1,1,2\), respectively. Hence \(X=\{00,11\}\) and \(Y=\{01,10\}\). The edges \(00\text{-}01\) and \(00\text{-}10\) each go from \(X\) to \(Y\); the edges \(01\text{-}11\) and \(10\text{-}11\) do so as well.
Check: The listed edge set has four edges. Counting by coordinates gives two edges that change coordinate 1 (\(00\text{-}10\) and \(01\text{-}11\)) and two that change coordinate 2 (\(00\text{-}01\) and \(10\text{-}11\)), for \(2+2=4\) edges. The degree sum is \(2+2+2+2=8\), which counts the four edges twice.
Worked Example: The Three-Dimensional Cube
Let \(Q_3\) have vertex set \(V=\{000,001,010,011,100,101,110,111\}\) and edge set \(E=\{000\text{-}001,000\text{-}010,000\text{-}100,001\text{-}011,001\text{-}101,010\text{-}011,010\text{-}110,011\text{-}111,100\text{-}101,100\text{-}110,101\text{-}111,110\text{-}111\}\). Each edge changes exactly one coordinate. To verify that the list is complete, group it by the coordinate changed:
- Changing coordinate 1 gives \(000\text{-}100\), \(001\text{-}101\), \(010\text{-}110\), and \(011\text{-}111\).
- Changing coordinate 2 gives \(000\text{-}010\), \(001\text{-}011\), \(100\text{-}110\), and \(101\text{-}111\).
- Changing coordinate 3 gives \(000\text{-}001\), \(010\text{-}011\), \(100\text{-}101\), and \(110\text{-}111\).
At each of the eight vertices, changing coordinates 1, 2, and 3 gives three distinct neighbors. For instance, from \(000\) the neighbors are \(100,010,001\); from \(111\) they are \(011,101,110\). The same coordinate-change rule applies to each listed string, so every degree is \(3\).
The even-weight strings are \(X=\{000,011,101,110\}\), with weights \(0,2,2,2\). The odd-weight strings are \(Y=\{001,010,100,111\}\), with weights \(1,1,1,3\). Each of the twelve edges listed joins one of these sets to the other, as changing its differing coordinate switches parity.
Check: The edge list has four edges for each of three coordinates, giving \(4+4+4=12\) edges. The degree sum is \(8\cdot3=24\), and counting each of the 12 listed edges at its two endpoints also gives \(2\cdot12=24\).
A General Edge Count and a Common Mistake
The proofs also give a useful count. For \(n\geq 1\), fix a coordinate \(i\). Each assignment of values to the other \(n-1\) coordinates determines exactly one edge that changes coordinate \(i\): its two endpoints have those fixed values and have 0 and 1, respectively, in coordinate \(i\). There are \(2^{n-1}\) assignments, so there are \(2^{n-1}\) edges changing coordinate \(i\). Edges changing different coordinates are distinct, because an edge in \(Q_n\) differs in exactly one coordinate. Every edge changes one coordinate. Consequently, the total number of edges is \(n2^{n-1}\). This count is obtained directly from the definition; it agrees with counting the \(n\) incident edges at each of the \(2^n\) vertices and dividing by two, since each edge has two endpoints.
Common mistake: confusing dimension and number of vertices. A tempting but incorrect calculation is to say that \(Q_3\) has eight vertices, so every vertex has degree \(8\). This counts all vertices, including the vertex itself and those not adjacent to the chosen vertex. For \(000\), the only neighbors are \(001,010,100\), so its degree is \(3\), not \(8\). In general, the number of vertices is \(2^n\), while the number of neighbors of a fixed vertex is \(n\), one for each coordinate. In \(Q_3\), the direct edge count is \(3\cdot 2^{3-1}=3\cdot4=12\), not the count that would result from assigning degree 8 to every vertex.
These facts are useful whenever the hypercube is used as a model of states connected by one-bit changes. The degree tells how many single-coordinate moves are available from every state. The parity partition gives a simple structural guarantee: every allowed move goes between opposite parity classes. The proofs depend only on the binary-string definition, so they apply in every dimension, including the zero-dimensional boundary case.
Check Your Understanding
Use the coordinate-change definition and show enough work to justify each answer.
- List the neighbors of \(1010\) in \(Q_4\), and state its degree.
- In \(Q_3\), identify the parity class containing \(110\) and explain why each of its neighbors lies in the other class.
- How many vertices are in each parity class of \(Q_5\)? Give the bijection that justifies the equality.
- Use the coordinate count to determine the number of edges in \(Q_4\).
- Explain why the parity partition still defines a bipartition of \(Q_0\), even though one part is empty.