Machine Problems
================================================================

.. toctree::
   :maxdepth: 1
   :caption: Machine Problems:
	     
   mp1
   mp2
   mp3
   mp4
   mp5
   mp6

MP Requirements
---------------------------

The laboratory component of ECE 401 consists of machine problems.  You
are welcome to do the lab assignments on your own, but if you wish,
you may find it useful to attend lab section.

Lab section will be Mondays, from 6:00-7:00pm, on zoom.

Lab sections will be recorded, and available on MediaSpace.

General MP Instructions
---------------------------

Each MP is distributed as a ZIP archive. In the ZIP archive, you will
find the following files:

* ``submitted.py`` - this is the only thing you will submit.  It
  contains several ``RuntimeError`` lines that you need to replace
  with working code.
  
* ``notebook.ipynb`` - this is provided to help you debug.  It
  doesn't need to work, but we hope that you will enjoy the MP more if
  you use this `Jupyter <https://jupyter.org/>`_ notebook to help you
  debug ``submitted.py``.  An example of how it should look, when
  everything works, will be linked from each MP's page.

* ``grade.py`` - this is the same code that the autograder runs.
  Before you submit to the autograder, please try running this on your
  own machine (``$ python grade.py``).  If it shows any errors, please
  fix them on your own machine before you try submitting to the
  autograder -- you will save a lot of time!  The autograder will run
  all of the same tests that are available to you, plus a few more
  hidden tests.

* ``solutions.hdf5`` - this file contains solutions to the visible
  tests (but not the hidden tests).  If you want to know why
  ``grade.py`` is giving you a bad score, please compare your solution
  to the solutions provided here.  You can read this file using the
  `H5Py for Python <https://docs.h5py.org/en/stable/quick.html>`_ package.

* ``requirements.txt`` lists the python packages that
  are used by the autograder.  You can install them by
  typing ``pip install -r requirements.txt``.

How to Submit
------------------

When you're ready to submit, go to Gradescope.

* Submit **only** the one file, ``submitted.py``.
  Any other files you submit will be ignored.

* You may submit as many times as you like.  By default, we willl
  count your last submission; if you want us to grade a submission
  other than your last one, please select it using the Gradescope user
  interface.

   
MP Grading Policy
-----------------------

Machine problems are graded by the autograder.

You are allowed to submit any MP late, with a penalty: your MP grade
will be multiplied by :math:`\max(0.5,1-t/20)`, where :math:`t` is the
lateness of your submission, in days (a real number).  For example, if
you're late by one day, you can earn 95% credit; if you're late by any
number of days greater than 10, you can still earn up to 50% credit.

.. warning:: Warnings about the late penalty

   * Gradescope does not show you the late penalty.  If you want to
     know what your score *really* is, you need to check Gradescope's
     ``lateness`` field, and calculate your  late penalty yourself.
     
   * The late penalty is not waived for illness, or for any other reason.
     The late penalty is mild on purpose, so that it is possible to recover
     from an illness and still submit the homework for most of the available points.