2022 AMC 10B Problem 19
Each square in a grid is either filled or empty, and has up to eight adjacent neighboring squares, where neighboring squares share either a side or a corner. The grid is transformed by the following rules:
- Any filled square with two or three filled neighbors remains filled.
- Any empty square with exactly three filled neighbors becomes a filled square.
- All other squares remain empty or become empty.
A sample transformation is shown in the figure below.
Suppose the grid has a border of empty squares surrounding a subgrid. How many initial configurations will lead to a transformed grid consisting of a single filled square in the center after a single transformation? (Rotations and reflections of the same configuration are considered different.) 
Show solution without answering
Key insight
Only the center's eight neighbours matter, and only two or three of them can be filled. Then check, cell by cell, that nothing else ends up with the wrong count.
Solution
Label the inner like this, with the center:
Call the corners and the edge cells. Every one of these eight touches . Besides :
- a corner touches only its two edge cells (for example, touches and );
- an edge cell touches every other edge cell except the opposite one, plus the two corners beside it (for example, touches , , , ).
What must happen. Afterwards is filled and every other cell is empty. So:
- if starts filled, it needs or filled neighbours; if it starts empty, exactly ;
- a filled cell other than must not have or filled neighbours;
- an empty cell must not have exactly filled neighbours;
- a border cell can see at most three inner cells, and all three only if an entire side of the is filled, so no full side is allowed.
Case 1: starts filled, with or filled outer cells.
- Every filled outer cell already sees . If it touched even one other filled outer cell it would have or more filled neighbours and survive. So no two filled outer cells may touch.
- An empty outer cell that touches two filled outer cells would also see , making , and would fill up. So no empty cell may touch two of them.
- Two filled. Two corners on the same side (like , ) both touch : fails. A corner and an edge cell that do not touch also fail: and both touch , and and both touch . Opposite edge cells (like , ) both touch : fails. Opposite corners ( and , or and ) share no neighbour: this works. That gives .
- Three filled, none touching. The only such groups are three corners, or an edge cell with the two corners on the far side (like , , ). In both, an edge cell between two of the filled corners ( in the second example) sees two corners plus , which is . Fails. That gives .
Case 2: starts empty, with exactly filled outer cells.
- A filled cell now sees only outer cells, so it must not touch both of the other two. An empty cell must not touch all three. (A full side, like , already breaks the first rule, since touches and .)
- Three corners. No two corners touch, and each edge cell touches only two corners. Works: ways.
- Two corners on the same side plus an edge cell. Take . Adding : touches both, fails. Adding : then is empty and touches , , , fails ( is the same). Adding : touches neither corner, and no empty cell touches all three. Works. There are sides, so ways.
- Two opposite corners plus an edge cell. Take and add . Only and touch each other; the empty cells and each see just . Works, and the same holds for any of the edge cells. With pairs of opposite corners: ways.
- One corner plus two edge cells. Take . Opposite edge cells fail (: then touches , , ; and : then touches all three). Any pair that includes or also touches and the other edge cell, so that cell touches both others: fails. The only pair left is , which touch each other but not . Check the empty cells: sees ; sees ; sees . All or fewer. Works: way per corner, ways.
- Three edge cells. Two of them are opposite, and the third touches both. Fails: ways.
Total. .
The answer is .
Why this works
The rules only let a cell be filled afterwards if it has two or three filled neighbours, so "only the center is filled afterwards" limits the start to very few filled cells. After that it is careful bookkeeping of which cells touch which. Sorting by how many corners are used, and using the symmetry of the square (count one corner, then multiply by ), keeps each case short.
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
The center's neighbors are the "outer" cells of the (four corners, four edge-midpoints). For the center to end filled, either the center is filled with or filled outer cells, or it is empty with exactly .
Everything else must end empty. A border cell can only reach filled neighbors if a whole side of the is filled, so no side may be full. A filled outer cell must not have or filled neighbors; an empty one must not have exactly . Adjacency on the ring: each corner touches its two neighboring edge cells; each edge cell touches every other edge cell except the opposite one.
Center filled. Each filled outer cell already sees the center, so it may touch no other filled cell. Three pairwise non-adjacent outer cells always leave some empty cell seeing exactly (e.g. the edge between two of three corners): . Two non-adjacent cells with no empty cell touching both: only two diagonally opposite corners, .
Center empty, 3 filled outer cells. No filled cell may touch both others, no empty cell may touch all three, no full side.
- Three corners: always fine, .
- Two same-side corners plus an edge: only the opposite edge works, .
- Two diagonal corners plus an edge: any edge works, .
- One corner plus two edges: opposite edges fail (the empty edge beside the corner sees all three); two adjacent edges plus the corner touching neither, .
- Three edges: two are opposite and the third touches both, .
Total .
The answer is .
Review in the AoPS books
- Introduction to Counting & Probability, Chapter 5: More With Combinations (§5.2)
- Intermediate Counting & Probability, Chapter 13: Events With States (§13.4)
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.2)
- Prealgebra, Chapter 15: Problem-Solving Strategies (§15.2)
Similar problems
Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.