Chessboard Tilings

A 4 × 7 4 \times 7 chessboard is to be tiled with fourteen 2 × 1 2 \times 1 dominoes. How many ways can this be done?


The answer is 781.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

We will attempt to find a recursive relationship between tiling a board of size 4 × n 4 \times n and tiling a board of size 4 × ( n 1 ) 4 \times (n-1) .

Consider a tiling of a 4 × n 4 \times n board using enough 2 × 1 2 \times 1 dominoes. There are five possible ways the dominoes in the last column of the board can be arranged. There can be (1) two vertical dominoes, (2) one horizontal above one vertical above one horizontal (each of the horizontals extends into the previous column, but we only care about the half of the horizontal domino in the last column), (3) one vertical above two horizontals, (4) two horizontals above one vertical, or (5) four horizontals.

Let's examine what the possible ways to add a column are given the current last column has each of these orientations. In other words, how can we change the contents of the last column to help make another column without affecting the contents of the second to last column?

Last column has form (1): Because none of the dominoes in the last column touch the second to last column, we can change the dominoes in the last column freely to create a new column in any of the five possible forms.

Last column has form (2): Without affecting the second to last column, we can only change the orientation of the vertical domino, which will cause a square to be "trapped" either in the bottom or the top of the new column. Therefore, we can't change the orientation of any of the dominoes in the last column and can only add a new column which is of form (1).

Last column has form (3): We can only change the orientation of the vertical domino, which means we must also place a horizontal domino to fill the spot which is no longer filled by the vertical one. A vertical domino must then be placed in the remaining two open spots in the new column, producing (4). Also, the vertical domino can be left in place, and a new column of form (1) can be added.

Last column has form (4): Essentially the same as in the previous case, except we can have a new column with either form (1) or (3).

Last column has form (5): We can't change the orientation of any of the dominoes in the last column without affecting those in the second to last column, and so the new column can only be of form (1).

Now we let f i ( n ) , i { 1 , 2 , 3 , 4 , 5 } f_i(n), i \in \{1,2,3,4,5\} represent the number of tilings of a 4 × n 4 \times n board which have a last column of form i i and let f ( n ) f(n) be the sum of these five functions for a given n n . What we did above was essentially establish the following recursive relationship for the f i f_i : f 1 ( n + 1 ) = f 1 ( n ) + f 2 ( n ) + f 3 ( n ) + f 4 ( n ) + f 5 ( n ) f 2 ( n + 1 ) = f 1 ( n ) f 3 ( n + 1 ) = f 1 ( n ) + f 4 ( n ) f 4 ( n + 1 ) = f 1 ( n ) + f 3 ( n ) f 5 ( n + 1 ) = f 1 ( n ) \begin{array}{c}\\ f_1(n+1) = f_1(n) + f_2(n) + f_3(n) + f_4(n) + f_5(n) \\ f_2(n+1) = f_1(n) \\ f_3(n+1) = f_1(n) + f_4(n) \\ f_4(n+1) = f_1(n) + f_3(n) \\ f_5(n+1) = f_1(n) \end{array}

Using the fact that f 1 ( 1 ) = 1 f_1(1) = 1 and f i ( 1 ) = 0 , i 1 f_i(1) = 0, i \neq 1 , we can find f ( 7 ) = f 1 ( 7 ) + f 2 ( 7 ) + f 3 ( 7 ) + f 4 ( 7 ) + f 5 ( 7 ) f(7) = f_1(7) + f_2(7) + f_3(7) + f_4(7) + f_5(7) , which is 747 747 , which should be the total number of tilings of a 4 × 7 4 \times 7 board using 2 × 1 2 \times 1 dominoes.

