In how many ways can cells of a grid be painted black such that no two black cells share a corner or an edge with each other?
Problem 1595
Official solution
1. Divide the Grid: Divide the grid into nine square grids. Each square can have at most one black cell to ensure no two black cells share a corner or an edge. Therefore, each square must have exactly one black cell.
2. Positioning Black Cells: Describe the position of the black cell in each square as being on the left or right side and on the upper or lower half. Denote these positions as or and or respectively.
3. Row and Column Constraints: The condition that no two black cells share a corner or an edge implies that:
- Two consecutive black cells in a row cannot be .
- Two consecutive black cells in a column cannot be .
4. Possible Configurations: For a row, the only valid configurations are , , , or . Similarly, for a column, the valid configurations are , , , or . Since there are 3 rows and 3 columns, the total number of configurations is:
5. Subtract Invalid Configurations: Not all of these configurations are valid. We need to subtract the cases where one of the corners of the middle square is shared by two black cells. We use the Principle of Inclusion-Exclusion (PIE) to account for these cases.
6. Case Analysis:
- Single Corner Shared: Consider the top-left corner of the middle square being shared. There are two ways this can happen:
1. One black cell in the top-left square shares the corner with a black cell in the center square. The top row must be because the first one is on the right. In the second row, we have . Since the middle square is , the first one must also be . The third one can either be or . In the third row, we can have any of the 4 possibilities, so there are ways to decide the left/right positions. Similarly, there are ways to decide the up/down positions, so there are ways to color the grid.
2. One black cell in the middle-left square shares the corner with a black cell in the middle-top square. Similarly, there are ways to color the grid in this case.
- Total for Single Corner: Since there are 4 corners, the total number of colorings that have a shared corner is:
7. Double Corner Shared: Subtract the number of colorings where two of the corners are shared. We can either have the top-right and bottom-left corners shared or the top-left and bottom-right corners shared. WLOG, consider the top-left and bottom-right corners shared. There are 2 ways to choose which squares have black cells' corners shared and ways to color the rest of the grid. Therefore, there are:
8. Final Calculation: Using PIE, the total number of valid configurations is: