ProgrammingVery hard
The matrix [[1,1],[1,0]] raised to the 10th power, computed by fast exponentiation, has entry [0][1] equal to which Fibonacci number?
- A. 34
- B. 55
- C. 89
- D. 21
Correct answer: B. 55
The power M^n has F(n+1) in [0][0], F(n) in [0][1] and [1][0]. So [0][1] = F(10) = 55 with F(1) = F(2) = 1.
More C Programming questions
- Which prototype is valid in C99 for a function that takes a column count c and an int matrix m with c columns?
- For int a[1000][1000], which loop walks memory in address order (the cache-friendly order)?
- Which declaration makes a 10^6 int matrix at run time without depending on the stack size?
- For a matrix of size n x n with n = 500, which algorithm is correct and fast enough within 1 second for C multiplication?
- Given int a[3][4] and int q = &a[0][0], which element does q[5] refer to?
- int m[2][3] = {{1}, {2, 3}}; What is m[0][0] + m[1][0] + m[1][1] + m[0][2]?