Let F be the matrix 1 1 1 0 Then F^n (2x2 matrix multiplication) equals F(n+1) F(n) F(n) F(n-1) because: (F(n+1) F(n) ) (1 1) = ( F(n+1)+F(n) F(n+1)) (F(n) F(n-1)) (1 0) = ( F(n)+F(n-1) F(n) )
Can anybody tell me or give me the hint that how to develop this code. In this first problem is that 2-D martix return which i never done. Secondly, give me hints or link from which i can learn how to code these types of codes(2-D return and all). This is a method to calculate nth fibo number in logn time. here , F is a matrix and which is multiplied n-1 times to calculate f(n)th term.And this multiplication is done in exponentiation by squaring or say, Divide and conquer method, don't think that this is my homeowrk , it is part of my learning and want your help. thanks in advance.
Edited 4 Years Ago by I_m_rude