MTH5001  Introduction to Computer Programming  2023/24
Topic outline

ASSESSMENT & MARKING CRITERIA
There will be two interm 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 higheryear 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.
Thomas 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 largescale simulations. At QMUL he has taught Python modules for several years, modules he also designed and created.
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 wellknown 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 oncampus IT labs for the module are supported by Ivelina Mladenova, Norberto LuceroAzuara, 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.


View all general news and announcements from the your module leaders.


There will be two interm tests (counting 10% each), in weeks 7 and 12, and a final project which counts 80% of the marks.
The interm 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.


We are very happy with the overall very positive feedback which implies that students who engage with the module are generally quite happy. Please note detailed responses to the text comments in the table below.
Full responses are now available in the analysis and responses options of the questionnaire itself.
Thomas and Lennart
Student Comments Our Responses a. What do you think the lecturers should start doing? be cooler be cooler vs stop not being cool vs being cool vs be cool  yes, we read it all I know the lecture notes are in Jupyter, but some of us cannot carry entire PCs to lectures. Could the lecture notes be uploaded as a pdf as well so we can open them on our tablets or phones?
it would be easier to follow you and take notes of your explanations.Jupyter notebooks can be transformed to pdfs using print to file from browser. There are also apps available on Android and iOS to read Jupyter notebooks (e.g. Carnets on iOS, ipynb viewer on Android) Professor Thomas just needs to pick up the pace a little.
I also feel like the lecture notes in general need more difficult examples for the things we're learning because we learn simple things but then the IT lab work is so much more complicated.Regarding pace, the overall feedback was that most students are happy with it. Some (like you) asked to go faster, others (see below) to go slower. Unfortunately, it will be impossible to get the balance right for everyone.
The lab is difficult by design, we need you to encounter and overcome common misconceptions when coding  simply talking about these in lectures will not help.
Also note that there is a difference in how you as the students consume these contents. The lectures are designed such that you can follow the presentation in real time, hence overly complicated examples would make it much harder for you to keep up. For the lab sheets, by contrast, you can go through the material at your own pace and make sure you understand everything before you read on. Therefore, these cover more complicated examples. Remember that you can always ask for explanations in the lab sessions and learning cafe.Give more of a basic outline in the lectures and labs as for many students this is the first if not one of the first times encountering python and it would be helpful if things were explained more in detail and at a slower pace. For example I was not sure on the different types of modules other that 'math' and was stuck on modules such as 'numpy' and 'matplotlib' and some concepts were gone through very fast. Regarding pace, the overall feedback was that most students are happy with it. Some (like you) asked to go slower, others (see above) to go faster. Unfortunately, it will be impossible to get the balance right for everyone.
Remember that you can always ask for extra explanations in the lab sessions and learning cafe if you get stuck on a problem or concept.They should have more practice for jupiter notebook and post more walkthroughs on how do to certain questions. We're happy to provide specific walkthroughs on request. Slower,
more examplesRegarding pace, the overall feedback was that most students are happy with it. Some (like you) asked to go slower, others (see above) to go faster. Unfortunately, it will be impossible to get the balance right for everyone.
Remember that you can always ask for extra explanations in the lab sessions and learning cafe if you get stuck on a problem or concept.
Regarding additional examples, did you try the extra exercises we provided on the QMPlus page (see "Module content by week")? We're happy to field questions on them, if the solutions are insufficient.Talking about the lab work exercises a little more in lectures as I feel like there is too much of a discrepancy between lecture material and lab work. Please watch the lab walkthroughs (after attempting the labs)! They explain the expected solutions and common pitfalls in detail. In essence, these are bonus lectures on the lab material. Go slightly faster during easier topics and go over less examples (e.g. too many examples of lists and not enough for more comprehensive sections) Noted. We will continue to try and find a good balance, using as much time as needed to explain concepts, but not more. b. What do you think the lecturers should stop doing? I'm finding that the labs are significantly harder than the lectures, and usually have not much correlation, and am completely lost and overwhelmed in the labs. That is by design. Lab work is not just filling in the blanks in modified sample problems from the lectures.
Note that there is a difference in how you as the students consume these contents. The lectures are designed such that you can follow the presentation in real time, hence overly complicated examples would make it much harder for you to keep up. For the lab sheets, by contrast, you can go through the material at your own pace and make sure you understand everything before you read on. Therefore, these cover more complicated examples. Remember that you can always ask for explanations in the lab sessions and learning cafe.Going through the content quickly would be greatly appreciated quickly vs slower  it's impossible to get this perfectly right for almost 400 students Professor Thomas needs to sidetrack/go on tangents less. noted. stop not being cool be cooler vs stop not being cool vs being cool vs be cool  yes, we read it all N/a Thanks, we guess… c. What do you think the lecturers should continue doing? Countinue teaching pace and explanations being cool Presenting clearly with good readability of lecture notes and labs etc.
Also having others in lab sessions helping out is very beneficial.Whatever Dr Lennart does, because I can understand him very well and his pace is perfect. Dr Lennart doesn't need to change at all. Thank you! If you could, then how would you improve the module? read out loud a code and its shorthand, e.g. a tuple is (explanation) this in basic just means (clear explanation with a nice example shown). As above Have more teachers in the IT labs, or have a smaller amount of students in IT labs, as it takes a long time for the teachers to come round to you Some labs are very empty  we shifted helpers around to even the load. If you want more support, come to the 911 time slots on Wednesdays or Thursdays! One query for me is that computing requires a device like a laptop/computer etc however I am not sure whether taking notes will be beneficial to me or whether to practice Python via quizzes and IT labs, so advice on this would be greatly appreciated! This depends on your learning style  we suggest you come to the Learning Café to discuss this. Make the lectures include a bit more content that the lab work has so we can see live examples of the more complex lab work. It really is beneficial to do the lab work first  please watch the lab walkthroughs afterwards. As explained above, the different complexity of examples in lectures and labs is by design and aligned with how you are expected to consume the material. be cool be cooler vs stop not being cool vs being cool vs be cool  yes, we read it all I would add lecture notes as a pdf as well You can easily create them yourself or download browser extensions (Chrome) or apps (iOS/Android) to view Jupyter Notebooks. In fact, we want to encourage you to explore and play around with the notes and lab sheets as much as possible. Therefore, they are designed for you to interact with them, not to just read them! More difficult examples in the lecture notes so that the IT labs feel more intuitive/easier to know what it is the work is asking us to do. It's hard to get the balance right  explaining things in more detail and adding more difficult examples cannot really be done at the same time. Remember that you can always ask for extra explanations in the lab sessions and learning cafe if you get stuck on a problem or concept.


