Explore >> Select a destination


You are here

consequently.org
| | smolny.org
18.2 parsecs away

Travel
| | Andrei Rodin Dr. Sc. in Philosophy (St. Petersburg University); Ph.D. in Philosophy (the Institute of Philosophy of Russian Academy of Sciences) former [...]
| | jdh.hamkins.org
12.3 parsecs away

Travel
| | This will be a series of self-contained lectures on the philosophy of mathematics, given at Oxford University in Michaelmas term 2019. We will be meeting in the Radcliffe Humanities Lecture Room at
| | ncatlab.org
10.4 parsecs away

Travel
| |
| | www.oranlooney.com
98.0 parsecs away

Travel
| A common example of recursion is the function to calculate the \(n\)-th Fibonacci number: def naive_fib(n): if n < 2: return n else: return naive_fib(n-1) + naive_fib(n-2) This follows the mathematical definition very closely but it's performance is terrible: roughly \(\mathcal{O}(2^n)\). This is commonly patched up with dynamic programming. Specifically, either the memoization: from functools import lru_cache @lru_cache(100) def memoized_fib(n): if n < 2: return n else: return memoized_fib(n-1) + memoiz...