Homework Policy

Keep Practicing!

There will be a total of eleven homework assignments in CS 307. Homework assignments are administered through PrairieLearn. These homework assignments will serve as practice for the exams.

To access CS 307’s PrairieLearn content, simply navigate to prairielearn.org and add the course.

Question Types

Questions on homework assignments will take one of four possible forms:

  • Checkbox questions will present a series of statements and students will be asked to check a box for each “correct” statement. These questions generally attempt to assess conceptual understanding.

  • Numeric questions will ask students to input one or more numeric quantities.1 These questions generally attempt to assess mathematical understanding.

  • Code questions will ask students to submit Python code to be graded. These questions generally attempt to assess algorithmic understanding.

  • Model Fitting questions will ask students to submit a learned model for grading. These questions generally attempt to assess applied understanding.

Grading and Deadlines

Homework assignments in CS 307 are low-stakes, unlimited attempt assessments. There is no penalty for submitting incorrect answers. When making a submission, your score can only go up, never down.

Timeout

All questions on homework assignments will have a one minute timeout between possible submissions. This timeout serves a number of purposes. For checkbox questions, it should deter you from simply attempting to brute force a solution. For numeric questions it should encourage you to check your work before submission. For code questions, it should encourage to test your functions yourself before submitting. For model fitting questions, it should encourage you to do your own validation before submit.

The timeout exists to encourage good habits. Said another way, the timeout exists to prevent you from developing bad habits.

Partial Credit

Partial credit is available for most questions.

  • For partial credit on checkbox style questions, each individual checkbox provides \(1 / n\) points where there are \(n\) checkboxes total for the question. For each checkbox, you obtain \(1 / n\) points if you check the box correctly, or if you leave the box unchecked correctly.

  • For numeric questions that require multiple inputs, partial credit is based mostly on which inputs you supply correctly.

  • For code questions, submitted code will be checked against several distinct test cases, each providing some amount of credit.

  • For model fitting questions, submitted models will be compared to thresholds for various metrics and partial credit will be aware based on some function of distance from stated threshold.

Python

You are allowed and expected to use Python to solve many homework problems.

Rounding and Precision

Do not round any calculations. When submitting answers to numeric questions, copy-paste all digits reported by Python. Do not attempt to change the default number of digits that Python displays. If for some reason you feel that you have the correct answer, but it is not being accepted by the autograder due to a precision issue, please alert the course staff. Again, do not modify the number of digits that Python displays.

When Python prints a number, it is often only showing you some of the precision that it has stored.

import numpy as np
print(np.pi)
3.141592653589793

Obviously, we know that \(\pi\) has many more digits than this. Are these all the digits Python uses when you use np.pi for a calculation? Nope! These are the digits that Python displays by default, many more digits are in some sense stored.2

print(f"{np.pi:.25f}")
3.1415926535897931159979635

Note that, because of this, you should never copy-paste Python output then re-paste it into a script. Doing so will cause you to accidentally lose precision!

As an aside, working with numbers in computers is, difficult.

0.1 + 0.2 == 0.3
False
0.1 + 0.2
0.30000000000000004

The above results are unfortunate, but not surprising. They are simply a consequence of floating point arithmetic. For more information:

As student in CS 307, this is not something you actually need to worry about, as long as you never round any calculation.3

VSCode Workspaces

You may complete homework assignments by using Python however you like. Mostly, we recommend VSCode on your own machine and the setup that we have described in the Computing Policy document.

However, because exams will be completed in the CBTF, you will only have access to VSCode, and Jupyter notebooks, through PrairieLearn to complete your exams. Thus, it would be a good idea to practice using VSCode through PrairieLearn for some of your homework assignments.

The first question of each homework will provide access to a VSCode workspace. Within the workspace, you will be given a Jupyter Notebook named homework-xx.ipynb in the left panel. This notebook will contain any definitions, formulas, etc, that you are not expected to memorize. Use this notebook for any Python coding needed to complete checkbox, numeric, or code questions.

As you practice using VSCode through PrairieLearn, please pay close attention to the available keyboard shortcuts. For docstring access, use ?. For example, place ?np.mean in a cell of a notebook and run that cell.

Model fitting questions will have a workspace specific to those questions.

Footnotes

  1. See the note below about rounding answers. TLDR: Never round anything.↩︎

  2. Interestingly, for many applications, only a few digits of \(\pi\) will get the job done!↩︎

  3. But it does serve as a reminder to Dave that he needs to use np.allclose instead of np.array_equal to make comparisons in the autograder.↩︎