Mathwords logoMathwords

Hypercube — Definition, Formula & Examples

A hypercube is the generalization of a square and a cube to any number of dimensions. Just as a cube is a 3D version of a square, a hypercube (often called a tesseract in 4D) extends the same pattern into four or more dimensions.

An nn-dimensional hypercube (or nn-cube) is the set of all points (x1,x2,,xn)(x_1, x_2, \ldots, x_n) in Rn\mathbb{R}^n satisfying 0xi10 \le x_i \le 1 for each ii. It has 2n2^n vertices, n2n1n \cdot 2^{n-1} edges, and its kk-dimensional faces number (nk)2nk\binom{n}{k} \cdot 2^{n-k}.

Key Formula

V=2n,E=n2n1V = 2^n, \quad E = n \cdot 2^{n-1}
Where:
  • nn = Number of dimensions of the hypercube
  • VV = Number of vertices
  • EE = Number of edges

How It Works

Start with a point (0D). Move it along a new perpendicular axis to sweep out a line segment (1D). Slide that segment perpendicular to itself to form a square (2D). Push the square perpendicular to its plane to create a cube (3D). Repeating this process one more time produces a 4D hypercube, or tesseract. Each time you add a dimension, every existing vertex spawns a new edge along the new axis, doubling the vertex count.

Worked Example

Problem: Find the number of vertices, edges, and square faces of a 4-dimensional hypercube (tesseract).
Vertices: Apply the vertex formula with n = 4.
V=24=16V = 2^4 = 16
Edges: Apply the edge formula with n = 4.
E=4241=48=32E = 4 \cdot 2^{4-1} = 4 \cdot 8 = 32
Square faces (2D faces): Use the general face formula with k = 2.
F2=(42)242=64=24F_2 = \binom{4}{2} \cdot 2^{4-2} = 6 \cdot 4 = 24
Answer: A tesseract has 16 vertices, 32 edges, and 24 square faces.

Why It Matters

Hypercubes appear in computer science as the structure of binary strings (each vertex of an nn-cube corresponds to an nn-bit binary number). They also arise in data science and linear programming, where feasible regions in nn variables often form hypercube-like shapes.

Common Mistakes

Mistake: Assuming a hypercube is only the 4D case (tesseract).
Correction: "Hypercube" refers to any nn-dimensional cube. A line segment is a 1-cube, a square is a 2-cube, an ordinary cube is a 3-cube, and a tesseract is a 4-cube.