Question: In C++, you will write code to empirically compare the performance of a naive and a fast 2 2 matrix exponentiation method. The naive matrix
In C++, you will write code to empirically compare the performance of a naive and a fast 2 2 matrix exponentiation method. The naive matrix exponentiation method consists of successive computation of matrix products: mn = Qn i=1 m = m m m m | {z } n times . The fast matrix exponentiation algorithm involves successive squaring.
Sample Run:
Enter the top-left, top-right, bottom-left and bottom-right entries of the first matrix: 52 45 87 95 'Enter the top-left, top-right, bottom-left and bottom-right entries of the second matrix: 452 789 654 123
m1 = [[52, 45], [87, 95]]
m2 = [[452, 789], [654, 123]]
(m1 - m2)(m1 + m2) = ........
|(m1 - m2)(m1 + m2)| = ........
Which Fibonacci number do you wish to compute? 250 Fib(250) = ........
Empirical Analysis of Naive vs Fast Matrix Exponentiation in Generating 19 Terms of the Fibonacci Sequence
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
