Note that the schedule of lectures is tentative and may change, particularly with respect to guest lecturer availability.
Week 1 (23 - 27 July)#
- Tuesday lecture: Introduction to the course and administrative matters (slides).
- Friday lecture: Functional abstraction (slides).
Week 2 (30 July - 3 August)#
- Tuesday lecture: Values, types and expressions (slides).
- Friday lecture: Functions (slides; examples: calculating change in percent, friction calculation with functions).
Reading guide:
- In Downey: Chapters 1, 2 and 3.
- In Punch & Enbody: Chapter 1 (excluding 1.10) and the beginning of Chapter 6, up to (not including) 6.3.3.
Week 3 (6 - 10 August)#
- Tuesday lecture: Program control flow, part 1: Branching (slides; examples: stacking red boxes, counting boxes, recursive, interval-halving algorithm).
- Friday lecture: Program control flow, part 2: Iteration (slides; examples: counting boxes, iterative, Falcon 9 simulation).
Reading guide:
- In Downey: Chapter 5, Chapter 6 up to (not including) section “More Recursion”, and Chapter 7.
- In Punch & Enbody: Chapter 2, except the parts about
for
loops (for example, section 2.2.13).
Week 4 (13 - 17 August)#
- Tuesday lecture: Sequence data types, part 1 (slides; solutions to the sensor modelling problem: using only basic loops, using NumPy).
- Friday lecture: Code quality, testing and debugging (slides).
Reading guide:
Both books begin with strings as the first sequence type. We will get to strings in Week 5. However, parts of the relevant chapters describe properties of strings that are in fact common to all sequence types, and can be read without worrying about character representation.
- In Downey: Chapter 8, up to (not including) section “String Methods”.
- In Punch & Enbody: Section 4.1 (sections 4.1.1 and 4.1.2 are specific to strings, and will become relevant in Week 5).
Neither text book has much material on NumPy.
Downey’s book has a section on debugging in every chapter. The advice in the debugging sections of chapters 1 through 8 is all relevant and useful to debugging the kinds of programs we have written so far.
Week 5 (20 - 24 August)#
Reading guide:
- In Downey: Chapter 8.
- In Punch & Enbody: Chapter 4. Section 4.4 and 4.7 on string formatting can be skipped.
- The python documentation has a section about floating-point numbers.
- http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html presents a very detailed, quite mathematical, look into floating point number representation and arithmetic.
- Here is a video of a very interesting talk: https://www.youtube.com/watch?v=aP0Y1uAA-2Y. The speaker discusses alternative number systems for representing and computing with fractional numbers. Maybe soon we will not be using floats at all!
Week 6 (27 - 31 August)#
-
Note: Friday 31st of August is Census date.
- Tuesday lecture: Data science. (slides; example program).
- Friday: No lecture.
Break#
Week 7 (17 - 21 September)#
- Tuesday lecture: Sequence data types, part 2 (slides).
- Friday lecture: More about functions. (slides).
Reading guide:
- In Downey: Chapter 10 (lists). Chapters 3, 5 and 6, and section “Global variables” in Chapter 11 (functions and scope).
- In Punch & Enbody: Chapter 7, except 7.7 (lists). Note: Sections 7.5.2 and 7.9 contain examples that use file reading, which we have not covered yet. You can skip these sections, or just just copy-paste the file-reading code and not worry too much about it. Chapter 6, up to (not including) section 6.3.4; Section 8.1; Section 9.6 (functions and scope).
Week 8 (24 - 28 September)#
Reading guide:
- In Downey: Chapter 14, up to section 14.4 “Catching Exceptions” (files). Chapter 21 (print copy) / Appendix B (on-line copy) covers algorithm complexity, but the section on hash tables may be too advanced at this point in the course.
- In Punch & Enbody: Chapter 5, up to (not including) section 5.6 (files). This book does not have any material on algorithm or problem complexity.
Week 9 (1 - 5 October)#
-
Monday the 1st is a public holiday.
- Tuesday lecture: Guest lecture Professor Elanor Huntington (who is also the Dean of the College of Engineering and Computer Science) will introduce us to Quantum computing!
- Friday lecture: Dictionaries and sets (slides).
Reading guide:
- In Downey: Chapter 11, except section “Memos” (we will talk about dynamic programming in a future lecture), and relevant parts of Chapter 12.
- In Punch & Enbody: Sections 9.1 through 9.5.
Week 10 (8 - 12 October)#
- Tuesday lecture: Abstract data types (slides; example implementation of network ADT; completed implementation of sudoku solver).
- Friday lecture: Errors and exceptions (slides).
Reading guide:
- In Downey: Chapter 20, and section “Catching Exceptions” in Chapter 14. Sections “Markov analysis” and “Data structures” in Chapter 13 briefly discuss data structure selection in the context of an example.
- In Punch & Enbody: Section 5.6 and Sections 14.4 to 14.6 cover exceptions (with a focus on handling, unfortunately). Sections 7.9, 9.5 and Chapter 10 have a little discussion about abstraction and data structures.
Week 11 (15 - 19 October)#
- Tuesday lecture: Dynamic programming (slides; dynamic programming solution to the “n choose k” problem; recursive sequence alignment algorithm; dynamic programming alignment algorithm).
- Friday lecture: python modules and programs (slides; examples: modA.py and modB.py; command line interface demo; file selection dialog demo).
Reading guide:
- Section “Memos” in Chapter 11 of Downey’s book briefly covers the idea behind dynamic programming (but considering only using a dictionary to store the intermediate results).
- There is only a short section called “Writing Modules”, in Chapter 14, in Downey’s book.
- Punch & Enbody’s book does not mention dynamic programming, and does not seem to have any material on python’s module mechanism.