I am a math teacher that likes to invent fun math problems to explore. Here is one I have been investigating for a little while and have made little progress on because the number of possible $n \times n$ "grids" here is always $2^{n^2}$.
I imagine a kid trick-or-treating over a grid of houses on Halloween whose parents tell him he can only keep going so long as one house nearby has their lights on. Each house is either a lit or unlit square on a grid, which can be thought of as $n \times n$ for simplicity's sake, but $n \times m$ explorations are welcome also. The kid can start at any point in the grid, he does not have to begin on the edge. My question(s) are as follows:
Given an $n \times n$ grid, is there a closed form for the number of "walkable" grids? These are grids where the kid can get to every single house, meaning no house with its lights on is surrounded by houses with their lights off.
As $n \to \infty$, does the percentage of lighted grids that are walkable approach a non-zero value? (My gut feeling here is no, but it would be super cool if it did!)
Here is some information I do know:
For $2 \times 2$ grids, every one is walkable. For $3 \times 3$ grids, >50% are walkable, because if the middle house has its lights on, the grid is walkable no matter what.
For $n \times n$ grids where $n \geq 4$, a lower bound on the percentage of walkable grids is given by $\frac{100}{(n-2)^2}$ for similar reasons to $3 \times 3$ grids; if all the "middle" houses are lighted, the grid is automatically walkable.
If this is similar to another problem, please let me know, and if you find out anything cool here, awesome! This is my first post here, so hopefully this will at least spark some curiosity and exploration. I cannot write code very well, but imagine someone could brute force this for small integers for a little bit.
Edit: The kid can walk by the same house multiple times as long as it has its lights on. Only interested in visiting lit houses. "Walkable" if every lit house is within a king move of another lit house. Daniel Mathias had a worthwhile note simplifying the problem in the comments below, quoted, "...you have a grid of cells that are either 0 or 1 and you are asking what percentage of these grids have all of the 1's connected."