In the following $4 \times 4$ board, 4 towers, 4 knights, 4 bishops, and 4 pawns must be placed such that in each row and each column the pieces placed are distinct, as in the example:

| $B$ | $T$ | $P$ | $C$ |
| :--- | :--- | :--- | :--- |
| $P$ | $B$ | $C$ | $T$ |
| $T$ | $C$ | $B$ | $P$ |
| $C$ | $P$ | $T$ | $B$ |

The pawns are rebellious and decided to stay in the following positions:

|  |  | $P$ |  |
| :--- | :--- | :--- | :--- |
| $P$ |  |  |  |
|  |  |  | $P$ |
|  | $P$ |  |  |

Calculate the number of ways in which the other pieces can be placed.
Solution

Three pieces must be placed in the first row, let's call them $\alpha$, $\beta$, and $\theta$ as in the following figure:

![](https://cdn.mathpix.com/cropped/2024_05_01_d02c2755ad3373bde08ag-30.jpg?height=330&width=315&top_left_y=702&top_left_x=752)

In the cell $(b, 2)$, a piece different from $\beta$ must be placed. Suppose first that in $(b, 2)$ we place the piece $\alpha$. It is immediate that in the cell $(c, 2)$ we must place a piece $\theta$.

|  | 1 | 2 |  | 4 |
| :---: | :---: | :---: | :---: | :---: |
|  | $\alpha$ | $\beta$ | $P$ | $\theta$ |
|  | $P$ | $\alpha$ |  |  |
|  |  | $\theta$ |  | $P$ |
|  |  | $P$ |  |  |

Observe that in the cell $(b, 4)$, a piece $\alpha$ cannot be placed, because there is already a piece $\alpha$ in row $b$, nor a piece $\theta$, because there is already a piece $\theta$ in column 4. This implies that in $(b, 4)$ a piece $\beta$ must be placed, and consequently, in $(b, 3)$ and $(d, 4)$, a piece $\theta$ and a piece $\alpha$ must be placed, respectively.

|  | $\alpha$ | $\beta$ | $P$ | $\theta$ |
| :---: | :---: | :---: | :---: | :---: |
| ${ }_{b}$ | $P$ | $\alpha$ | $\theta$ | $\beta$ |
|  |  | $\theta$ |  | $P$ |
|  |  | $P$ |  |  |

The piece in $(d, 3)$ must be different from $\theta$ and $\alpha$, because there is already a piece $\theta$ in column 3 and a piece $\alpha$ in row $d$. Therefore, in $(d, 3)$ we must place a piece $\beta$.

|  |  |  |  |  |
| :---: | :---: | :---: | :---: | :---: |
|  | $\alpha$ | $\beta$ | $P$ | $\theta$ |
|  | $P$ | $\alpha$ | $\theta$ | $\beta$ |
|  |  | $\theta$ |  | $P$ |
|  |  | $P$ | $\beta$ |  |

Now it is clear that there is only one way to complete the board. We conclude that there is only one way to complete the board if we place a piece $\alpha$ in position $(b, 2)$.

|  |  |  |  |  |
| :---: | :---: | :---: | :---: | :---: |
|  | $\alpha$ | $\beta$ | $I$ | $\theta$ |
|  | $P$ | $\alpha$ |  | $\beta$ |
|  | $\beta$ | $\theta$ |  | $P$ |
|  | $\theta$ | $P$ | $\beta$ |  |

Now suppose that in $(b, 2)$ we place a piece $\theta$. In this case, in $(c, 2)$ we must place a piece $\alpha$.

|  | 1 |  |  |  |
| :---: | :---: | :---: | :---: | :---: |
|  | $\alpha$ | $\beta$ | $P$ | $\theta$ |
|  | $P$ | $\theta$ |  |  |
|  |  | $\alpha$ |  | $P$ |
|  |  | $P$ |  |  |

For the positions $(b, 3)$ and $(b, 4)$, we must use the pieces $\alpha$ and $\beta$. Thus, we have two alternatives. Suppose first that in $(b, 3)$ we place a piece $\alpha$ and in $(b, 4)$ we place a piece $\beta$. Consequently, in $(d, 4)$ a piece $\alpha$ must be placed.

|  | 1 |  |  |  |
| :---: | :---: | :---: | :---: | :---: |
|  | $\alpha$ | $\beta$ | $P$ | $\theta$ |
|  | $P$ | $\theta$ | $\alpha$ | $\beta$ |
|  |  | $\alpha$ |  | $P$ |
|  |  | $P$ |  |  |

Finally, we have two ways to complete the board.

|  |  |  |  |  |
| :---: | :---: | :---: | :---: | :---: |
|  | $c$ | $\beta$ | $F$ | $\theta$ |
|  | $P$ | $\theta$ | $\alpha$ | $\beta$ |
|  | $\beta$ | $\alpha$ |  | $P$ |
|  | $\theta$ | $P$ | $\beta$ |  |


|  |  |  |  |  |
| :---: | :---: | :---: | :---: | :---: |
|  | $c$ | $\beta$ | $P$ |  |
|  | $P$ | $\theta$ | $\alpha$ | $P$ |
|  | $\theta$ | $\alpha$ | $\beta$ | $P$ |
|  | $\beta$ | $P$ | $\theta$ |  |

Now suppose that in $(b, 3)$ we place a piece $\beta$ and in $(b, 4)$ we place a piece $\alpha$. Immediately we see that in $(d, 4)$ a piece $\beta$ must be placed.

|  |  | 2 |  |  |
| :---: | :---: | :---: | :---: | :---: |
|  | $\alpha$ | $\beta$ | $P$ | $\theta$ |
|  | $P$ | $\theta$ | $\beta$ | $\alpha$ |
|  |  | $\alpha$ |  | $P$ |
|  |  | $P$ |  | $\beta$ |

In the cell $(d, 1)$, a piece $\alpha$ or a piece $\beta$ cannot be placed because there is already a piece $\alpha$ in column 1 and a piece $\beta$ in row $d$. Therefore, we must place a piece $\theta$ in $(d, 1)$, and thus there is only one way to complete the board.

| 1 | 2 |  | 3 |  |
| :--- | :---: | :---: | :---: | :---: |
| $a$ | $\alpha$ | $\beta$ | $P$ | $\theta$ |
| $b$ | $P$ | $\theta$ | $\beta$ | $\alpha$ |
|  |  |  |  |  |
| $c$ | $\beta$ | $\alpha$ | $\theta$ | $P$ |
|  | $\theta$ | $P$ | $\alpha$ | $\beta$ |
|  | $\theta$ |  |  |  |

Thus, we have obtained, in total, 4 ways to place the pieces on the board so that the pieces $\alpha, \beta$, and $\theta$ are the pieces placed in the first row. Finally, $\alpha$ is one of the 3 pieces, $\beta$ is one of the other 2 pieces, and $\theta$ is the remaining piece. Thus, we have $3 \times 2$ possibilities for the trio $(\alpha, \beta, \theta)$. The answer is therefore

$$
4 \times 3 \times 2=24
$$

ways to place the pieces on the board.