# Rectangles in a chess board

How many rectangles can be made from the individual spaces of a chess board?

• I don't think it's a duplicate of that, because it's asking about rectangles and not just squares. I'll be quite surprised if the rectangle question isn't already on PSE, though. – Gareth McCaughan Feb 13 '19 at 17:50
• OK, I think I'm surprised: I don't see any sign that this question has been asked here before. It's a bit of a maths-homework question, but I guess just about enough not so that I'm not about to close it. – Gareth McCaughan Feb 13 '19 at 17:52
• @GarethMcCaughan, the question was originally about squares, but changed after I flagged it (see the edit). But yes, rectangles are different so I'll retract my flag – eye_am_groot Feb 13 '19 at 17:55
• Ah, OK. Hadn't noticed that the question had changed. – Gareth McCaughan Feb 13 '19 at 17:55
• No problem, just trying to help out – eye_am_groot Feb 13 '19 at 18:15

To specify a rectangle

it suffices to say where its left and right boundaries are, and where its top and bottom boundaries are. There are $$\binom92$$ choices for each pair of boundaries and therefore $$\binom92^2$$ rectangles. That is to say, 1296 rectangles.

• It is amazing that this hasn't been done already on PSE! – Dr Xorile Feb 13 '19 at 17:58
• Are we only counting rectangles whose edges are made from the lines on the board? Because if you were to count all the rectangles possible by connecting corners between the squares, there's a lot more of them... – Darrel Hoffman Feb 13 '19 at 21:51
• @DarrelHoffman As per the question these rectangles must be formed from "spaces". Hence I would expect at minimum that no rectangle cuts through one of the spaces used to define it. (The question of how many rectangles can be formed from an arbitrary group of points is perhaps more interesting than this one, though.) – Brilliand Feb 14 '19 at 0:12
• Yes, the question becomes quite different (and I think much harder -- I suspect there is then no "elegant" solution) if you allow non-aligned rectangles. @Brilliand The question didn't always include the wording about "spaces" and may not have done when Darrel Hoffman wrote his comment. – Gareth McCaughan Feb 14 '19 at 0:47
• Actually, it might not be that complex. A valid rectangle shape would be one where the slope of each side is an integer ratio, where one dimension is a multiple of the other (including a multiple of 1, which would be square), and where the sums of the two side lengths' rises and runs are <= board size. Then simply multiply by board size - the difference between those values (in each dimension) for transpositions. – Darrel Hoffman Feb 14 '19 at 18:01

Of course @Gareth_McCaughan got this well-known puzzle immediately. But for people who aren't up on their combinatorics, here's the same calculation in a way that seems easier (at least to me).

1. There are 9x9 = 81 corners.
2. For each of these there are 8x8 = 64 corners that are not in the same row or column.
3. Each pair of these makes a rectangle.
4. But then each rectangle has been counted four times (you can have top-left and bottom-right or top-right and bottom-left and both of those can be done two ways)
5. So the final answer is 81 x 64/4 = 1296
• You are physicist right? – user56760 Feb 13 '19 at 18:36
• Aren't you..... – user56760 Feb 14 '19 at 8:33
• I am. Or at least that's what I studied. I don't get to do too much now. Why? – Dr Xorile Feb 14 '19 at 15:16
• I love physicists. Thinking you are one of them – user56760 Feb 14 '19 at 16:34