Beruflich Dokumente
Kultur Dokumente
R. Inkulu
http://www.iitg.ac.in/rinkulu/
1/4
Problem
2/4
Observation
0 1
1 1
n
1
fn1
=
0
fn
denote with An b = c
naive: n matrix multiplications
but with repeated squaring: O(lg n) matrix multiplications suffice to
compute An
Further, multiplication of two 2 2 matrices involve O(1) integer
3/4
Analysis
let M(n) denote the time to multiply/add two n-bit integers 1 , which is
O(n1.585 ) from the Karastubas algorithm
let T(n) denotes the time to compute the nth power of the given 2 2 matrix
(i.e., time to compute f (n))
T(n) = T( 2n ) + M(n)
Hence, T(n) is O(n1.585 )
1
as we had seen nth Fibonacci number is O(n ) i.e., it takes (n) time to write f (n); hence,
we need to consider the bit complexity in integer arithmatic
(Computing a Fibonacci Number)
4/4