Given a grid we play the following game . Initially we place tokens in each of empty cells and at the end of the game we need to fill the whole grid with tokens.For that purpose we are allowed to make the following move:If an empty cell shares a common side with at least two other cells that contain a token then we can place a token in this cell.Find the minimum value of in terms of that enables us to win the game.
Solution
1. Understanding the Problem:
We need to fill an grid with tokens starting from initial tokens placed in empty cells. The rule for placing a token in an empty cell is that it must share a common side with at least two other cells that contain a token. We need to find the minimum value of in terms of and that allows us to fill the entire grid.
2. Analyzing the Grid:
- Each boundary row and column must contain at least one token.
- Consider the bottom row. There must be at least one token in this row, say .
- If there are no tokens in the two rows above , we cannot fill the grid. Therefore, there must be at least one token in these two rows.
- To minimize the number of tokens, this token should not be in the adjacent row to . If this token is not in the same column as , we cannot fill the grid. Hence, these two tokens must be in the same column.
3. Minimum Tokens in a Column:
- Continuing this logic, there must be at least tokens in this column.
4. Minimum Tokens in a Row:
- Similarly, for columns, there must be at least tokens in some row.
5. Combining Rows and Columns:
- Since a column and a row can coincide in at most one square, we must have at least tokens.
6. Special Cases:
- For and both odd, we can provide an example with tokens. Place one token in the top right corner and start placing tokens in the first row and first column such that each token is placed in a square 2 columns/rows away from the last token placed in that column/row. This configuration works.
7. Even Dimensions:
- If is even, a column has at least tokens, leaving one boundary square without a token. If we do not place an extra token in this square, the column with tokens must go through this boundary square, making it impossible to fill the grid with tokens. Therefore, we need tokens.
The final answer is if one of or is even, and otherwise.