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

Problem Statement Problem Statement

Source - Zonal Informatics Olympiad 2006 Question Paper

Have tried deriving the answer through solutions to smaller problems, but of no avail.

share|cite|improve this question
Try coming up with two recurrence relations, one for a flat edge and one for a bumpy edge. – wj32 Nov 1 '12 at 8:00
up vote 3 down vote accepted

Now incorporating EuYu's comment:

If $f(n)$ is the number of ways of tiling a $2 \times n$ rectangle then $$f(n)=f(n-1)+f(n-2)+2\sum_{j\lt n-2}f(j)$$ starting at $f(0)=1$, since the right hand end can be a vertical double tile, two horizontal double tiles, or in two orientations an L on the end with repeating horizontal doubles eventually capped by another L.

You can now answer the particular questions by hand, or by noting this is also $$f(n)=2f(n-1)+f(n-3)$$ starting at $f(0)=f(1)=1$, with the generating function $1/(1-2x-x^3),$ or just look up OEIS A052980 .

share|cite|improve this answer
Not quite true, how about an $L$ on the end with repeating horizontal doubles eventually capped by another $L$. – EuYu Nov 1 '12 at 8:02
@EuYu: very true. – Henry Nov 1 '12 at 8:05
Works like a charm! Could you also please elaborate on how you derived the function? – 7Aces Nov 1 '12 at 8:26
@7Aces: the first function comes for removing the first height 2 rectangle at the right, the second by looking at $f(n)-f(n-1)$. – Henry Nov 1 '12 at 13:26

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.