Maths WorkshopMaths problems with full solutions
Exercise 638Combinatorics › Counting principlesM1Added 5 Nov 2026

Tiling a 2 × n board with dominoes and squares

#recurrence#tilings#generating functions

Statement

Let ana_n be the number of ways to tile a 2×n2\times n board with 1×21\times2 dominoes (placed either way) and 2×22\times2 squares. Find a recurrence for ana_n, then prove
an=2n+1+(−1)n3.a_n=\frac{2^{n+1}+(-1)^n}3.
How many tilings are there for n=10n=10?

Hint

Look at the rightmost column. How can it be covered? Then solve the recurrence by its characteristic equation or by a generating function.

Show solutionHide solution

Solution

Idea. Condition on what covers the last column(s).

Recurrence. Put a0=1a_0=1 (empty tiling) and a1=1a_1=1 (one vertical domino). For n≥2n\ge2, look at the right end of the board:
- a vertical domino covers the last column: an−1a_{n-1} tilings of the rest;
- otherwise the top-right cell is covered by a horizontal domino, which then forces a second horizontal domino directly below it: this covers the last two columns, an−2a_{n-2} tilings of the rest;
- a 2×22\times2 square covers the last two columns: an−2a_{n-2} tilings of the rest.

These three cases are exhaustive and disjoint, so
an=an−1+2an−2.a_n=a_{n-1}+2a_{n-2}.

Solving. The characteristic equation r2=r+2r^2=r+2 has roots 22 and −1-1, so an=A 2n+B(−1)na_n=A\,2^n+B(-1)^n. From a0=1a_0=1 and a1=1a_1=1: A+B=1A+B=1 and 2A−B=12A-B=1, giving A=23A=\frac23, B=13B=\frac13. Hence an=2n+1+(−1)n3a_n=\frac{2^{n+1}+(-1)^n}3.

Generating function check. With F(x)=∑anxnF(x)=\sum a_nx^n, the recurrence gives F(x)(1−x−2x2)=1F(x)(1-x-2x^2)=1, that is F(x)=1(1−2x)(1+x)=13(21−2x+11+x)F(x)=\dfrac1{(1-2x)(1+x)}=\dfrac13\left(\dfrac2{1-2x}+\dfrac1{1+x}\right), the same formula.

Value. a10=211+13=683a_{10}=\dfrac{2^{11}+1}3=683.

Lesson. Condition on the last block, turn the count into a linear recurrence, solve it with the characteristic equation or a generating function.