Topic outline

  • General Information

    ASSESSMENT & MARKING CRITERIA

    There will be two in-term tests: one in week 7 and one in week 12, each of them counting 10% towards your final mark, and a final project which counts 80%.. More information under the assessment tab.

    FEEDBACK

    Your feedback comes in many forms:

    • Weekly Quizzes with specific feedback
    • Weekly lab sheets
    • Additional list of exercises (with solutions in due time) for you to practice
    • Availability to ask questions during or after lectures
    • Participation in IT Labs throughout the week - these provide you with a unique opportunity to work with other students and explore ideas from the module in further depth. Labs are also a more relaxed environment for you to get advice and guidance for your course from academic members of staff, who will provide helpful comments. One of these labs will be online.
    • Personalised feedback during office hours - Office hours are also an opportunity for you to get 1 on 1 help for any additional support you may need. You can also contact the lecturer by email with any queries you might have.
    • Any other types of feedback specific to the module
    • PASS (Peer Assisted Study Support) – get help and feedback from higher-year students (mentors) in a friendly, informal environment.

    Feedback is not just written comments on a piece of work. Please make sure that you actively engage with all these feedback opportunities, as they are there to help you learn and gain confidence in tackling unfamiliar problems!

    MEET YOUR LECTURERS

    Your lecturers for the module are Prof. Thomas Prellberg and Dr. Lennart Dabelow.

    TPThomas is Professor of Mathematics at QMUL, and a member of the Dynamical Systems & Statistical Physics research group. His research interests span several areas of mathematics and theoretical physics, including combinatorics, statistical physics, and the mathematical and computational modelling of polymers, where he has published over 120 papers. Throughout his academic career he has used extensively computer programming for computer simulations, designing and implementing algorithms for large-scale simulations. At QMUL he has taught Python modules for several years, modules he also designed and created.


    ML

     Lennart is a Lecturer in Applied Mathematics. A central goal of his research is to understand the emergence of macroscopic regularity from microscopic complexity: Starting from well-known and experimentally established laws for the microscopic degrees of freedom, he aims at deriving effective descriptions for the macroscopically observable behavior of systems with a large number of constituents. He uses Python, among other programming languages, for numerical experiments and explorations of these systems as well as for analyzing the resulting data.
     
    The on-campus IT labs for the module are supported by Ivelina Mladenova, Norberto Lucero-Azuara, Adam Onus, Marta Niedostatek, Sam Brady, and Yuhan Li.

     

    READING LIST

    The lecture notes and lab materials will define the content of the module, but if you would like some additional reading material, then you can find additional literature and exercises in the reading list tab.

  • Announcements

  • Assessment Information

    There will be two in-term tests (counting 10% each), in weeks 7 and 12, and a final project which counts 80% of the marks.


    The in-term tests will have a quiz format. You will be able to practice quizzes every week. 

     


    Weekly quizzes are an excellent way of checking if you master the minimum (and a way to practice for the tests), but the bulk of the learning will take place while you practice your coding skills (lab and additional exercises).

    For the final project you will need to upload a Jupyter Notebook which addresses an extended programming question. The project will basically assess your coding skills.

     

    Below you can find:

    • In weeks 7 and 12 we will upload the tests which will count 10% each towards your final mark. Concrete information on this will be provided in due time.
    • Additional information on the final project.

     

  • Module Evaluation

  • Early feedback questionnaire

  • In Term Assessment (Week 7)

    Your week 7 mid-term test will take place over a 24h period, starting on Monday, March 4, 9am and ending on Tuesday, March 5, 9am. 

    Once you start the test, you will have two hours to complete it or until the 24h period ends, whatever happens earlier.

    While the test might be substantially shorter to complete, please assume that you will need about 2 hours from the moment you start to the moment you submit it.

    The test covers all material in lectures and tutorials from week 1 to week 6.

    The test is open book. This means:

    • You may access any printed and online resources, however,
    • You may not communicate, nor attempt to communicate, with anyone else, nor solicit assistance in any way (e.g. via email, Facebook, WhatsApp, Chegg, Stackexchange, etc.).

    The test itself will be in the format of a QMPlus quiz (just like the weekly quizzes).

  • In Term Assessment (Week 12)

    Your week 7 mid-term test will take place over a 24h period, starting on Monday, April 8, 9am and ending on Tuesday, April 9, 9am. 

    Once you start the test, you will have two hours to complete it or until the 24h period ends, whatever happens earlier.

    While the test might be substantially shorter to complete, please assume that you will need about 2 hours from the moment you start to the moment you submit it.

    The test covers all material in lectures and tutorials from week 1 to week 11.

    The test is open book. This means:

    • You may access any printed and online resources, however,
    • You may not communicate, nor attempt to communicate, with anyone else, nor solicit assistance in any way (e.g. via email, Facebook, WhatsApp, Chegg, Stackexchange, etc.).

    The test itself will be in the format of a QMPlus quiz (just like the weekly quizzes).

  • Final Project

    Format of the final project

    Your main assessment in this module takes the form of a project/report, worth 80% of your final mark.

    Note: this is also the synoptic assessment for any resit students, with identical deadlines.

    From April 1, the project will be available to download below. Click on the "FINAL PROJECT" assignment and download the file "Project-2023-24.ipynb". Note that, in addition to the Jupyter notebook, there is one additional file "project.py" which you will need to download and save to the same location as the Jupyter notebook.

    The project is due 11:59pm on Saturday, May 4.

    Your lecturers will respond to project-related emails until 5:00pm on May 2, only. It is strongly recommended that you start your project as soon as possible, and have it finished by this time, leaving the final two days for final proofreading/checking/submission only.

    Full instructions are provided in the project Jupyter notebook.

    Good luck!

    Note: you will need to be logged in to QMPlus in order to access the project.

    • Here we will list answers to questions received via email or chat if they are likely to be of general interest. The first few questions are standard ones we receive every year, to check about questions specific for this year's project, please scroll down.

  • Syllabus

    Highlighted

    The programming language used for this module is Python, via the web-based Jupyter Notebook application. Please see the week 1 exercise sheet for information on how to access Jupyter Notebook on college computers and/or install it on your personal computer. 

    The content of the module is (roughly) as follows; more details are given in the week 1 lecture notes:

    • Week 1: Introduction to Jupyter Notebook and Python.
    • Weeks 2-6: Programming fundamentals (data types, variables, functions, conditional statements, loops).
    • Week 7: First in-term test.
    • Weeks 8-11: Further programming, and mathematical & data analysis applications.
    • Week 12: Second in-term test.

  • Learning outcomes

    This is a first introduction to computer programming. Learning outcomes include:

    • Understand the logic of computer programming
    • Be able to read and implement basic codes in Python 
    • Master the basic elements of the programming language Python as well as its applications for scientific computing, including: different data variables and data structures, logic (if statements), iterative structures (loops), built-in functions as well as standard Python packages.
    • Be able to code basic mathematical algorithms in. Python
    • Be able to use the programming language Python in simple data analysis problems
    • Gain independence to use Python in future projects

  • Week 1

    What's covered in this week?

    • Introduction to the module
    • Jupyter Notebooks
    • Using Python as a calculator
    • Using Python to plot graphs

    Activities for this week:

    • Familiarise yourself with how to start Jupyter Notebook
    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework download and submission for this week are available here
    • Set of additional exercises for practice: here
    • This week's quiz (available at the end of the week): here
    • This week's lab session walkthrough (available after the labs): here

    Optional:

    • See below for some help with AppsAnywhere
  • Week 2

    What's covered in this week?

    • examples for modules
    • input/output basics
    • sequences: lists, tuples, ranges
    • mutable and immutable types
    • list comprehensions

    Activities for this week:

    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • Set of additional exercises for practice: here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • Week 3

    What's covered in this week?

    • More on sequences: slicing
    • Generators
    • Plotting
    • Built-in functions

    Activities for this week:

    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week
    • Please fill in the anonymous early feedback questionnaire from February 6

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • Set of additional exercises for practice: here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • Week 4

    What's covered in this week?

    • User-defined functions
    • Functions as variables
    • Lambda functions
    • Creating Modules with user-defined functions

    Activities for this week:

    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week
    • Please remember to fill in the anonymous early feedback questionnaire by February 13

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • Set of additional exercises for practice: here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • Week 5

    What's covered in this week?

    • Boolean type
    • Boolean operators
    • conditional statements (IF)
    • recursive functions

    Activities for this week:

    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • Set of additional exercises for practice: here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • Week 6

    What's covered in this week?

    • For loops
    • While loops
    • Application: evaluation of (infinite) sums
    • Infinite loops

    Activities for this week:

    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • Set of additional exercises for practice: here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • WEEK 7: FIRST IN-TERM TEST

    FIRST IN-TERM ASSESSMENT

    • Details for the test on MONDAY see here

    What's covered in this week?

    • Application: Root finding algorithms
    • Algorithm development: bijection method for root finding
    • Secant method and Newton method

    Activities for this week:

    • Do the in-term assessment
    • Attend the Lectures on Tuesday
    • Do the Coursework and attend one of the IT labs (depending on your schedule, this will be either in week 7 or 8)

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
  • Week 8

    What's covered in this week?

    • Application: Root finding algorithms
    • Speed of Convergence
    • Complex Newton Iteration
    • Copying composite data
    • Strings

    Activities for this week:

    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs (depending on your schedule, this will be either in week 7 or 8)
    • Do the Quiz at the end of the week

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • Week 9

    What's covered in this week?

    • File input/output
    • Introduction to Pandas
    • Pandas showcase: atmospheric carbondioxide
    • Pandas application: currency exchange rates 

    Activities for this week:

    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week

    Content for this week:

    • Lectures can be accessed here.
    • Notes for this week are available here. Note that you also need to download the file "UKcountries.csv", provided in the same place. 
    • Coursework Coursework and submission for this week are available here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • Week 10

    What's covered in this week?

    • Statistical Plotting with  Matplotlib and Seaborn
    • Application: Currency exchange scatterplots

    Activities for this week:

    • Attend the Lectures on Tuesday (no lecture on Good Friday!)
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • Week 11

    What's covered in this week?

    • Arrays and Matrices
    • Linear Algebra with scipy.linalg
    • Application: eigenvalues of large matrices

    Activities for this week:

    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs
    • Do the Quiz at the end of the week

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • This week's quiz: here
    • This week's lab session walkthrough: here
  • Week 12: SECOND IN-TERM TEST

    SECOND IN-TERM ASSESSMENT

    • Details for the test om MONDAY see here

    What's covered in this week?

    • Python vs C - indentation and one statement per line vs using brackets and delimiters
    • inline if (or ternary conditional operator), and filtering using if in list comprehensions
    • unpacking and the * operator, Python function arguments *args etc
    • complexity analysis of algorithms - preparation for project!

    Activities for this week:

    • Do the in-term assessment
    • Attend the Lectures on Tuesday and Friday
    • Do the Coursework and attend one of the IT labs

    Content for this week:

    • Lectures can be accessed here
    • Notes for this week are available here
    • Coursework Coursework and submission for this week are available here
    • This week's lab session walkthrough: here

     

  • Appsanywhere help

  • Reading list online

  • Additional Exercises

    • Contains...

      Exercise 1: Mailing Address 
      Exercise 2: Hello 
      Exercise 3: Area of a Room 
      Exercise 4: Area of a Field 
      Exercise 5: Bottle Deposits 
      Exercise 6: Tax and Tip 
      Exercise 7: Sum of the First n  Positive Integers 
      Exercise 8: Widgets and Gizmos 
      Exercise 9: Compound Interest
      Exercise 10: Arithmetic
      Exercise 11: Fuel Efficiency 
      Exercise 12: Distance Between Two Points on Earth 
      Exercise 13: Making Change 
      Exercise 14: Height Units 
      Exercise 15: Distance Units 
      Exercise 16: Area and Volume
      Exercise 17: Heat Capacity 
      Exercise 18: Volume of a Cylinder
      Exercise 19: Free Fall
      Exercise 20: Ideal Gas Law
      Exercise 21: Area of a Triangle 
      Exercise 22: Area of a Triangle (Again) 
      Exercise 23: Area of a Regular Polygon 
      Exercise 24: Units of Time
      Exercise 25: Units of Time (Again) 
      Exercise 26: Current Time
      Exercise 27: Body Mass Index
      Exercise 28: Wind Chill 
      Exercise 29: Celsius to Fahrenheit and Kelvin 
      Exercise 30: Units of Pressure 
      Exercise 31: Sum of the Digits in an Integer
      Exercise 32: Sort 3 Integers 
      Exercise 33: Day Old Bread 


    • Contains...

      Exercise 34: Even or Odd? 
      Exercise 35: Dog Years
      Exercise 36: Vowel or Consonant
      Exercise 37: Name that Shape 
      Exercise 38: Month Name to Number of Days
      Exercise 39: Sound Levels 
      Exercise 40: Name that Triangle
      Exercise 41: Note To Frequency 
      Exercise 42: Frequency To Note 
      Exercise 43: Faces on Money 
      Exercise 44: Date to Holiday Name 
      Exercise 45: What Color is that Square? 
      Exercise 46: Season from Month and Day
      Exercise 47: Birth Date to Astrological Sign 
      Exercise 48: Chinese Zodiac 
      Exercise 49: Richter Scale 
      Exercise 50: Roots of a Quadratic Function 
      Exercise 51: Letter Grade to Grade Points 
      Exercise 52: Grade Points to Letter Grade 
      Exercise 53: Assessing Employees 
      Exercise 54: Wavelengths of Visible Light 
      Exercise 55: Frequency to Name 
      Exercise 56: Cell Phone Bill 
      Exercise 57: Is it a Leap Year? 
      Exercise 58: Next Day 
      Exercise 59: Is a License Plate Valid?
      Exercise 60: Roulette Payouts 


    • Contains...

      Exercise 61: Average 
      Exercise 62: Discount Table 
      Exercise 63: Temperature Conversion Table 
      Exercise 64: No More Pennies 
      Exercise 65: Compute the Perimeter of a Polygon 
      Exercise 66: Compute a Grade Point Average
      Exercise 67: Admission Price
      Exercise 68: Parity Bits
      Exercise 69: Approximate  
      Exercise 70: Caesar Cipher
      Exercise 71: Square Root
      Exercise 72: Is a String a Palindrome? 
      Exercise 73: Multiple Word Palindromes
      Exercise 74: Multiplication Table 
      Exercise 75: Greatest Common Divisor 
      Exercise 76: Prime Factors 
      Exercise 77: Binary to Decimal 
      Exercise 78: Decimal to Binary 
      Exercise 79: Maximum Integer 
      Exercise 80: Coin Flip Simulation 


    • Contains...

      Exercise 81: Compute the Hypotenuse 
      Exercise 82: Taxi Fare 
      Exercise 83: Shipping Calculator 
      Exercise 84: Median of Three Values 
      Exercise 85: Convert an Integer to its Ordinal Number 
      Exercise 86: The Twelve Days of Christmas 
      Exercise 87: Center a String in the Terminal 
      Exercise 88: Is it a Valid Triangle? 
      Exercise 89: Capitalize It 
      Exercise 90: Does a String Represent an Integer? 
      Exercise 91: Operator Precedence
      Exercise 92: Is a Number Prime?
      Exercise 93: Next Prime 
      Exercise 94: Random Password 
      Exercise 95: Random License Plate 
      Exercise 96: Check a Password 
      Exercise 97: Random Good Password
      Exercise 98: Hexadecimal and Decimal Digits 
      Exercise 99: Arbitrary Base Conversions
      Exercise 100: Days in a Month 
      Exercise 101: Reduce a Fraction to Lowest Terms 
      Exercise 102: Reduce Measures 
      Exercise 103: Magic Dates 


    • Contains...

      Exercise 104: Sorted Order
      Exercise 105: Reverse Order 
      Exercise 106: Remove Outliers
      Exercise 107: Avoiding Duplicates 
      Exercise 108: Negatives, Zeros and Positives 
      Exercise 109: List of Proper Divisors 
      Exercise 110: Perfect Numbers 
      Exercise 111: Only the Words 
      Exercise 112: Below and Above Average
      Exercise 113: Formatting a List 
      Exercise 114: Random Lottery Numbers 
      Exercise 115: Pig Latin 
      Exercise 116: Pig Latin Improved 
      Exercise 117: Line of Best Fit 
      Exercise 118: Shuffl ing a Deck of Cards
      Exercise 119: Dealing Hands of Cards 
      Exercise 120: Is a List already in Sorted Order?
      Exercise 121: Count the Elements 
      Exercise 122: Tokenizing a String 
      Exercise 123: Infix to Postfix
      Exercise 124: Evaluate Postfix 
      Exercise 125: Does a List contain a Sublist? 
      Exercise 126: Generate All Sublists of a List 
      Exercise 127: The Sieve of Eratosthenes 


  • Lecture notes and recordings

  • Labs

  • Lab Walkthroughs

  • Weekly Quizzes