Interesting problems tend to follow a pattern of being very easy to state, and hard to solve. I am sharing one as an example. Do try to solve it before reading through the solution. Enjoy!

Problem

In how many ways can you cover a grid with sized dominoes?

Solution

Approach

We will write the number of solutions recursively, and deduce the general formula based on this.

Recursions

After adding dominoes we get grids that might not be , so let us define these three values:

  • : The number of coverings of a grid with an extra cell in the th column.
  • : The number of coverings of a grid with two extra adjacent cells in the th column.
  • : The number of coverings of a grid.

With these in mind, we get three key recursions:

Using to get rid of all the terms we get the system of equations

In order to get similar recursions, we can define to get the system of equations.

Due to and ‘s similarity, we can work out this system in terms of their average value and difference, by setting

Substituting back in the original equations we get

These 2 equations are independent of each other and simple to solve using the Difference Equations methodology

  • : Solving we get , which leads to the general solution .
  • : Solving we get , which leads to the general solution .

With these general formulas, we can get

The final step is to find the values of , , and . For that we need to figure out basecases, namely:

Assembling all of this together we get that equals the sum of the four terms

Since is the number of solutions of a grid, our answer is

Answer