Note that there separate sets of assignments for CS 451/651 and CS 431/631. Make sure you work on the correct asssignments!

CS 431/631 Assignments

Assignment 0: Warmup due 2:30pm January 18

This assignment is a warmup exercise to get you familar with the some of the basic tools you will need for the remaining assignments. In particular, we will be making use of Python (for programming) and Jupyter notebooks.

The general setup is as follows: for each assignment, you will be provided with a "starter" notebook, which will describe what needs to be done for that assignment. You'll complete the assignment in the notebook, and then submit your notebook to the course staff for marking.

Python and Jupyter

All of the programming required for the assignments will be in Python. If you have never programmed in Python before, you will need to gradually bring yourself up to speed. There are many on-line resources that can help with this. A good place to start is python.org. In particular, you can start with their Python Tutorial. If you don't like that particular tutorial, there are many others to choose from. There are also many Python books to choose from, if you prefer to learn that way. Choose a book that fits your needs. For example, some books target people who are migrating to Python from other languages, while others are directed at novice programmers.

Most Python tutorials expect you to try out examples as you go along, i.e., they expect you to write and run Python code. This kind of active learing is definitely the way to go. The simplest way for you to run Python code is by using a Jupyter notebook running on the CS Jupyter hub (see below). This will allow you to run Python in a web browser, without having to install any software on your machine. If you wish, you can also install Python locally on your own machine. Python is freely available for a variety of platforms. Bear in mind that all assignments for CS431/631 will be done using notebooks, so it is not a bad idea to get used to them.

Jupyter Notebooks

For this course, you will be writing and running Python code in Jupyter notebooks. Each notebook consists of a sequence of cells. An cell can hold (formatted) text, Python code, or graphics. A great thing about notebooks is that you can open and run them in a web browser. This means that you can work on your own machine, using only a web browser, without having to install any additional software.

A Jupyter "hub" is a place to store and use Jupyter notebooks. For the CS431/631 assignments, you'll be using a hub operated by the School of Computer Science. To get started, go to jupyter.student.cs.uwaterloo.ca. Log in using your userid and password for the CS student computing environment (not your WatIAM password). Once you have logged in, you should see a list of folders and files - this is the contents of your home directory (folder) in the CS student computing environment. Unfortunately, the CS Jupyter hub is not yet ready for use. So, for Assignment 0, we will instead be using a similar hub run by Compute Canada. To get started, go to https://uwaterloo.syzygy.ca/, and log in using your WatIAM password. Once you are authenticated, click on the Start My Server button. It will take a few minutes for your server to launch. Once it does, you will see the contents of your home folder, which should be empty at this point. You can now proceed with the instructions below, just as you would on the CS hub.

It is a good idea to create a new folder to hold all of your work for this course, if you do not already have one. To this, use the New dropdown on the top right to create a new folder, and call the folder cs431 (or whatever name you prefer). Then, open your new folder by clicking on it.

Once you are in your cs431 folder, try creating a new Jupyter notebook. To create a notebook, use the New dropdown to create a new Python 3 notebook. You should see something that looks like this,

A New Jupyter Notebook
This represents a notebook with a single, empty cell. Before going any further with your notebook, try out the following three basic things that you will need to be able to do:
  1. First, change the name of your notebook by clicking on the current name ("Untitled"), and entering a new name, say, Test Notebook.
  2. Next, save your notebook using Save and Checkpoint from the File menu. Saving a notebook saves its current state, so that you can stop working at any time, and resume later from where you left off.
  3. Finally, stop your notebook by selecting Close and Halt from the File menu. This should take you back to your list of files and folders. You should see a new file called Test Notebook.ipynb, which is your saved notebook. By clicking on that notebook file, you can start your notebook running again from the point at which you last saved (try it!).
Once you've tried out these basics, start your test notebook and spend some time familiarizing yourself with the notebook interface. Take the User Interface Tour, which you can launch from the Help menu of a running notebook.

Assignment Workflow

The basic workflow for each assignment will be something like this:

  1. Download the starter notebook for the assignment, as well as any other required files, from the assignment web page to your computer.
  2. Use a web browser to log in to the CS Jupyter hub at jupyter.student.cs.uwaterloo.ca.Compute Canada hub at https://uwaterloo.syzygy.ca/
  3. Upload the starter notebook for the assignment, as well as any other required files, from your computer to the CS hub, into your cs431 folder.
  4. Launch the starter notebook that you just uploaded, and follow the instructions in the notebook to complete the assignment. Be sure to save your work.
  5. When you are finished with the assignment, download your notebook (the .ipynb file) from your cs431 folder on the hub to your computer, and submit it to the course staff by following the submission instructions.

Assignment 0

For the first assignment, you will do some simple analyses on the on the text of Shakespeare's plays. For this assignment, you will need to download three files to your local machine, and then upload them to the Jupyter hub. They are: Files with names that end in .ipynb are Python notebook files. When you work in a notebook and save your work, your work is saved in the .ipynb file. You'll submit your saved A0.ipynb file to the course staff when you are done with the assignment. That will allow us to open your notebook and review your work. After you have uploaded these files to the hub, open A0.ipynb to get started on the assignment. The notebook itself describes what we expect you to do.

Submitting Assignment 0

To submit A0, use the following steps:

  1. Download your A0.ipynb file from the Jupyter hub to your computer.
  2. Change the name of your file from A0.ipynb to A0-xxxxxxxx.ipynb, where xxxxxxxx is your UW student ID number.
  3. Send your A0-xxxxxxxx.ipynb file as an e-mail attachment to kmsalem@uwaterloo. Your e-mail message must be sent before the assignment deadline, and must have the subject line [cs431] A0-xxxxxxxx, where xxxxxxxx is your UW student ID number.

Back to top