Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: Math 152 - Winter 2017
Views: 17362Is there a formula?
From last time...
A mathematical question: Is there a simple formula for similar to the formula ?
YES!
Better yet, you can use Sage to discover it!
Aside: a couple of ways you could have discovered this formula yourself:
Use the identity
Write in terms of and sum the resulting geometric series.
625 loops, best of 3: 663 µs per loop
625 loops, best of 3: 341 µs per loop
<sage.ext.interpreters.wrapper_rdf.Wrapper_rdf object at 0x7fa97c11a788>
625 loops, best of 3: 587 ns per loop
1.9395054106807146
1.93950541068071
1129.47189097104
1000x speedup!
1.6338910217924534
CPU time: 2.08 s, Wall time: 2.12 s
3.54344122657581e6
So the net speedup from our first attempt is a factor of several million in speed.
Exercise now: Draw a plot of the function for various values of ...