However, we have excluded some possibilities by only looking at the last column: we can have 4 × 4 4 \times 4 blocks with columns of form (2)(5)(5)(2) (this arrangement looks like a brick wall pattern) or 4 × 6 4 \times 6 blocks with columns of form (2)(5)(5)(5)(5)(2). In a 4 × 7 4 \times 7 board, we can only have one of either of these two blocks. If we have a 4 × 4 4 \times 4 block, it can be placed on an edge of the board, in which case the remaining three columns can be constructed in f ( 3 ) = 11 f(3) = 11 ways or have a column of form (1) followed by the block followed by two more columns, which can be constructed in f ( 2 ) = 5 f(2) = 5 ways. This gives 2 ( 11 + 5 ) = 32 2 \cdot (11 + 5) = 32 extra tilings (since there are two edge positions and two non-edge positions). Also, if we have a 4 × 6 4 \times 6 block, we can place a column of form (1) on either side of it to complete the 4 × 7 4 \times 7 board, which gives 2 2 extra tilings.

Thus, our final answer is 747 + 32 + 2 = 781 747 + 32 + 2 = \fbox{781} .

Ivan Koswara
Jul 22, 2013

This proof will only generate a system of recurrence equations; solving it is simply bruteforce. (To tell the truth, I also used a spreadsheet program after getting the recurrences, but it's just 30 additions of at most three-digit numbers, doable by hand.)

We will fill the board from the left. We categorize the boards according to their left ends:

  • Type A: The left end is complete (the board is 4 × n 4 \times n for some n n ).
  • Type B: The board is missing a vertical domino in a corner.
  • Type C: The board is missing a horizontal domino in a corner.
  • Type D: The board is missing a single cell in each corner (so two squares are missing).
  • Type E: The board is missing a 2x2 square in a corner.

See reference image here .

Let A ( n ) , B ( n ) , C ( n ) , D ( n ) , E ( n ) A(n), B(n), C(n), D(n), E(n) be the number of ways to tile a 4 × n 4 \times n board of type A,B,C,D,E respectively.

We begin by giving some initial values.

A ( 0 ) = 1 , B ( 0 ) = C ( 0 ) = D ( 0 ) = E ( 0 ) = 0 A(0) = 1, B(0) = C(0) = D(0) = E(0) = 0 . A 4 × 0 4 \times 0 board can be tiled with nothing, thus A ( 0 ) = 1 A(0) = 1 . However, there doesn't exist anything to take away, so we cannot form boards B,C,D,E. Of course, if the board cannot be constructed at all, there's no valid tiling, thus B ( 0 ) = C ( 0 ) = D ( 0 ) = E ( 0 ) = 0 B(0) = C(0) = D(0) = E(0) = 0 .

A ( 1 ) = B ( 1 ) = D ( 1 ) = 1 , C ( 1 ) = E ( 1 ) = 0 A(1) = B(1) = D(1) = 1, C(1) = E(1) = 0 . There obviously exists a 4 × 1 4 \times 1 board for A, and we can take either two squares nearest to some corner to form B or both corner squares to form D. A,B,D obviously have one way of tiling each, thus A ( 1 ) = B ( 1 ) = D ( 1 ) = 1 A(1) = B(1) = D(1) = 1 . However, to form C or E, we need to have two incomplete columns; impossible with just 4 × 1 4 \times 1 aka 1-column board. So C ( 1 ) = E ( 1 ) = 0 C(1) = E(1) = 0 .

Now we will generate the system of recurrences. We will do this by putting a domino on the leftmost square, and if there are several, the topmost one; call this square the "hot square". Due to how we choose the hot square, there are only two ways to tile the hot square, either vertically (downward) or horizontally (rightward). You might want to see the reference image for the following section; yellow dominoes are dominoes covering the hot square and olive/light olive dominoes are forced dominoes.

From a board of type A, we can take either a vertical domino containing the hot square to form a board of type B, or a horizontal domino containing the hot square to form a board of type C. This is the first column of the image.

From a board of type B, we can take either a vertical domino containing the hot square to form a board of type A with one less length, or a horizontal domino containing the hot square. The latter will force a horizontal domino at the bottom-left corner, making a board of type B of one less length. This is the second column of the image.

From a board of type C, we can take either a vertical domino containing the hot square, or a horizontal domino containing the hot square to form a board of type E. The former forces a horizontal domino at the bottom, forming a board of type D with one less length. This is the third column of the image.

From a board of type D, we can take either a vertical domino containing the hot square to form a board of type A with one less length, or a horizontal domino containing the hot square. The latter forces three more dominoes to form a board of type D with two less length. This is the fourth column of the image; the light olive domino is forced after putting the olive dominoes.

From a board of type E, we can take either a vertical domino containing the hot square to form a board of type B with one less length, or a horizontal domino containing the hot square. The latter forces a horizontal domino at the bottom, forming a board of type A with two less length. This is the fifth column of the image.

The above five paragraphs cover all possibilities, so we can construct the system of equations:

  • A ( n ) = B ( n ) + C ( n ) A(n) = B(n) + C(n)
  • B ( n ) = A ( n 1 ) + B ( n 1 ) B(n) = A(n-1) + B(n-1)
  • C ( n ) = D ( n 1 ) + E ( n ) C(n) = D(n-1) + E(n)
  • D ( n ) = A ( n 1 ) + D ( n 2 ) D(n) = A(n-1) + D(n-2)
  • E ( n ) = B ( n 1 ) + A ( n 2 ) E(n) = B(n-1) + A(n-2)

Together with the ten initial values given above, we can find the value of A ( 7 ) A(7) , which is what we're looking for. This value is equal to 781 \boxed{781} .

Sorry to put this as a comment to another solution, but after solving this problem I elected to skip the solution submission and first check whether my solution method was already explained. I see now that it isn't, so I want to put my two cents in, but now it seems that I can't make a submission, only a comment.

This solution is a compromise between establishing an easy recurrence relation and having to do few calculations to get the final answer.

In this proof, I will use the terms "row" and "column", as well as "horizontal" and "vertical", such that I view the board as having 4 horizontal rows and 7 (or n n ) vertical columns.

Let us consider a 4 × n 4 \times n chessboard in general. For each possible tiling, we can identify some columns c c such that there is no horizontal domino that extends over columns c c and c + 1 c+1 . Note that in particular column n n is such a column. We can therefore, for each tiling, define a first column (i.e. a smallest c c ), to be called column k k ( 1 k n ) 1 \leq k \leq n) , for which this is the case. We can categorize all tilings by this number k k , count the number of tilings in each category separately, and add it all together in the end.

