Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question
1  
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
add comment

1 Answer

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|improve this answer
2  
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
    
+1 Very nice solution. –  EuYu Nov 1 '12 at 8:17
    
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
add comment

Your Answer

 
discard

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.