Problem regarding filling squares inside a $n\times n$ grid.

1k Views Asked by At

Assuming a $n\times n$ square grid, what is the most number of squares that can be filled in such that there are no completed rows, columns, or diagonals?

Is there a formula to calculate this?

Real world example:

Given a Bingo sheet, what is the most spots you can mark and still not win a bingo?

It stands to reason that since $N$ is finite, there much reach a point where it is impossible to fill any additional positions such that you would not complete a row, column or diagonal.

Problem is, how do we calculate or predict this number?

2

There are 2 best solutions below

6
On BEST ANSWER

Hint:

Flip the problem around: what's the smallest number of empty squares you need to have an empty square in every row, column, and diagonal? Can you find a simple, symmetric configuration to do it with $n$ of them when $n$ is odd? Is it possible to use fewer?

What if $n$ is even? If $n$ is even and greater than $2$, how can you modify a simple odd solution to give an even one?

Expansion:

Consider the case where you want all the little diagonals too. Certainly it's sufficient to blank out the top row and both left and right columns for $3n-2$ blanks. Is this optimal? For $3\times 3$, it certainly is. For larger boards, it's not clear to me. Things are again different if the board is pasted over a torus. I'm sure these questions have all been studied, but I don't know the answers.

0
On

$n(n-1)$ is the answer.Think of a Latin square with even diagonals having all distinct numbers. How does any random number come in that. it comes in a way that there are no complete row, column and diagonals. The empty squares that do not have one in them, can never in any way align to give a complete diagonal, row or column. Hence $n(n-1)$ is the maximum number of squares and $n! - 2$ are the number of ways in which these squares can be selected from a square grid. If any more squares are selected from this grid then there will obviously be a complete diagonal, row or column or both.