00-Introduction.ipynb 51 KB
Newer Older
Ben Glocker's avatar
Ben Glocker committed
1
2
3
4
5
6
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
Ben Glocker's avatar
Ben Glocker committed
7
    "# Introduction to Python (for Algorithms 2)"
Ben Glocker's avatar
Ben Glocker committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "by *James Booth* and *Ghislain Antony Vaillant*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Disclaimer"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This notebook is by no means a comprehensive introduction to the Python programming language. It covers the essential language features required to implement, test and validate the Algorithms 202 courseworks. It is strongly advised to complement this tutorial with additional reading such as the [official Python documentation](https://docs.python.org/3/), [Python 101](https://leanpub.com/python_101) or the excellent [Hitchhiker's guide to Python](http://docs.python-guide.org/en/latest/)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Language basics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Syntax and features"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Hello world"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
55
56
57
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
   "outputs": [],
   "source": [
    "print(\"Hello, world!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Built-in [functions](https://docs.python.org/3/library/functions.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
73
74
75
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
76
77
78
79
80
81
82
83
84
85
   "outputs": [],
   "source": [
    "print(\"Hello, world!\")\n",
    "print(\"Hello,\", \"world!\")\n",
    "print(\"{}, {}!\".format(\"Hello\", \"world\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
86
87
88
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
89
90
91
92
93
94
95
96
   "outputs": [],
   "source": [
    "help(print)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
97
98
99
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
100
101
102
103
104
105
106
107
   "outputs": [],
   "source": [
    "type(1.0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
108
109
110
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
   "outputs": [],
   "source": [
    "assert(2 % 2 == 0)\n",
    "#assert(2 / 2 == 0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Built-in [types](https://docs.python.org/3/library/stdtypes.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
127
128
129
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
   "outputs": [],
   "source": [
    "# Booleans\n",
    "B = True\n",
    "print(type(B))\n",
    "\n",
    "# Numeric types\n",
    "N = 1\n",
    "print(type(N))\n",
    "\n",
    "N = 1.0\n",
    "print(type(N))\n",
    "\n",
    "N = 1j\n",
    "print(type(N))\n",
    "\n",
    "# Strings\n",
    "N = \"Hello, word\"\n",
    "print(type(N))\n",
    "\n",
    "# Lists\n",
    "L = [False, 1.0, \"Hello\"]\n",
    "print(type(L))\n",
    "\n",
    "# Ranges\n",
    "R = range(10)\n",
    "print(type(R))\n",
    "\n",
    "# None\n",
    "print(type(None))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Dynamic typing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
172
173
174
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
   "outputs": [],
   "source": [
    "x = 3  # Defines a binding a variable named \"x\",\n",
    "       # to an object of type integer with value 3.\n",
    "print('x is of type {} with value {}'.format(type(x), x))\n",
    "\n",
    "x = 2.0  # Redefine the binding between \"x\" and an\n",
    "         # object of type float with value 2.0.\n",
    "print('x is of type {} with value {}'.format(type(x), x))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Strong typing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
196
197
198
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
199
200
201
202
203
204
205
206
207
   "outputs": [],
   "source": [
    "print(1 + '2')  # What is the intent here? \n",
    "                # \"Explicit is better than implicit.\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
208
209
210
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
   "outputs": [],
   "source": [
    "print(str(1) + '2')  # String concatenation.\n",
    "print(1 + int('2'))  # Integer summation."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Variables and scopes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
227
228
229
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
   "outputs": [],
   "source": [
    "a = 0\n",
    "\n",
    "if False:\n",
    "    b = 1\n",
    "\n",
    "def my_function(c):\n",
    "    d = 3\n",
    "    print(a)  # a is global\n",
    "    print(b)  # b is global\n",
    "    print(c)  # c is local\n",
    "    print(d)  # d is local\n",
    "\n",
    "my_function(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Control flow"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### `if` statements"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
264
265
266
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
   "outputs": [],
   "source": [
    "# simple branching\n",
    "if condition:\n",
    "    do_something()\n",
    "\n",
    "# 2-way branching\n",
    "if condition:\n",
    "    do_something()\n",
    "else:\n",
    "    do_other_thing()\n",
    "\n",
    "# switch-case style\n",
    "if condition:\n",
    "    do_something()\n",
    "elif other_condition:\n",
    "    do_other_thing()\n",
    "else:\n",
    "    do_default_thing()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### `while` statements"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
298
299
300
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
   "outputs": [],
   "source": [
    "# loop until\n",
    "while condition:\n",
    "    do_something()\n",
    "\n",
    "# loop until with break clause\n",
    "while condition:\n",
    "    do_something()\n",
    "    if specific_condition:\n",
    "        break  # exit while loop regardless\n",
    "    do_other_thing()\n",
    "\n",
    "# loop until with break clause\n",
    "while condition:\n",
    "    do_something()\n",
    "    if specific_condition:\n",
    "        continue  # loop-back regardless\n",
    "    do_other_thing()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### `for` statements"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
332
333
334
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
335
336
337
338
339
340
341
342
343
   "outputs": [],
   "source": [
    "for n in range(10):\n",
    "    print(n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
344
345
346
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
347
348
349
350
351
352
353
354
355
356
   "outputs": [],
   "source": [
    "numbers = [1, 2, 3]\n",
    "for number in numbers:\n",
    "    print(number)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
357
358
359
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
   "outputs": [],
   "source": [
    "ingredients = ['carrots', 'leeks', 'potatoes']\n",
    "for index, ingredient in enumerate(ingredients):\n",
    "    print(index, ingredient)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Data structures"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Common concepts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
384
385
386
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
387
388
389
390
391
392
393
394
395
396
397
   "outputs": [],
   "source": [
    "# literals\n",
    "vowels = ['a', 'e', 'i', 'o', 'u', 'y']\n",
    "print('vowels: {}'.format(vowels))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
398
399
400
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
401
402
403
404
405
406
407
408
409
410
411
   "outputs": [],
   "source": [
    "# indexing\n",
    "print('the first vowel is: ' + vowels[0])\n",
    "print('the last vowel is: ' + vowels[-1])\n",
    "print('the second-to-last vowel is: ' + vowels[-2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
412
413
414
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
415
416
417
418
419
420
421
422
423
424
425
426
   "outputs": [],
   "source": [
    "# slicing\n",
    "print('first three: {}'.format(vowels[:3]))\n",
    "print('last two: {}'.format(vowels[-2:]))\n",
    "print('middle ones: {}'.format(vowels[1:-1]))\n",
    "print('one each two: {}'.format(vowels[::2]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
427
428
429
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
430
431
432
433
434
435
436
437
438
439
   "outputs": [],
   "source": [
    "# iteration\n",
    "for vowel in vowels:\n",
    "    print(vowel.upper())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
440
441
442
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
   "outputs": [],
   "source": [
    "# enumeration\n",
    "for index, vowel in enumerate(vowels):\n",
    "    print(\"vowel {} is {}\".format(1+index, vowel))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Immutable sequences"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
460
461
462
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
463
464
465
466
467
468
469
470
471
   "outputs": [],
   "source": [
    "vowels = ('a', 'e', 'i', 'o', 'u', 'y')\n",
    "print(type(vowels))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
472
473
474
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
   "outputs": [],
   "source": [
    "vowels[1] = 'b'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Mutable sequences"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
490
491
492
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
493
494
495
496
497
498
499
500
501
   "outputs": [],
   "source": [
    "vowels = ['a', 'e', 'i', 'o', 'u', 'y']\n",
    "print(type(vowels))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
502
503
504
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
   "outputs": [],
   "source": [
    "vowels[1] = 'b'\n",
    "print(vowels)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Dictionaries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
521
522
523
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
524
525
526
527
528
529
530
531
532
533
534
535
536
   "outputs": [],
   "source": [
    "# build using literal construct: {k1: v1, k2:v2}\n",
    "D = {\"one\": 1, \n",
    "     \"two\": 2, \n",
    "     \"three\": 3}\n",
    "\n",
    "print('D: {}'.format(D))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
537
538
539
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
540
541
542
543
544
545
546
547
548
549
550
   "outputs": [],
   "source": [
    "# indexing\n",
    "print(D[\"one\"])\n",
    "print(D[\"two\"])\n",
    "print(D[\"three\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
551
552
553
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
   "outputs": [],
   "source": [
    "# iterating\n",
    "for item in D.items():\n",
    "    print(item)\n",
    "\n",
    "for key in D.keys():\n",
    "    print(key)\n",
    "\n",
    "for value in D.values():\n",
    "    print(value)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Standard definiton\n",
    "def my_function(arg1, arg2):\n",
    "    # Do something with arg1, arg2\n",
    "    # ...\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
592
593
594
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
   "outputs": [],
   "source": [
    "# Lambda definition\n",
    "x_power_x = lambda x: x**x\n",
    "print(x_power_x(2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Application: Complexity analysis of bubble sort"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Implementation"
   ]
  },
  {
   "cell_type": "code",
Ben Glocker's avatar
Ben Glocker committed
618
   "execution_count": 2,
Ben Glocker's avatar
Ben Glocker committed
619
620
621
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
   "outputs": [],
   "source": [
    "def bubble_sort(L):\n",
    "    \"\"\"\n",
    "    Sorts the input list inplace using a deterministic version of the bubble sort algorithm [1].\n",
    "    \n",
    "    [1] https://en.wikipedia.org/wiki/Bubble_sort\n",
    "    \"\"\"\n",
    "    max_pass = len(L) - 1\n",
    "    for pass_num in range(max_pass):\n",
    "        for i in range(max_pass-pass_num):\n",
    "            if L[i+1] < L[i]:\n",
    "                L[i], L[i+1] = L[i+1], L[i]\n",
    "    return L\n",
    "\n",
    "\n",
    "def my_sorted(iterable):\n",
    "    \"\"\"\n",
    "    Returns the sorted elements of the iterable as a list.\n",
    "    \"\"\"\n",
    "    return bubble_sort(list(iterable))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Unit testing"
   ]
  },
  {
   "cell_type": "code",
Ben Glocker's avatar
Ben Glocker committed
654
   "execution_count": 3,
Ben Glocker's avatar
Ben Glocker committed
655
656
657
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
   "outputs": [],
   "source": [
    "test_cases = [\n",
    "    [3, 2, 1, 6, 5, 4],\n",
    "    [6, 5, 4, 3, 2, 1],  # Worst case\n",
    "    [1, 3, 2, 4, 6, 5],  # One pass required\n",
    "]\n",
    "\n",
    "for case in test_cases:\n",
    "    # Validate against built-in sorted\n",
    "    #print(my_sorted(case), sorted(case))\n",
    "    assert(my_sorted(case) == sorted(case))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Complexity analysis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Data generation"
   ]
  },
  {
   "cell_type": "code",
Ben Glocker's avatar
Ben Glocker committed
688
   "execution_count": 4,
Ben Glocker's avatar
Ben Glocker committed
689
   "metadata": {},
690
691
692
693
694
695
696
697
698
699
700
701
702
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method randint in module random:\n",
      "\n",
      "randint(a, b) method of random.Random instance\n",
      "    Return random integer in range [a, b], including both end points.\n",
      "\n"
     ]
    }
   ],
Ben Glocker's avatar
Ben Glocker committed
703
704
705
706
707
708
709
   "source": [
    "from random import randint\n",
    "help(randint)"
   ]
  },
  {
   "cell_type": "code",
Ben Glocker's avatar
Ben Glocker committed
710
   "execution_count": 40,
Ben Glocker's avatar
Ben Glocker committed
711
   "metadata": {},
712
713
714
715
716
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Ben Glocker's avatar
Ben Glocker committed
717
      "[658042, 242361, 863569, 787057, 225873, 237945, 236740, 938816, 355375, 141558, 892528, 211345, 581149, 33164, 158996, 838642, 498178, 151876, 1675, 23323]\n"
718
719
720
     ]
    }
   ],
Ben Glocker's avatar
Ben Glocker committed
721
722
   "source": [
    "randlist = lambda n: [randint(1e1, 1e6) for i in range(n)]\n",
723
    "print(randlist(20))"
Ben Glocker's avatar
Ben Glocker committed
724
725
726
727
728
729
730
731
732
733
734
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Timing method"
   ]
  },
  {
   "cell_type": "code",
735
   "execution_count": 34,
Ben Glocker's avatar
Ben Glocker committed
736
   "metadata": {},
737
738
739
740
741
742
743
744
745
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "min = 3.8399983616006945e-06, max = 0.0001740799257258993, mean = 9.804795816620452e-06\n"
     ]
    }
   ],
Ben Glocker's avatar
Ben Glocker committed
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
   "source": [
    "def timed(f, *args, **kwargs):\n",
    "    from time import clock\n",
    "    before = clock()\n",
    "    result = f(*args, **kwargs)\n",
    "    after = clock()\n",
    "    return after-before\n",
    "\n",
    "# Collect enough time samples\n",
    "timings = [timed(my_sorted, case) for case in [randlist(6) for n in range(1000)]]\n",
    "\n",
    "from statistics import mean\n",
    "print(\"min = {}, max = {}, mean = {}\".format(\n",
    "    min(timings), max(timings), mean(timings)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Experiment"
   ]
  },
  {
   "cell_type": "code",
771
   "execution_count": 35,
Ben Glocker's avatar
Ben Glocker committed
772
773
774
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
775
776
   "outputs": [],
   "source": [
Ben Glocker's avatar
Ben Glocker committed
777
    "sizes = list(range(1, 1000, 100)) + list(range(1000, 10000, 1000))\n",
Ben Glocker's avatar
Ben Glocker committed
778
779
780
781
782
783
784
785
786
787
788
789
    "timings = [timed(my_sorted, case) for case in [randlist(size) for size in sizes]]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Plotting"
   ]
  },
  {
   "cell_type": "code",
790
   "execution_count": 36,
Ben Glocker's avatar
Ben Glocker committed
791
792
793
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
794
795
796
797
798
799
800
801
802
803
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "# Uncomment for details about the plot function\n",
    "#help(plt.plot)"
   ]
  },
  {
   "cell_type": "code",
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 16.67753193491971)"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8leXdx/HPLwlhhE3CJmyQLRIQnChorWKp1oWioLbU\nLmfro6Wt1j4+7u5hUVBbbeuoe4+6qjKCsvfeJEBIwsj+PX+cI+aQBALknDvJ+b5fr7xyznXf59y/\n3IR8zz2u6zJ3R0RE4ldC0AWIiEiwFAQiInFOQSAiEucUBCIicU5BICIS5xQEIiJxTkEgIhLnFAQi\nInFOQSAiEueSgi6gOlJTU71bt25BlyEiUqfMnTt3h7unHW69OhEE3bp1IzMzM+gyRETqFDNbX531\ndGpIRCTOKQhEROKcgkBEJM4pCERE4lzUgsDMZphZlpktOqj9R2a2zMwWm9n90dq+iIhUTzSPCB4H\nzinfYGZnAOOBIe4+AHgwitsXEamzSkrLYratqAWBu38E7Dqo+XvAve5eGF4nK1rbFxGpq/YWlnD5\no7OY8d+1MdlerK8R9AFONbNZZvahmQ2vakUzm2JmmWaWmZ2dHcMSRUSCs6ewhMmPzWb22l3c9eoS\nnvh0XdS3GesgSAJaAyOBnwDPmJlVtqK7T3P3DHfPSEs7bMc4EZE6L7+gmEkzZjNnXc6BtjteXszL\n87dEdbuxDoJNwPMeMhsoA1JjXIOISK2TV1DMVTNmM3d9TkT74M4tOL13dD8MxzoIXgTOADCzPkAy\nsCPGNYiI1Cq5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E7guJ+v5T/Us9iEZE4V5tPDYmISAwoCERE4pyCQEQkzikIRETinIJARCTO\nKQhEjkB46Ib+QdchUpN0+6iISJzTEYFIFcwsxcxeM7P54bHsLzWzD8wsw8y+YWbzwl/LzWxt+DXD\nzOxDM5trZm99OYyBSG2mIBCp2jnAFncf4u4DgTe/XODuL7v78e5+PKHx6x8MjxH1B+Aidx8GzADu\nDqJwkSMRyOT1InXEQuAhM7uP0JAWHx88KZWZ3Qrsd/c/mdlAYCDwTni9REJDH4vUagoCkSq4+woz\nO4HQWE//a2bvlV9uZmOBiwlNCAOhmasWu/uo2FYqcmx0akikCmbWEdjn7k8CDxAa1vnLZV2BPwEX\nu/v+cPNyIM3MRoXXaWBmA2JctsgR0xGBSNUGAQ+YWRlQDHyP0GxXEJr3tg3wYvg00BZ3P9fMLgJ+\nH546MonQrGqLY124yJHQ7aMiInFOp4ZEROKcgkBEJM4pCERE4pyCQEQkzikIRETinIJARCTOKQhE\nROKcgkBEJM79Px7W6DmuUdHFAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x18ca1bd50f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
Ben Glocker's avatar
Ben Glocker committed
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
   "source": [
    "plt.plot(sizes, timings, linewidth=4)\n",
    "plt.xlabel('size')\n",
    "plt.ylabel('time (s)')\n",
    "plt.xlim(0)\n",
    "plt.ylim(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Fitting"
   ]
  },
  {
   "cell_type": "code",
845
   "execution_count": 38,
Ben Glocker's avatar
Ben Glocker committed
846
847
848
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
849
850
851
852
853
854
855
856
857
858
859
   "outputs": [],
   "source": [
    "from numpy import polyfit\n",
    "# Uncomment for details about polyfit\n",
    "#help(polyfit)\n",
    "\n",
    "poly = polyfit(sizes, timings, deg=2)"
   ]
  },
  {
   "cell_type": "code",
860
   "execution_count": 39,
Ben Glocker's avatar
Ben Glocker committed
861
862
863
   "metadata": {
    "collapsed": true
   },
Ben Glocker's avatar
Ben Glocker committed
864
865
866
867
868
869
870
871
872
873
874
   "outputs": [],
   "source": [
    "from numpy import polyval\n",
    "# Uncomment for details about polyval\n",
    "#help(polyval)\n",
    "\n",
    "fitted = polyval(poly, sizes)"
   ]
  },
  {
   "cell_type": "code",
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 17.591113768918017)"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VFX6wPHvm16ABJLQCTX0TigqIiBKEUURCysKirJr\n+7k2FMvqrquCuvaKFAuKiiCigIjYQASkSehdCARIaAkkpM35/XGHkMlMSCBTksz7eZ48zJx77r1v\nrnHeueeeIsYYlFJK+a8AXweglFLKtzQRKKWUn9NEoJRSfk4TgVJK+TlNBEop5ec0ESillJ/TRKCU\nUn5OE4FSSvk5TQRKKeXngnwdQGnExsaaRo0a+ToMpZSqUFatWpVmjIkrqV6FSASNGjVi5cqVvg5D\nKaUqFBH5qzT1tGlIKaX8nCYCpZTyc5oIlFLKz2kiUEopP6eJQCml/JwmAqWU8nOaCJRSys9pIlBK\nqfLEGNi32qun1ESglFLlhTHw3aPwfl9I+tJrp60QI4uVUqrSs9lg7gOwaqr1ftYYCAyB1ld5/NR6\nR6CUUr5my4c595xJAgAmH+Y9BDknPX56TQRKKeVruVmQutmxLCIWRsyCkEiPn14TgVJK+VpoFRgx\nE2q3t95XqQ23zoPabb1yek0ESilVHoRXh5tnQ8L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CYCpZTyc5oIlDoH9qkbWvs6DqXcSbuPKqWUn9M7AqWKISKRIjJXRP60z2V/\ng4j8LCKJInKViKy1/2wRkV32fbqIyC8iskpEFpyexkCp8kwTgVLFGwDsN8Z0MMa0Bb47vcEYM8cY\n09EY0xFr/vqX7HNEvQEMM8Z0AaYAz/oicKXOhU8Wr1eqgkgC/iciE7CmtFhcdFEqERkLZBlj3hKR\ntkBbYKG9XiDW1MdKlWuaCJQqhjFmq4h0xprr6b8isqjwdhHpB1yHtSAMWCtXbTDGXODdSJUqG20a\nUqoYIlIXyDTGTANexJrW+fS2hsBbwHXGmCx78RYgTkQusNcJFpE2Xg5bqXOmdwRKFa8d8KKI2IBc\n4E6s1a7AWvc2Bphtbwbab4wZJCLDgNftS0cGYa2qtsHbgSt1LrT7qFJK+TltGlJKKT+niUAppfyc\nJgKllPJzmgiUUsrPaSJQSik/p4lAKaX8nCYCpZTyc5oIlFLKz/0/3u54ggDE8poAAAAASUVORK5C\nYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x18ca1d90198>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
Ben Glocker's avatar
Ben Glocker committed
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
   "source": [
    "plt.plot(sizes, timings, '-', linewidth=4)\n",
    "plt.plot(sizes, fitted, '--', linewidth=4)\n",
    "plt.xlabel('size')\n",
    "plt.ylabel('time (s)')\n",
    "plt.xlim(0)\n",
    "plt.ylim(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Going further"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Provide an alternative implementation of bubble sort with the optimization tricks explained in the Wikipedia article.\n",
    "- Modify the `my_sorted` function to allow users to choose between the deterministic and the optimized implementations. By default, `my_sorted` should still be using the determinisitic version.\n",
    "- Run the experiment above with the optimized bubble sort implementation.\n",
    "- Compare the deterministic and optimized implementations with a plot.\n",
    "- Draw some conclusions from this analysis."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}