Skip to main content
  1. Teaching/

In the summer of 2022, I taught an introductory programming course for eight incredible students on a program from the Saudi Basic Industries Corporation. This course closely mirrored the contents of the department’s introductory programming elements course, CS 303E, although it is not an official version focourse.

The course was primarily managed and run through Canvas. However, since I believe in making course materials available, I’ve posted the lectures and assignments here. Because these are recovered from Canvas/Slides, the formatting may be slightly off.

I would like to thank Mike Scott for letting me use his slides + template materials, and Bill Young for providing inspiration for several of the assignments.

Course Syllabus

Lecture Slides
#

Assignments
#

0001

·6 mins

Introduction

Welcome to Intro to Programming! This will be a short, fast-paced introduction to programming in Python with a slight focus on numerical applications. The topics covered will be similar to that of a standard introductory course: conditionals, loops, lists, object-oriented programming, recursion, and overviews of Python's other library types.

·4 mins

You will prepare a short final project for this class. This is a chance for you to practice applying your Python programming skills to a real world application, and to learn a little more about programming in a specific field.

·4 mins

Minesweeper Counter

Minesweeper is a popular single-player puzzle game. It is played on a 2D grid. When the player clicks on a square, it is revealed, and one of three possible outcomes occurs:

·7 mins

Ciphers

For almost as long as humans have had writing, we have had ways of trying to conceal what we write. The oldest known cryptographic systems are from 1900 BCE, almost 4000 years ago.

·3 mins

Credit Card Validation

When you enter a credit card number on most online websites, they can instantly tell whether the number is valid or not. How do they do this?

·4 mins

Storing and Reading Data

In the last assignment, you created a simple 1D trajectory of a particle undergoing 1D diffusion. Sometimes, we may want to store the results for later analysis--for example, maybe we want to calculate lots of different statistics (mean distance from zero, mean squared distance from zero, how far it travels in a certain period, etc.), but we don't know which yet.

·4 mins

1D Diffusion Simulator

Diffusion is one of the fundamental chemical processes which cause molecules to move. It is crucial to many (if not all) biological and chemical processes.

How fast a molecule travels depends on two things: how fast the molecule diffuses, and any biasing force that might be applied to it. If we think about this in terms of real gases, the diffusion speed is dependent on how heavy the molecules are (e.g. helium diffuses faster than sulfur hexafluoride), and the biasing force corresponds to things like wind or air movement that might carry the molecules along with them.

·3 mins

Minimax

Write a program which accepts an arbitrary number of integers as input from the user and prints the minimum and maximum of numbers entered. The user will stop the input loop by typing in the string "stop". Once the user enters "stop", you'll print the minimum and maximum of the numbers entered. See the examples below for an example of how the program should work.

·3 mins

DNA Library Part 2

The DNA library we made last time had a few disadvantages. In this assignment, we will hopefully fix some of them, as well as add some additional features.

·3 mins

DNA Library

DNA is the chemical which encodes genetic information for all life on Earth. It consists of four bases: Adenine, Cytosine, Guanine, and Thymine, in a linear structure.

Interestingly, when doing computations, we often prefer to treat DNA as strings, because of its structural similarity to strings in computer science. We treat each base as a letter (A, C, G, T), which allows us to use functions meant for strings to manipulate DNA sequences.

·6 mins

Solving the Heat Equation

Take a metal bar which is hot at one end (suppose it was dipped in boiling water for a few seconds). What happens to it next? The heat moves down the bar--the hot end gets cooler and the cold end gets warmer--until the entire bar is a uniform temperature. Finally, after a long time, the entire bar will cool down to the same temperature as its surroundings.

·3 mins

Tower Drawing

Your task for this assignment is to write a program that prints a tower. For example, here is what an output of the UT Tower might look like (note that this output does not follow the rules, so you cannot use it for your assignment!):