Making Change (memoization and DP), Part 1

Here’s Part 1 of our Making Change worksheet.

Deterministic Select, Live!

We don’t code a lot in CPSC 320, and that’s intentional. You have lots of coding classes in CPSC. Reasoning about problems, writing about them on paper or whiteboards, designing and analyzing solutions: these are all incredibly important skills to be a successful Computer Scientist, no matter what work you take on.

However, now and then, it’s fun to code. Especially when an algorithm is so completely bizarre that it’s hard to believe it works without trying it.

Enter Deterministic Select.

We’ll do our best to code this rather intricate algorithm live, after working through the ideas that lead up to it. It could even work!

If you’d like to follow along, try opening https://ubc.syzygy.ca. You can then download our blank DSelect Jupyter Notebook to your computer, start your Syzygy server, and use the “Upload” button to upload the notebook onto syzygy. Use the “play”, “up”, and “down” buttons on syzygy to run code and navigate among the cells.

You can also see blank copies in plain python, PDF, or HTML.

Readings to finish for the week of Oct 22-Oct 28

Our upcoming readings for this week are: Sections 5.3 and 5.4.

Assignment #3

Here is Assignment #3, composed of the collected tutorial quizzes, solutions to those quizzes, and some extra questions building on the quizzes for the assignment. (Here is LaTeX source, with a .txt extension so the blog lets us post it!)

Quick reminder on one question: a wBST is a BST. So, it has the search tree property. That should be important if you want to do operations that depend on the order of keys in the structure.

The assignment is due on Fri 27 Oct at 10PM. (Which is actually almost as spooky as the last due date on Fri the 13th, what with Halloween coming up.)

Please submit it on GradeScope.

Protected: Assignment #2 Sample Solution

This content is password protected. To view it please enter your password below:

Tug-o-War (Divide and Conquer) Worksheet

Here’s our worksheet on tug-o-war and divide-and-conquer algorithms.

Readings to finish for the week of Oct 15-Oct 21

Our upcoming readings for this week are: Sections 5.1 and 5.2 plus Wikipedia’s page on the Master Theorem, which put the more narrative description in 5.1 and 5.2 into a formulaic context.

Clustering Completed Sample Solutions

Here are sample solutions to the Clustering Completed worksheet.

First clustering worksheet sample solution

Here’s a sample solution to the first clustering worksheet.

 

Clustering Completed Worksheet

We’ve designed our clustering algorithm. Now, we need to prove it really works. Let’s finish working through clustering.

UPDATE: We replaced the last two problems of the worksheet. Here is the updated version of the clustering completed worksheet.