Fibonacci using matrix representation is of the form :
Fibonacci Matrix. This claims to be of O(log n).However, isn't computing matrix multiplication of order O(n^3) or using Strassen's algorithm O(n^2.81)? How can this be solved in O(log n)?
2026-03-27 07:29:21.1774596561
On
Fibonacci using Matrix Representation.
1.1k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
0
On
Matrix multiplication is $O(n^{2.81})$, where $n$ is the size of the matrix. The matrix size is constant here ($n = 2$). So each matrix multiplication takes constant time.
If we want $f_k$, there are $\log k$ matrix multiplications needed. Each takes constant time, so the total time is $O(\log k)$.
Yes, using Fibonacci Matrix $\begin{pmatrix} 1&1\\1&0\end{pmatrix}$ is the way to calculate the nth fibonacci number in $O(log(n))$ time. You can apply this to the matrix, and the solution is reduced to $O(log(n))$.
I put an example code.