UQ MATH2504 Programming of Simulation, Analysis, and Learning (Data) Systems (Semester 2 2024)
This course is designed to build understanding of programming, software architecture, and general software development in the context of mathematical, statistical, and data analysis applications. Students learn the basic elements of software development in the context of mathematics and data-science. The course teaches students how to implement algorithms from numerical mathematics, computer algebra systems, simulation, and data analysis. In any case, the work is done using solid software development practices that allow for organized maintainable and extendable software.
This is the 4-th offering of this course. You may also see previous years: 2023, 2022, 2021. Note that in previous years there was also a unit associated with machine learning, yet from this year this unit is removed to allow more time for programming basics at the start of the course (this also means that numbering of units has changed in comparison to previous years).
The course is aimed at students in their fourth semester (or above) of a mathematics degree. It assumes knowledge of calculus, linear algebra, elementary statistics, basic probability, and elementary concepts of discrete mathematics. It also assumes some prior experience in scientific/computational/statistical scripting, using languages such as R, MATLAB, Python, or similar. No specific detailed knowledge of such programming is assumed. However, it is assumed that students have seen code, variables, loops, conditionals, and similar constructs previously. Nevertheless, from this year onwards the first unit of the course provides a very gentle introduction to elementary computer programming ideas.
Students that have only scripted minimally or have hardly scripted at all prior to MATH2504 may consider preparing for the course prior to its start. One option for this is following material as in the SMP Programming Boot Camp. However, such preparation is only optional as the course provides plenty of support practicals to help students catch up.
The bulk of MATH2504 is taught by industry professionals, with this year's lecturers being Dr. Paul Bellette and Dr. Claire Foster. The course was also previously taught by industry professional Dr. Andy Ferris, whom is still involved with course construction. A part of the course is also taught by Dr. Paul Vrbik and supporting videos for algebra are by Dr. Sam Hambleton. The course coordinator is Associate Prof. Yoni Nazarathy (y.nazarathy@uq.edu.au). He is also an industry professional for 60% of his time (outside of the course and other UQ work). Two of the tutors are also industry professionals.
There are also guest perspective seminars by industry professionals. This year the speakers are Dr. Megan Dawson and Dr. Maithili Mehta.
The focus of the course is programming of systems that involve mathematics and mathematical modelling. This includes the interface of mathematical principles and a programming language as well as tooling and the experience of using solid basic practices that lead to organized and efficient code. It is not a course about a specific programming language. Nevertheless one language needs to be used and studied. The language for this course is the Julia language. Julia is a modern compiled programming language that in many ways is easy to work with, similarly to other scripting languages. However, Julia also allows one to create very efficient code. In general, the Julia language and the surrounding eco-system focuses on scientific computing and mathematics, and hence it is a good fit for this course.
The course content is broken into 8 study units and 5 items of assessment, details of which are described below.
The course is delivered via weekly lectures which include three hours per week. The lectures involve both live demonstrations and theory. There are also 2 (guest) one hour perspective seminars. These perspective seminars are aimed at presenting students with further insights about mathematicians and statisticians working with software in industry.
There are also weekly practicals of two types: standard practicals (PRA1) and support practicals (PRA2). Standard practicals cover core material associated with assessment at the base level of the course, while support practicals are a means to offer support to students dealing with more basic issues regarding assessments. It is recommended for all students to attend the standard practicals. For students that have less programming background or require extra help with assignments it is recommended to attend one or more of the support practicals. In any case, since practicals are two hours long, it is recommended to use the practical time to receive help from the tutors for assessment tasks.
Practicals are scheduled on most weeks including the first week. See the schedule below. The standard practicals involve both content delivery (see practical notebooks A-G), not-for-credit class exercises, and some time to work on assessment. The support practicals are merely a time for students to receive help from the tutors in reinforcing course material and basics.
The use of a variety of features of a programing language (Julia in this case).
Technical tools such as: Unix, git, IDEs, Jupyter.
Mathematical and statistical algorithmic concepts, their theoretical analysis, and implementation.
Solid software development practices - with a view towards employability.
The lectures, perspective lectures, practicals, and online tutor support all aim to help the students build up these pillars of study, with the 6 assessment items serving as goals.
Ideally, after completion of this course a student will have the ability to continue self study of software and programming concepts after getting a 'jump-start' via this course. The student would ideally be able to work independently on projects for more advanced third and fourth year courses, and/or produce efficient code as part of Honours or higher degree research. Importantly, the student would have tools for contributing to open sourced projects, startup-teams, and be hirable in analytic software focused jobs in industry.
Clearly a one semester course cannot transform a mathematician into a software engineer, however it is hoped that through the course content, students will be able to further themselves on such a path if needed.
Study Units
The course is composed of the following 8 study units. Each of the units feeds most of the pillars of study. The early units build up basic Julia, computer science, and tooling knowledge (mostly pillars 1 and 2), whereas the later units focus on deeper mathematical stories, mostly feeding pillars 3 and 4. Specifically with respect to pillar 3 (mathematical and statistical algorithmic concepts), there are four main concepts: numerical mathematics and ODEs (Unit 4), computer algebra systems (Unit 6), Monte Carlo and discrete event simulation (Unit 7), and data processing (Unit 8). Clearly some of these concepts are often taught (often at greater depth) in other specialized courses. However in this course, the focus is software implementation.
Here is detail of the content of each of the Units:
Unit 1- Hello World Bootcamp: Getting your basic programs to run. Variables, arithmetic, logical statements, conditionals, iteration, functions, scope.
Unit 2- Basics: Basics of computation, arrays and similar structures, strings, input and output, the Julia language, Jupyter notebooks, REPL (command line), and markdown.
Unit 3 - On Algorithms and more: Sorting algorithms and their analysis. Quantifying performance via empirical measurement. Quantifying performance via mathematical analysis. Compilation steps. Memory organization. Representation of variables and quantities in memory. Additional tools: Unix command line, Git and GitHub like systems, IDEs (Integrated Development Environments).
Unit 4 - On data files, and basic numerics: Standard file formats (e.g. CSV, JSON), reading and writing to files, web input, basic plotting with Julia, basic descriptive statistics and statistical plotting with Julia, representation of floating point numbers, numerical inaccuracy issue (e.g. numerical derivatives), solutions of ODEs using standard methods, basic matrix operations and performance considerations, usage of third party packages and the Julia package manager. Usage of language features for dealing with special structures (e.g. sparsity). Further profiling and debugging tools and the basic usage of a debugger.
Unit 6 - Computer algebra systems and symbolic computation: Background from elementary number theory, p-addic lifting, Chinese remainder techniques, rational reconstruction, polynomial arithmetic, interpolation, GCD and Euclid's algorithm, factoring mod p, Zipple's algorithm, further symbolic computation applications.
Unit 7 - Monte Carlo and discrete event simulation: Pseudorandom number generators, from uniform distributions to any distribution, basic Monte Carlo based statistical analysis, discrete event simulation modelling, discrete event simulation engines. Modular software design, with modules and namespace control. Additional language features including meta-programming and further understanding of the compilation process. More on type inference and performance implications.
Unit 8 - Working with heterogenous datasets: Dataframes and data and more on memory management. Exploratory data analysis and visualization. Further language features. More on design principles of packages and interfaces.
Assessment
These are the 5 assessment items. The first 4 are due during semester and worked on progressively during the course. The last item is due during the final exam period. The course does not have a final exam. BigHW and Project 2 are to be worked on in pairs (or groups of 3 in special cases). The other items are individual.
BigHW (20%): Jupyter and REPL, basic Julia functionality and small programs – analysis of sorting, using an IDE, using Unix, using GitHub, file input output, and numerical mathematics. (HW in pairs).
Quiz (20%): Covering basics of Julia, representation of numbers, analysis of sorting performance.
Project 1 (20%): Symbolic computation. This projects builds on existing code supplied to the students.
Project 2 (20%): Discrete event simulation (project in pairs). This project requires the students to structure files and code independently.
Project 3 (20%): Data Analysis (due during exam period).
The mark for the weakest of the projects will be replaced by the average of the other two projects. Further, UQ course grades are at the levels 7, 6, 5, etc. To obtain a grade of 6 or 7, a student must complete and pass all three projects. In addition, to obtain a grade of 7 a student must get 60% or above on the quiz. Note that from a UQ course profile perspective, Projects 1, 2, and 3 are considered as a "series".
Lecture Monday (2hrs): 5pm – 7pm, 01-E302, Forgan Smith Building (East Wing)
Lecture Tuesday (1hr): 6pm – 7pm, 01-E302, Forgan Smith Building (East Wing)
Standard practicals (PRA1) - choose one of:
Wed 10am - 11:50am (Cooper Janke), 69-ILC2
Wed 12pm - 1:50pm (Tina Moghaddam), 07-213
Wed 2pm - 3:50pm (Jack Litfin), 07-213
Wed 4pm - 5:50pm (Lief Lundmark), 07-213
Thu 4pm - 5:50pm (Zhihao Qiao), 07-213
Support practicals (PRA2) - only optional. Choose one of:
Thu 8am - 9:50am (Isaac Beh), 07-213
Thu 10am - 11:50am (Limao Chang), 07-213
Fri 4pm - 5:50pm (Brandon Lowe), 07-220
Consultation Hour:
Weekly via Zoom, Wed 7pm (up to 8pm)
Note that lectures are also streamed via Zoom.
Here is the schedule listing the lecturers, units of study, practical activity per week, and assessment. As an aid, also see the 2024 UQ Calendar.
Week
Monday Date
Monday 5pm
Monday 6pm
Tuesday 6pm
Standard Practical
Support Practical
Assessment Due (Friday)
Consultation Hour
1
Jul-22
Unit 1 (YN*)
Unit 1 (YN)
Unit 1 (YN)
A
✓
YN
2
Jul-29
Unit 1 (YN)
Seminar (MD)
Practice Quiz
B
✓
YN
3
Aug-5
Unit 2 (PB)
Unit 2 (PB)
Unit 2 (PB)
B
✓
PB, YN
4
Aug-12
Unit 2 (PB)
Unit 3 (PB)
Unit 3 (PB)
C
✓
PB, YN
5
Aug-19
Unit 3 (PB)
Unit 3 (PB)
Unit 4 (PB)
D
✓
PB, YN
6
Aug-26
Unit 4 (PB)
Unit 4 (PB)
Unit 5 (CF)
-
-
BigHW
PB, YN
7
Sep-2
Unit 5 (CF)
Unit 5 (CF)
Quiz
E
✓
CF, YN
8
Sep-9
Unit 6 (PV)
Unit 6 (PV)
Unit 6 (PV)
E
✓
PV, YN
9
Sep-16
Unit 6 (PV)
Unit 6 (PV)
Unit 6 (PV)
-
-
Project 1
PV, YN
Break
10
Sep-30
Unit 7 (CF)
Unit 7 (CF)
Unit 7 (CF)
F
✓
CF, YN
11
Oct-7
-
-
Unit 7 (CF)
F
✓
CF, YN
12
Oct-14
Unit 7 (CF)
Unit 8 (CF)
Seminar (MM)
-
-
Project 2
CF, YN
13
Oct-21
Unit 8 (CF)
Unit 8 (CF)
Unit 8 (CF)
G
✓
CF, YN
Exam period
Project 3 (Due Nov 14)
CF, YN (Oct 28, Nov 5, Nov 11)
* All four lecturers, PB, CF, PV, and YN are introduced in the first lecture.
Standard Practicals
There are 9 standard practicals (A-I) in total and this is a description of each practical.
Practical A - Installation and basics: Installation. Using Jupyter. Basic Julia code running in Jupyter. Basic Julia REPL. Basic simple programs with variables, conditional statements, and loops.
Practical B - More on basic tools and Julia essentials: Basic LaTeX formulas. Basic HTML in Jupyter. Variables, logical statements, conditional statements, loops, generic functions, scope, arrays, input/output, and a few more Julia essentials.
Students may choose to join support practicals (PRA2) in addition to the standard practicals. If scheduling allows students may even join more than one such practical. In the support practicals a tutor helps the students with individual questions related to the course material or assessments. These practicals also offer a place for working on the (non-quiz) assessments with an experienced tutor available.
Assessment Submission instructions
Here are some notes regarding hand-in:
Each assessment item is to be handed in with an experience voice recording. In the voice recording, the student(s) state how they felt working on the assessment, what they found easy, difficult, dull, or interesting, and importantly state (if true) that the work is their own.
The three projects (1-3) are to be handed in via GitHub (or GitLab). In these cases, the students are to create repositories for the submission. BigHW, is in a more laid out and pre-specified format.
The quiz is in simple pen-and paper format (scans/photos are handed in).
For the three projects (1-3), in addition to the GitHub (or GitLab), a single PDF file including printouts of all student source code should also be handed in. This is for easy annotation feedback of tutors.
Software Installation
It is recommended that you have the following on your machine:
A Unix style shell with Julia in your path. Note that such like shell is available by default for Linux or Mac users. For Windows users we recommended you install Windows Terminal or GitBASH.
This is the 2024 video that describes installation of Julia:
This is the slightly older video that describes installation of Julia and IJulia (see video above first):
With the software installed, please bring your laptop to practicals (and ideally to the lectures). In exceptional circumstances, where you plan to attend a face to face practical and cannot bring your laptop, you may install Julia and the associated software on the Windows desktop machines available in the practical classroom. This is a workable solution but is not ideal. The installation may take several minutes and it is not guaranteed that it will remain on the machine over time. Hence whenever possible, bring your laptop.
Additional Resources
Here are additional resources that may be of use for the course (or for introductory Julia programming in general). None of these are mandatory as there are plenty of examples in the lecture units and practicals. That is, it is recommended that you try running every bit of code from the lectures and practicals, investigate it, look at the Julia help to explore. Nevertheless, you may find some of these additional resources helpful as well:
The Julia Express: Provides a dense summary of language features. It may be a bit too dense for those that haven't programmed much before. Still, it is useful.
MATLAB–Python–Julia cheatsheet: This is useful for those coming with a bit of MATLAB or Python experience. It shows how things are done in Julia in comparison to the other two languages.
Think Julia: How to Think Like a Computer Scientist: This is an excellent introductory book for programming. If you haven't done any programming previously it is a good read. However for more experienced programmers it can be a bit too elementary; still useful.