All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Grid Pathways (Posted on 2002-07-22)
(First things first - I don't know a solution to this, but the puzzle occurred to me a few hours ago, and I thought people might be interested in it)

Imagine a rectangular (or square) grid of any size, every square white. If the grid is "x" squares across and "y" squares high, what is the minimum number of squares ("n") that must be shaded so that no white square is adjacent to more than 2 other white squares?
(For this puzzle, diagonally adjacent squares are not considered to be adjacent)

So, for example, if the grid is simply a 3x3 then the only square that needs shading is the centre one, then all others squares only touch two others - i.e. for x=3 y=3, n=1

a) Is there an formula to calculate "n" that will work for all paired-values of "x" and "y"?
b) If not, what is "n" for a chessboard-sized x=8 y=8 (post your suggested minimum using a standard chess-like "A7" type of description for a list of all your shaded squares)?

 See The Solution Submitted by Nick Reed Rating: 3.9167 (12 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 Solution | Comment 28 of 29 |
Cases 1 by x and 2 by 2:
Zero black squares
- Every square borders at most two squares so the conditions of the problem are already met.

Cases 2 by x for x>=3:
floor(n/2) black squares
- Uses the following pattern (X=black squares):
OOOXOOOXOOOXOOOXOOOXOO ....
OXOOOXOOOXOOOXOOOXOOOX ....

Cases 3 by x for x>=3:
x-2 black squares
- The black squares are the x-2 squares NOT along the border.

Cases x by y for x>=4 and y>=4:
if (x-y) mod 3 != 0 then ceil(x*y/3)-1 black squares
if (x-y) mod 3 = 0 then ceil(x*y/3)-2 black squares
- See this comment.
 Posted by Brian Smith on 2003-12-02 12:03:59

 Search: Search body:
Forums (0)