Consider all tilings for which this "minimum column" is k k . Let a k a_k be the number of ways in which a 4 × k 4 \times k chessboard can be covered, such that for all columns c < k c < k , there is at least one horizontal tile extending over columns c c and c + 1 c+1 . Let u m u_m be the total number of ways to tile a 4 × m 4 \times m chessboard. It then follows easily that the number of tilings in this category k k is equal to a k u n k a_k u_{n-k} .

Taking all categories together, we thus establish the recurrence relation

u n = a 1 u n 1 + a 2 u n 2 + + a n u 0 u_n = a_1 u_{n-1} + a_2 u_{n-2} + \ldots + a_n u_0

We now determine the values of a i a_i . There is only a limited number of ways in which a 4 × m 4 \times m chessboard can be covered such that all adjacent columns have at least one horizontal tile in both. We can split them into the following cases:

  • Two vertical dominoes in the first column. This contributes to a 1 a_1 .
  • Four horizontal dominoes in the first two columns. This contributes to a 2 a_2 .
  • One horizontal domino in the top row and one in the bottom row, with a vertical domino in between. This followed by an arbitrary number of quartets of horizontal dominoes, and then finally a vertical domino in the middle two rows. This contributes to a 2 a_2 , a 4 a_4 , a 6 a_6 , etcetera.
  • One vertical domino in top and two horizontal dominoes below. This followed by an arbitrary number of pairs of horizontal dominoes, alternatingly in the top two and bottom two rows, and then finally a vertical domino in the remaining gap. This contributes to a 2 a_2 , a 3 a_3 , a 4 a_4 , etcetera.
  • The mirror image of the above. This contributes to a 2 a_2 , a 3 a_3 , a 4 a_4 , etcetera.