Your week 7 midterm 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).

Your week 7 midterm 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).

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 TBA, the project will be available to download below. Click on the "FINAL PROJECT" assignment and download the file "Project_2024.ipynb". Note that, in addition to the Jupyter notebook, there may also be separate files which you will need to download to the same location.
The project is due at TBA.
Your lecturers will respond to projectrelated 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.

FINAL PROJECT Assignment


The programming language used for this module is Python, via the webbased 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 26: Programming fundamentals (data types, variables, functions, conditional statements, loops).
 Week 7: First interm test.
 Weeks 811: Further programming, and mathematical & data analysis applications.
 Week 12: Second interm test.

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), builtin 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

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

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:

What's covered in this week?
 More on sequences: slicing
 Generators
 Plotting
 Builtin 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:

What's covered in this week?
 Userdefined functions
 Functions as variables
 Lambda functions
 Creating Modules with userdefined 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:

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:

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:

FIRST INTERM 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 interm 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:

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:



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 



Download and hand in your Jupyter Notebook file. These do not contribute to your grade, but will be used to monitor your engagement with the module in accordance with the School's Student Engagement Policy.

Download and hand in your Jupyter Notebook file. These do not contribute to your grade, but will be used to monitor your engagement with the module in accordance with the School's Student Engagement Policy.

Download and hand in your Jupyter Notebook file. These do not contribute to your grade, but will be used to monitor your engagement with the module in accordance with the School's Student Engagement Policy.

Download and hand in your Jupyter Notebook file. These do not contribute to your grade, but will be used to monitor your engagement with the module in accordance with the School's Student Engagement Policy.

Download and hand in your Jupyter Notebook file. These do not contribute to your grade, but will be used to monitor your engagement with the module in accordance with the School's Student Engagement Policy.

Download and hand in your Jupyter Notebook file. These do not contribute to your grade, but will be used to monitor your engagement with the module in accordance with the School's Student Engagement Policy.

Download and hand in your Jupyter Notebook file. These do not contribute to your grade, but will be used to monitor your engagement with the module in accordance with the School's Student Engagement Policy.
