From f49e417988f8e7b53be11d6f979ca5564894f449 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Thu, 22 Oct 2020 18:55:22 +0200 Subject: [PATCH] Streamline slides --- 09_mappings/02_content.ipynb | 54 ++++++++++++++++++++++++++++++------ 09_mappings/04_content.ipynb | 6 +++- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/09_mappings/02_content.ipynb b/09_mappings/02_content.ipynb index ae2c380..78ac6ff 100644 --- a/09_mappings/02_content.ipynb +++ b/09_mappings/02_content.ipynb @@ -614,7 +614,11 @@ { "cell_type": "code", "execution_count": 21, - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, "outputs": [], "source": [ "def fibonacci(i):\n", @@ -636,7 +640,11 @@ { "cell_type": "code", "execution_count": 22, - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "fragment" + } + }, "outputs": [ { "data": { @@ -655,14 +663,22 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, "source": [ "#### Efficiency of Algorithms" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "skip" + } + }, "source": [ "Timing the code cells below with the `%%timeit` magic shows how doubling the input (i.e., `12` becomes `24`) more than doubles how long it takes `fibonacci()` to calculate the solution. This is actually an understatement as we see the time go up by roughly a factor of $1000$ (i.e., from nano-seconds to milli-seconds). That is an example of **exponential growth**." ] @@ -670,7 +686,11 @@ { "cell_type": "code", "execution_count": 23, - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, "outputs": [ { "name": "stdout", @@ -688,7 +708,11 @@ { "cell_type": "code", "execution_count": 24, - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "fragment" + } + }, "outputs": [ { "name": "stdout", @@ -729,7 +753,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, "source": [ "### \"Easy at second Glance\" Example: [Fibonacci Numbers ](https://en.wikipedia.org/wiki/Fibonacci_number) (revisited)" ] @@ -797,7 +825,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "skip" + } + }, "source": [ "When we follow the flow of execution closely, we realize that the intermediate results represented by the left-most path in the graph above are calculated first. `fibonacci(1)`, the left-most leaf node $F(1)$, is the first base case reached, followed immediately by `fibonacci(0)`. From that moment onwards, the flow of execution moves back up the left-most path while adding together the two corresponding child nodes. Effectively, this mirrors the *iterative* implementation in that the order of all computational steps are *identical* (cf., the \"*Hard at first Glance*\" example in [Chapter 4 ](https://nbviewer.jupyter.org/github/webartifex/intro-to-python/blob/develop/04_iteration/02_content.ipynb#\"Hard-at-first-Glance\"-Example:-Fibonacci-Numbers--(revisited))).\n", "\n", @@ -1000,7 +1032,11 @@ { "cell_type": "code", "execution_count": 32, - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "skip" + } + }, "outputs": [ { "ename": "RecursionError", diff --git a/09_mappings/04_content.ipynb b/09_mappings/04_content.ipynb index 97c3875..06e0f7f 100644 --- a/09_mappings/04_content.ipynb +++ b/09_mappings/04_content.ipynb @@ -526,7 +526,11 @@ { "cell_type": "code", "execution_count": 17, - "metadata": {}, + "metadata": { + "slideshow": { + "slide_type": "skip" + } + }, "outputs": [], "source": [ "import collections.abc as abc"