All together we find a 1 = 1 a_1=1 , a 2 = 4 a_2=4 , a 3 = 2 a_3=2 , a 4 = 3 a_4=3 , a 5 = 2 a_5=2 , a 6 = 3 a_6=3 , etcetera (i.e. a i = 2 a_i=2 for odd i i and a i = 3 a_i=3 for even i i , with a 1 = 1 a_1=1 and a 2 = 4 a_2=4 as exceptions). The recurrence relation is thus

u n = u n 1 + 4 u n 2 + 2 u n 3 + 3 u n 4 + 2 u n 5 + 3 u n 6 + u_n = u_{n-1} + 4 u_{n-2} + 2 u_{n-3} + 3 u_{n-4} + 2 u_{n-5} + 3 u_{n-6} + \ldots

We can now compute:

  • u 0 = 1 u_0 = 1
  • u 1 = 1 u_1 = 1
  • u 2 = 1 + 4 1 = 5 u_2 = 1 + 4 \cdot 1 = 5
  • u 3 = 5 + 4 1 + 2 1 = 11 u_3 = 5 + 4 \cdot 1 + 2 \cdot 1 = 11
  • u 4 = 11 + 4 5 + 2 1 + 3 1 = 36 u_4 = 11 + 4 \cdot 5 + 2 \cdot 1 + 3 \cdot 1 = 36
  • u 5 = 36 + 4 11 + 2 5 + 3 1 + 2 1 = 95 u_5 = 36 + 4 \cdot 11 + 2 \cdot 5 + 3 \cdot 1 + 2 \cdot 1 = 95
  • u 6 = 95 + 4 36 + 2 11 + 3 5 + 2 1 + 3 1 = 281 u_6 = 95 + 4 \cdot 36 + 2 \cdot 11 + 3 \cdot 5 + 2 \cdot 1 + 3 \cdot 1 = 281
  • u 7 = 281 + 4 95 + 2 36 + 3 11 + 2 5 + 3 1 + 2 1 = 781 u_7 = 281 + 4 \cdot 95 + 2 \cdot 36 + 3 \cdot 11 + 2 \cdot 5 + 3 \cdot 1 + 2 \cdot 1 = \boxed{781}

Thomas Beuman - 7 years, 10 months ago

Log in to reply

Sorry again, this time for adding something that I failed to notice before. The recurrence relation I derived is a bit cumbersome, because it requires all previous values of u i u_i to compute a new value. It is easily shown however, that for n > 3 n > 3 , we have

u n = u n 1 + 5 u n 2 + u n 3 u n 4 u_n = u_{n-1} + 5 u_{n-2} + u_{n-3} - u_{n-4}

I thought that was interesting enough to point out.

Thomas Beuman - 7 years, 10 months ago

Why has this solution not been voted up? Done.

Ahaan Rungta - 7 years, 10 months ago

This one is so clear!

Yunhao King - 7 years, 10 months ago
Douglas Zare
Jul 21, 2013

Consider the positions of dominoes cut by each vertical line segment. Since the number of black squares equals the number of white squares on each side, the dominoes cut by a vertical line segment must have as many black squares on the left as white squares on the left. So, the possible patterns are (0,0,0,0) (nothing cut, seen on the leftmost and rightmost vertical segments), (1,1,0,0), (0,1,1,0), (0,0,1,1), (1,0,0,1), and (1,1,1,1). The following matrix shows how many ways to go from the ith state to the jth state on the next vertical line to the right:

T = ( 1 1 0 1 1 1 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 ) T = \begin{pmatrix} 1 & 1 & 0 & 1 & 1 & 1 \newline 1 & 0 & 0 & 1 & 0 & 0 \newline 0 & 0& 0& 0 & 1 & 0 \newline 1 & 1 & 0 & 0 & 0 & 0 \newline 1 & 0 & 1 & 0 & 0 & 0 \newline 1 & 0 & 0 & 0 & 0 & 0 \end{pmatrix}

