CS 70 Discrete Mathematics for CS

Fall 2004  Rao  Lecture 11

Hypercubes

Recall that the set of all n-bit strings is denoted by {0,1}^{n}. The n-dimensional hypercube is a graph whose vertex set is {0,1}^{n} (i.e. there are exactly 2^{n} vertices, each labeled with a distinct n-bit string), and with an edge between vertices x and y iff x and y differ in exactly one bit position. i.e. if x = x_{1}x_{2}...x_{n} and y = y_{1}y_{2}...y_{n}, then there is an edge between x and y iff there is an i such that ∀j ≠ i,x_{j} = y_{j} and x_{i} ≠ y_{i}.

There is another equivalent recursive definition of the hypercube:

The n-dimensional hypercube consists of two copies of the n−1-dimensional hypercube (the 0-subcube and the 1-subcube), and with edges between corresponding vertices in the two subcubes. i.e. there is an edge between vertex x in the 0-subcube (also denoted as vertex 0x) and vertex x in the 1-subcube.

Claim: The total number of edges in an n-dimensional hypercube is n2^{n−1} .

Proof: Each vertex has n edges incident to it, since there are exactly n bit positions that can be toggled to get an edge. Since each edge is counted twice, once from each endpoint, this yields a grand total of n2^{n}/2.

Alternative Proof: By the second definition, it follows that E(n) = 2E(n − 1) + 2^{n}, and E(1) = 1. A straightforward induction shows that E(n) = n2^{n−1} .

We will prove that the n-dimensional hypercube is a very robust graph in the following sense: consider how many edges must be cut to separate a subset S of vertices from the remaining vertices V − S. Assume that S is the smaller piece; i.e. |S| ≤ |V − S|.

Theorem: |E_{S,V −S}| ≥ |S|.

Proof: By induction on n. Base case n = 1 is trivial.

For the induction step, let S_{0} be the vertices from the 0-subcube in S, and S_{1} be the vertices in S from the 1-subcube.

Case 1: If |S_{0}| ≤ 2^{n−1} /2 and |S_{1}| ≤ 2^{n−1} /2 then applying the induction hypothesis to each of the subcubes shows that the number of edges between S and V −S even without taking into consideration edges that cross between the 0-subcube and the 1-subcube, already exceed |S_{0}| + |S_{1}| = |S|.

Case 2: Suppose |S_{0}| > 2^{n−1} /2. Then |S_{1}| ≤ 2^{n−1} /2. But now |E_{S,V −S}| ≥ 2^{n}− 1 ≥ |S|. This is because by the induction hypothesis, the number of edges in E_{S,V −S} within the 0-subcube is at least 2^{n−1} − |S_{0}|, and those within the 1-subcube is at least |S_{1}|. But now there must be at least |S_{0}| − |S_{1} edges in E_{S,V −S} that cross between the two subcubes (since there are edges betwen every pair of corresponding vertices. This is a grand total of 2^{n−1} − |S_{0}| + |S_{1}| + |S_{0}| − |S_{1}| = 2^{n−1} .

CS 70, Fall 2004, Lecture 11 1