While writing my answer to Why does “Watchmen” use the 9-panel grid? I used this picture to indicate the many ways it can be divided into groups (which may be used for the panels of a comic, as was the case in “Watchmen”):
Afterwards, it has been pointed out to me in a comment that there are some combinations that are not present in this picture:
The $81$ variations on the $9$ panel grid in that diagram don't exhaust the possibilities -- there are certainly many others. For example, this one is one of the many that aren't shown there.
Another comment says that the 9-panel grid can be used in $4096$ different ways:
The are $12$ interior borders, each of which can be included or excluded in a particular layout. That's $2^{12} = 4096$ possibilities.
A two-page spread treats two $3 \times 3$ grids as a single $6 \times 3$ grid with $21$ internal borders, for $2,097,152$ possibilities.
How can I calculate that? I tried the following:
- There a $3$ ways to group the third row.
- That leaves us with $4$ panels in 2nd and 3rd rows. I count $4$ ways to group those.
- The $12$ combinations so far must be multiplied by $4$ (because I can rotate them) and by $2$ (because I can mirror them).
This gives me $96$ variations. The picture above has $81$; the comment said there are $4096$.
Is there a layman-friendly geometrical solution? I'm not really interested in a precise value (a lot is enough for me), I'm more interested in the technique or a rule. Is there a general rule for a n-by-n grid?
To clarify: panels must be rectangular, i.e. they must be formed by merging some of the $9$ panels horizontally or vertically:





Unfortunately these kinds of geometrical questions rarely have a neat satisfying answer, like a formula for any sized grid. This is because a "divide and conquer" strategy does not work - as soon as you cut the grid into two smaller grids to be analysed separately, you miss out on all the patterns that have panels crossing your cutting line, and those are not easy to classify or count.
I've tried to count all the patterns by hand, so it is likely I've made mistakes. The table below lists the patterns I found. The left column lists the large panels (the 1x1 are not listed). The right column lists the number of possible arrangements of those panels. The multiplication in brackets is for all the rotations/reflections of that patterns (so an asymmetrical one is multiplied by 8).
[After comparing to David K's answer, I fixed 4 mistakes and my final count it now matches his.]
If my list is correct, and I counted it up correctly, that gives 322 different patterns. If you consider rotated or reflected patterns identical (i.e. leave out all the multiplications in brackets), then there are 54.
Some examples of the patterns missing from the picture in the question are:
Addendum
After thinking a bit more about David K's method, I figured out a way to calculate the number of panel patterns in a 3xn grid.
Consider two vertically adjacent vertices. There are two horizontal border segments on the left, two horizontal border segments on the right, and three vertical border segments down the middle. For the two segments on the left there are four possibilities of whether they are present or erased, and similarly on the right. For each of those 4*4=16 combinations we can count how many possibilities there are for the vertical segments.
This is shown in the following picture, where each dark grey vertical segment has two possibilities:
This gives a transition matrix, that tells us how many ways there are to connect up the inputs on the left to the outputs on the right.
$$\begin{pmatrix} 8 & 2 & 2 & 1 \\ 2 & 4 & 1 & 1 \\ 2 & 1 & 4 & 1 \\ 1 & 1 & 1 & 2 \end{pmatrix}$$
Adding up all the entries in the matrix gives 34, which is the number of ways a 3x2 grid can be divided into rectangles.
For a 3x3 grid we apply two transitions, by squaring the matrix.
$$\begin{pmatrix} 8 & 2 & 2 & 1 \\ 2 & 4 & 1 & 1 \\ 2 & 1 & 4 & 1 \\ 1 & 1 & 1 & 2 \end{pmatrix}^2 = \begin{pmatrix} 73 & 27 & 27 & 14 \\ 27 & 22 & 13 & 9 \\ 27 & 13 & 22 & 9 \\ 14 & 9 & 9 & 7 \end{pmatrix}$$
Adding up all the entries, we get the answer for a 3x3 grid:
$$\begin{pmatrix} 1 & 1 & 1 & 1 \end{pmatrix} \begin{pmatrix} 73 & 27 & 27 & 14 \\ 27 & 22 & 13 & 9 \\ 27 & 13 & 22 & 9 \\ 14 & 9 & 9 & 7 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \\ 1 \\ 1 \end{pmatrix} = 322$$
Evaluating the same for the n-th power of the matrix gives the number of ways to subdivide a 3x(n+1) grid:
$$\begin{pmatrix} 1 & 1 & 1 & 1 \end{pmatrix} \begin{pmatrix} 8 & 2 & 2 & 1 \\ 2 & 4 & 1 & 1 \\ 2 & 1 & 4 & 1 \\ 1 & 1 & 1 & 2 \end{pmatrix}^n \begin{pmatrix} 1 \\ 1 \\ 1 \\ 1 \end{pmatrix} = 4, 34, 322, 3164, 31484, 314662, 3149674, 31544384, ...$$
This sequence is found in the OEIS as A208215.
If you were to apply this method to 4xn grids, you'd need a 16x16 matrix, Each further row doubles the matrix size, so it soon gets unwieldy.