I wrote a program recently which was based on a recursive algorithm, solving for the number of ways to tile a 3xn board with 2x1 dominoes:
F(n) = F(n-2) + 2*G(n-1)
G(n) = G(n-2) + F(n-1)
F(0) = 1, F(1) = 0, G(0) = 0, G(1) = 1
I tried to calculate the complexity using methods I know such as recursion tree and expansion, but none resulted in any answer. Actually I had never come across such a recursion, where the relations are codependent.
Am I using the wrong methods, or maybe using the methods in a wrong way? And if so, can anyone offer a solution?
Edit: I asked the same question in CS Stack Exchange, and a good answer was also given there. https://cs.stackexchange.com/questions/124514/calculating-complexity-for-recursive-algorithm-with-codependent-relations