Count the number of small cubes that are cut by having a regular hexagonal cross-section of a large cube.

combinatoricsdiscrete geometrydiscrete mathematicsgeometry

I'm having trouble with the following question:

A large cube is made up of 15625 small cubes. If the large cube is cut by as a plane so that the cross-section is a regular hexagon, how many small cubes are cut?

I also looked it up on google but nothing came up. I don't know if my approach is correct or not, but I thought I could find the number of un-cut small cubes in the question if I could find the pattern to the number of un-cut small cubes in cubes made up of 8, 27, 64 (and so on) small cubes. So I drew cubes like such and tried to count the unaffected small cubes, but it was really difficult when it got to a cube made up of 27 small cubes.

Sorry for my wording as English is not my native language. Could anyone give me a hint to solve this? Thanks!

Hexagonal cross-section of a cube

Best Answer

Let's define some coordinates first. Say the cube is $[0, n]^3$ (so vertices at $\{(x, y, z) \in \mathbb R^3 : x, y, z \in \{0, n\}\}$), where $n \in \mathbb N$ is the number of subdivisions you want (in your case $25$, since $25^3 = 15625$). The smaller cubes have their vertices on integer lattice points whose coordinates are between $0$ and $n$. Specifically, for each lattice point $(a, b, c)$ with $a, b, c \in \{0, \dotsc, n-1\}$ there is a small cube $$ [a, a+1] \times [b, b+1] \times [c, c+1] \,. $$ We'll call $(a, b, c)$ the "low corner" of this cube, and $(a+1, b+1, c+1)$ the "high corner".

In order to find a cross section of the large cube which is a regular hexagon, we take the intersection with the plane $x + y + z = 1.5n$. This plane divides the cube in half, intersecting the cube's "frame" at the midpoints of six edges. I believe this is the type of cross section you had in mind.

In order to count how many small cubes are cut, we just need to count how many small cubes have their "low corner" $(a, b, c)$ and "high corner" $(a+1, b+1, c+1)$ on opposite sides of this plane. This occurs when $$ a + b + c \leq 1.5n \leq (a+1) + (b+1) + (c+1) \,,$$ or equivalently $$ a + b + c \in [1.5n-3, 1.5n] \,. $$ Since $a+b+c$ is an integer, all we need to do is count the number of lattice points $(a, b, c)$ with $a, b, c \in \{0, \dotsc, n-1\}$ such that $$ a + b + c \in \{\lceil1.5n\rceil-3, \dotsc, \lfloor1.5n\rfloor\} \,. $$ This means the number of small cubes cut is $$ C(n) = \sum_{s=\lceil1.5n\rceil-3}^{\lfloor1.5n\rfloor} S_3(s; n) \,, \tag{$*$} $$ where $S_3(s; n)$ is defined as the number of ways to sum $3$ nonnegative integers less than $n$ to get $s$. (Define $S_k(s; n)$ similarly for other $k$.)


This $S_k(s; n)$ might have some well-known name, but I am not aware of it. Either way, we can derive it by applying the approach from this answer. First of all, the total number of ways of summing $k$ nonnegative integers to get $s$ is $$ S_k(s) = \begin{cases} \binom{s+k-1}{k-1} &:\, s \geq 0 \\ 0 &:\, \text{otherwise} \end{cases} \,. $$ Among these, the number of ways where the first number is $\geq n$ is $$ S_k(s-n) \,, $$ and likewise for the number of ways where the second number is $\geq n$, etc. The number of ways where the first two (or indeed, any particular two) numbers are $\geq n$ is $$ S_k(s-2n) \,. $$ In general, if we require $j$ of the numbers to be $\geq n$, the number of ways of summing to get $s$ is $$ S_k(s-jn) \,. $$ Using Inclusion-Exclusion, the total number of ways of summing to get $s$ where at least one of the summands is $\geq n$, is $$ \sum_{j=1}^k (-1)^{j-1} \binom{k}{j} S_k(s-jn) \,, $$ and thus \begin{align*} S_k(s; n) &= S_k(s) - \sum_{j=1}^k (-1)^{j-1} \binom{k}{j} S_k(s-jn) \\ &= \sum_{j=0}^k (-1)^j \binom{k}{j} S_k(s-jn) \,. \end{align*}


Now, let's apply this result back to $(\ast)$. We wanted to compute $S_3(s; n)$, but only cared about cases where $s \leq \lfloor1.5n\rfloor < 2n$. Assuming $s < 2n$, the formula for $S_3(s; n)$ simplifies to $$ S_3(s) - 3 S_3(s-n) \,, $$ so the final answer for the number of small cubes cut is \begin{align*} C(n) &= \sum_{s=\lceil1.5n\rceil-3}^{\lfloor1.5n\rfloor} \big(S_3(s) - 3 S_3(s-n)\big) \\ &= \sum_{s=\lceil1.5n\rceil-3}^{\lfloor1.5n\rfloor} S_3(s) - 3 \sum_{s=\lceil0.5n\rceil-3}^{\lfloor0.5n\rfloor} S_3(s) \\ &= \sum_{s=\max(0, \lceil1.5n\rceil-3)}^{\lfloor1.5n\rfloor} \binom{s+2}{2} - 3 \sum_{s=\max(0, \lceil0.5n\rceil-3)}^{\lfloor0.5n\rfloor} \binom{s+2}{2} \\ &= \frac12 \sum_{s=\max(2, \lceil1.5n\rceil-1)}^{\lfloor1.5n\rfloor+2} s(s-1) - \frac32 \sum_{s=\max(2, \lceil0.5n\rceil-1)}^{\lfloor0.5n\rfloor+2} s(s-1) \,. \end{align*}

Edit (from comments): if $n$ is odd and $\geq 5$, we can instead simplify the expression to \begin{align*} C(n) &= \sum_{s=(3n-5)/2}^{(3n-1)/2} S_3(s) - 3 \sum_{s=(n-5)/2}^{(n-1)/2} S_3(s) \\ &= \sum_{s=(3n-1)/2}^{(3n+3)/2} \frac{s(s-1)}{2} - 3 \sum_{s=(n-1)/2}^{(n+3)/2} \frac{s(s-1)}{2} \\ &= \frac{(3n-1)(3n-3) + (3n+1)(3n-1) + (3n+3)(3n+1)}{8} \\ &\quad - 3\cdot \frac{(n-1)(n-3) + (n+1)(n-1) + (n+3)(n+1)}{8} \\ &= \frac{27n^2+5}{8} - \frac{9n^2+15}{8} \\ &= \frac{9n^2-5}{4} \,. \end{align*} In fact, this expression also holds for $n=1$ and $n=3$ (see below).


In the original problem, $n$ was $25$. Plugging this in, we get an answer of $$ C(25) = (9\cdot25^2 - 5)/4 = \boxed{1405} \,. $$ As a sanity check, let's also compute $C(1)$, $C(2)$, and $C(3)$: \begin{align*} C(1) &= \frac12 \sum_{s=2}^3 s(s-1) - \frac32 \sum_{s=2}^2 s(s-1) = 1 \,, \\ C(2) &= \frac12 \sum_{s=2}^5 s(s-1) - \frac32 \sum_{s=2}^3 s(s-1) = 8 \,, \\ C(3) &= \frac12 \sum_{s=4}^6 s(s-1) - \frac32 \sum_{s=2}^3 s(s-1) = 19 \,. \end{align*} These numbers match what I calculated by hand.

Related Question