Skip to content

Instantly share code, notes, and snippets.

@hughdbrown
Created May 17, 2017 04:36
Show Gist options
  • Save hughdbrown/91ef81ba5d52d7d0ea333d9b75eaa56d to your computer and use it in GitHub Desktop.
Save hughdbrown/91ef81ba5d52d7d0ea333d9b75eaa56d to your computer and use it in GitHub Desktop.
Function to calculate fibonacci function
import numpy as np
m = np.matrix([[1, 1], [1, 0]])
def fib(n):
return (m ** n)[0, 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment