⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 18m 44s17 days 22 hours 18 minutes 44 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 18m 44s17 days 22 hours 18 minutes 44 seconds.

Sign in to watch this lesson
Advanced - Number Theory · 4:31
Multiplying the pair (F_n, F_n-1) by the matrix [[1,1],[1,0]] moves it one step along the Fibonacci sequence, so the n-th power of that matrix holds F_n, and binary exponentiation computes it with about log n matrix products. We cover fast doubling, the identities the matrix explains (Cassini and gcd(F_m, F_n) = F_gcd(m,n)), and the same technique for any linear recurrence and for counting walks in a graph.