The top left corner of T n T^n tells us the number of ways to tile a 4 × n 4 \times n chessboard with dominoes. For T 7 T^7 this is 781. See also http://oeis.org/A005178.

I'm not sure which line segments you are referring to in your first line.

Sotiri Komissopoulos - 7 years, 10 months ago

Log in to reply

I'm referring to the lines of the chessboard, the lines containing the sides of the squares.

Douglas Zare - 7 years, 10 months ago

This is by far the most elegant solution to this problem, IMO.

Marcell Simkó - 7 years, 10 months ago
Bob Bobson
Jul 27, 2013

We will describe the coordinates of a board of dimension 4 × n 4 \times n by the coordinates ( i , j ) (i,j) where i { 1 , 2 , 3 , 4 } i \in \{1,2,3,4\} and j { 1 , 2 , , n } j \in \{1,2, \ldots, n\} . We define three different sequences. Let f ( n ) f(n) be the number of ways to tile a 4 × n 4 \times n board with 2 n 2n of the tiles. We wish to compute f ( 7 ) f(7) . Let g ( n ) g(n) be the number of ways to tile a 4 × n 4 \times n with 2 n 1 2n-1 tiles such that positions ( 1 , n ) (1,n) and ( 2 , n ) (2,n) are uncovered, and let h ( n ) h(n) be the number of ways to tile a 4 × n 4 \times n board with 2 n 1 2n-1 tiles such that positions ( 1 , n ) (1,n) and ( 4 , n ) (4,n) are uncovered.

Suppose that for some n 3 n \ge 3 we wish to calculate f ( n ) f(n) . The n n th column of a valid tiling of the 4 × n 4 \times n board has 5 possibilities. Drawing them out, it becomes apparent that f ( n ) = f ( n 1 ) + f ( n 2 ) + 2 g ( n 1 ) + h ( n 1 ) f(n) = f(n-1) + f(n-2) + 2g(n-1) + h(n-1) . Similarly, examining the possibilities for the n n th row for tilings satisfying the definitions of g ( n ) g(n) and h ( n ) h(n) it is easy to see that g ( n ) = f ( n 1 ) + g ( n 1 ) g(n) = f(n-1) + g(n-1) and h ( n ) = f ( n 1 ) + h ( n 2 ) h(n) = f(n-1) + h(n-2) . Looking at base cases we can easily check that f ( 1 ) = g ( 1 ) = h ( 1 ) = 1 f(1) = g(1) = h(1)=1 and f ( 2 ) = 5 f(2) = 5 , g ( 2 ) = 2 g(2) = 2 , h ( 2 ) = 1 h(2) = 1 .

Writing out a table for all the values f ( n ) , g ( n ) , h ( n ) f(n), g(n), h(n) and calculating each new row from the previous two, we find that f ( 7 ) = f ( 6 ) + f ( 5 ) + 2 g ( 6 ) + h ( 6 ) f(7) = f(6) + f(5) + 2g(6) + h(6) = 281 + 95 + 2 149 + 107 = 781 = 281+95+2*149+107 = \boxed{781} .

Alfredo Saracho
Jul 27, 2013

This is a simple application of the Temperly & Fisher relation for dominoes tiling. The number of ways to cover an m × n m\times n grid with dominoes is given by:

j = 1 m k = 1 n ( 4 cos 2 π j m + 1 + 4 cos 2 π k n + 1 ) 1 4 , \prod_{j=1}^m \prod_{k=1}^n \left ( 4\cos^2 \frac{\pi j}{m + 1} + 4\cos^2 \frac{\pi k}{n + 1} \right )^\frac{1}{4},

Substituting m = 4 , n = 7 m = 4, n =7 leads an answer of 781 .

This is a famous formula where you can easily state: "Use this formula". The question is how - is it trivial to calculate that huge product? I suspect Mathematica may be the answer, but is that the point? ;)

Ahaan Rungta - 7 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...