2
$\begingroup$

How many ways are there to color cubes a $4\times4\times4$ cube with red that in every $1\times1\times4$ cube there is only one red $1\times1\times1$ cube

My attempt:First I colored the first $4\times4$ layer there are $4!$ ways to do that .Consider that the first layer is like the picture below:

enter image description here

But in the second layer counting becomes too hard and also we have to count the ways of coloring the third and forth layer.I need an easier way for solving this.

  • 0
    This paper might be useful: [Rook Polynomials in Three and Higher Dimensions](http://faculty.gvsu.edu/ALAYONTF/notes/rook_polynomials_higher_dimensions_preprint.pdf)2017-02-23
  • 8
    What is a $1*1*4$ cube??2017-02-23
  • 0
    Do you want to know just one way to do it, or how many ways there are? If one way is enough, start with the first layer you've drawn. Then in the second layer, color the three cubes just above the diagonal red, along with the one in the bottom left. Keep moving one diagonal up for the third and fourth layers.2017-02-25
  • 0
    After looking at the answers given so far, I'm realizing that people seem to have different interpretations of what you're asking. My understanding was that you want to color 16 out of 64 cubes red, including one and only one in each left-right row, each front-back column, and each top-bottom stack. If that's correct, I think Rebecca's answer and https://en.wikipedia.org/wiki/Latin_square#Number should give you what you want.2017-02-25
  • 0
    @RaviFernando Yes they are true but hard for me to understand.2017-02-26
  • 0
    Are you looking for the total number of solutions possible when looking at just one fixed face of the cube? If so, that number is indeed $24*24=576$. Or are you looking for the number of unique cubes where all $576$ solutions can be obtained by summing the solutions found by looking at all faces of the cube, rotated at $90^\circ$ intervals? If so, that number is much smaller.2017-03-01
  • 0
    @Jens rotations doesn't make a new case I think the first one.2017-03-02
  • 0
    Thanks for the clarification. I made an offshoot question based on yours, [here](http://math.stackexchange.com/questions/2169070/number-of-unique-cubes-with-one-red-cube-in-every-114-segment).2017-03-02
  • 0
    If you want to have the number of possibilities, you should say "how many" not "how".2017-03-03

3 Answers 3

0

Consider an internal diagonal of the $4\times 4\times 4$ cube. There are $4$ to choose from. Select one and color all the cubes red. Then every $1\times 1\times 4$ slice in the $4\times 4\times 4$ cube will have exactly one red $1\times 1\times 1$ cube.

  • 0
    This construction puts one red cube in each $1 \times 4 \times 4$ slice, not every $1 \times 1 \times 4$ slice.2017-02-25
  • 0
    Ah. I see. I will think on this further then.2017-02-25
8

My impression is that these are equivalent to $4 \times 4$ Latin squares. We define a Latin square $L=(l_{ij})$ by $l_{ij}=k$ whenever cell $(i,j,k)$ is red.

Clashes with two red cells in a $1 \times 4 \times 1$, $4 \times 1 \times 1$, and $1 \times 1 \times 4$ submatrices will correspond to either two identical symbols in the same row, two identical symbols in the same column, or a cell containing two distinct symbols, respectively.

If you want to enumerate them, this is indeed a difficult problem in general, but for the $4 \times 4$ special case if you exploit a few symmetries, it's not too bad. Specifically, it's substantially easier to count reduced Latin squares $R_n$, i.e., those with the first row and column in natural order, since the number of Latin squares $L_n=n!(n-1)!R_n$.

I.e., $R_n$ is the number of ways of filling in: $$ \begin{bmatrix} 1 & 2 & 3 & 4 \\ 2 & ? & ? & ? \\ 3 & ? & ? & ? \\ 4 & ? & ? & ? \\ \end{bmatrix} $$ using the symbols $\{1,2,3,4\}$ such that no row nor column contains a repeated symbol.


If the restriction is indeed only on $1 \times 1 \times 4$ submatrices, then we can choose one red cell in each $1 \times 1 \times 4$ submatrix (or choose none, if that is permitted), which can be done independently, and thus the possibilities are easy to enumerate.

  • 0
    Nice! But why did you stop just short of giving the answer? Stating that $R_4$=4 would seal the deal.2017-03-02
  • 1
    @RebeccaJStones: Your impression is correct. Very nice solution! (+1)2017-03-09
  • 0
    See https://oeis.org/A002860 for the actual numbers.2017-03-11
6

Here we count all valid configurations and show they sum up to $$6\cdot4!\cdot 4=576$$

In the following we use cell to denote a $1\times1\times1$ cube.

If we project all four layers to the bottom layer, then each of the $4\cdot 4=16$ cells is red colored. So, we have to find all valid configurations of a $4\times 4\times 4$ cube with $16$ red cells.

Bottom layer:

We observe, already stated by OP, there are $$4\cdot 3\cdot 2 \cdot 1=4!$$ valid configurations to place $4$ red cells in the bottom layer. Each row and each column of the cell contains precisely one red cell.

Encoding the layers:

Each layer consists of $4$ rows and $4$ columns. We use a $4$-tupel $(a,b,c,d)$ to encode the positions of the red cells within a layer. The $i$-th coordinate corresponds to the $i$-th row and the entry gives the number of the column with the red cell. The example bottom layer given by OP is therefore encoded as \begin{align*} (1,2,3,4) \end{align*}

For example the third component describes the third row of the bottom layer and the entry of this row is $3$ since the placement of the red cell is in the third column.

Grouping the bottom layers:

We now classify the bottom layers by selecting those with a red cell at the top-left corner. These are the configurations which are encoded as \begin{align*} (1,b,c,d) \end{align*} meaning the cell in the first column of the first row is a red cell. Since $b,c,d$ permute $2,3$ and $4$ there are precisely \begin{align*} 3! \end{align*} configurations of this type. We can now classify the $4!=24$ valid configurations of the bottom layer by taking a layer with $(1,b,c,d)$ as representative of a four element group which is obtained by shift-rotate each red cell in a row by one.

The red cells in the example layer of OP which is encoded by $(1,2,3,4)$ can be shifted by $1$ to the right and we obtain the bottom layer \begin{align*} (1,2,3,4)\quad\longrightarrow(2,3,4,1) \end{align*} We can do this shift operation three times and obtain the four bottom layers

enter image description here

Observation: The operation shift-rotate by one to each of the $6$ bottom layers $(1,b,c,d)$ partitions the $24$ bottom layers by declaring $(1,b,c,d)$ as representative of a four element group and by associating all bottom layers shift-rotated by one to it.

Note: If we consider the left-most layer $(1,2,3,4)$ we denote the columns from left to right with $(c_1,c_2,c_3,c_4)$. A shift-rotate operation moves all columns by one to the right and the right-most column is placed at the first position to the left.

\begin{align*} (c_1,c_2,c_3,c_4)\quad\rightarrow\quad (c_4,c_1,c_2,c_3) \end{align*}

The four layers are obtained by consecutively applying a shift-rotate by one operation. We obtain \begin{align*} (c_1,c_2,c_3,c_4)\quad\rightarrow\quad(c_4,c_1,c_2,c_3)\quad\rightarrow\quad (c_3,c_4,c_1,c_2)\quad\rightarrow\quad(c_2,c_3,c_4,c_1)\\ \end{align*} and as we can see in the picture above the red cells move correspondingly encoded as \begin{align*} (1,2,3,4)\quad\rightarrow\quad(2,3,4,1)\quad\rightarrow\quad (3,4,1,2)\quad\rightarrow\quad(4,1,2,3)\\ \end{align*}

Upper layers:

Note, when looking at the four layers above, there are no two equal numbers in the same row or in the same column. So, this grouping with shift-rotation has the nice effect that the four layers can also be stacked and give a valid configuration with $4$ layers and $16$ red cells.

Note, we can shuffle these four layers and we always obtain a valid configuration. If we denote the four layers with $(L_1,L_2,L_3,L_4)$, we can permute the four layers in $$4!=24$$ different ways \begin{align*} &(L_1,L_2,L_3,L_4)\\ &(L_1,L_2,L_4,L_3)\\ &(L_1,L_3,L_2,L_4)\\ &\quad\quad\ \ \ldots\\ &(L_4,L_3,L_2,L_1)\\ \end{align*} and each of these stacked layers is a valid configuration.

It follows, since there are $6$ representatives $(1,b,c,d)$ of a group of four layers obtained by a shift-rotate by one operation, which can be stacked in $4!$ different ways, we obtain \begin{align*} 6\cdot 4!\tag{1} \end{align*} different valid configurations.

Three more with $(1,2,3,4)$:

Checking for valid, stackable configurations starting with $(1,2,3,4)$ shows there are precisely three more corresponding to the figures below. Each line shows the four layers of a stackable configuration.

enter image description here enter image description here enter image description here

It is not too cumbersome to find these configurations, since in the first row the cells have a fixed position and we simply have to check that there are no to equal cells in the same row or in the same column, which strongly reduces possible configurations.

Due to symmetry we find for each of the six configurations with a red cell at the bottom-left corner such groups of figures, so that we finally conclude:

Conclusion: According to the intermediate result (1) and the four different shift-rotate operations, we obtain $6$ representatives $(1,b,c,d)$ of the $24$ bottom layers. Each representative can be used together with a shift-rotate operation from (3) to build $4!=24$ valid $4\times 4\times 4$ cubes with $16$ red colored cells. Since there are four different shift-rotate operations, we finally obtain \begin{align*} 6\cdot 4!\cdot 4=576 \end{align*} valid configurations.

Note: Counting $A(3)$, all $3\times3\times3$ cubes with $9$ red cells of the wanted type, gives $A(3)=12$ valid configurations. In fact the sequence $A(n)$, starting with $1,2,12,\color{blue}{576}, 161280,\ldots$ is archived as A002860 and counts the number of latin squares of order $n$ in accordance with the answer of @RebeccaJStones.

  • 1
    But the answer is 576.2017-02-27
  • 0
    But we have to choose 16 cubes not 4 cubes.2017-03-08
  • 0
    The pictures are not loaded please load them to clearfy2017-03-12
  • 0
    I mean it seems you wanted to upload some pictures in your answer but they didn't add.I wonder if you try to add them again.2017-03-13
  • 0
    No there is no picture there is only the text "enter image description here"2017-03-13
  • 0
    @TahaAkbari: I've removed the pictures and added them again. Hopefully they are now visible for you. Please check.2017-03-13
  • 0
    Yes ,thank you.2017-03-14
  • 0
    @TahaAkbari: Great! You're welcome! :-)2017-03-14
  • 0
    Could you please explain more the upper layers?2017-03-15
  • 0
    @TahaAkbari: I can do so in the evening after work.but, You should add *concrete* aspects regarding the upper layer which are not clear to you. This way I can provide more appropriate information.2017-03-15
  • 0
    I don't know how you got $4!$ ways to put the remaining cells to the upper layers and how shift-rotate helped us?2017-03-15
  • 0
    @TahaAkbari: I've added some explaining remarks which might be helpful. Regards,2017-03-15