Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $S(m)$ be the number of partitions of an $n \times n$ checkerboard into $m$ subsets such that all the squares in each subset are connected contiguously. So for each $n,$ $m$ goes from $1$ to $n^2.$ For a $2 \times 2$ board, for example, $S(1) = 1,$ $S(2) = 6,$ $S(3) = 4$ and $S(4) = 1.$ The $3 \times 3$ case is proving to be quite an effort in brute force.

How do I approach this problem so that the cases for $n > 2$ are more tractable? Thank you in advance for any guidance you can provide.

By "contiguously" I mean that any pair of squares in a subset must be connected by a sequence of squares in which successive squares share an edge.

share|cite|improve this question
I think he means the number of different such partitions. – Yuval Filmus Jul 25 '12 at 6:12
There's still a problem: by the current definition, $S(2) = 2$ and $S(3) = S(4) = 0$ for $n=2$. The way the subsets are described forces them to have at least 2 squares each. I suspect you just meant to say they're connected. – Erick Wong Jul 25 '12 at 7:16
@Brian: Please clarify the question itself; people shouldn't have to delve into the comments to understand it. As Erick pointed out, in its current form the question unambiguously requires each square to share an edge with another square in the subset; I don't see any room for interpretation that would allow for a one-square subset. You could express what you meant by requiring any pair of squares in a subset to be connected by a sequence of squares in which successive squares share an edge. – joriki Jul 25 '12 at 7:55
The current form not only excludes one-square subsets, it also allows arbitrary disconnected subsets as long as each connected component has at least two squares. This is also apparently not what you had in mind. – joriki Jul 25 '12 at 7:56
@Brian: I'm confused. Now you've edited the question, but apart from the fact that this formulation unnecessarily treats the single-square case separately, more importantly it still allows for disconnected subsets as long as all connected components contain at least two squares. Is that really what you want? – joriki Jul 25 '12 at 8:05
up vote 1 down vote accepted

I think it is hard to do by hand, but it should yield to computer solution. As you are counting rotations and reflections separately, there is almost an easy answer. Start with $S(n^2)=1$ as you need each square to be separate. There are $2n(n-1)$ internal edges, so $S(n^2-1)=2n(n-1)$ because you just pick one edge to glue together. Similarly, $S(n^2-2)= {2n(n-1) \choose 2}=n(n-1)(2n^2-2n+1)$ because you just pick two edges to glue. The problem comes when you can form a square as there are four ways to glue three edges to get the same square and gluing all four edges doesn't decrease the piece count by one. Maybe that will prompt some thought.

For the program, I would again start with all the squares separate. Then glue all possible pairs to make the $n^2-1$ piece dissections. Then glue pairs of those to make the $n^2-2$ piece dissections, but the challenge is finding and eliminating the duplicates. I would encode a board with $n^2$ numbers, the piece number of each square, starting from the upper left. If you have glued each of the top row of a $3 \times 3$ to the square below and glued the right two dominoes, it would look like $122122345$

share|cite|improve this answer
Thank you. That gives me a fresh way of looking at the problem. – Brian Aug 31 '12 at 18:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.