Machine Learning for Computer Systems
You are helping create an exam for the course Machine Learning for Computer Systems. Students may run this same prompt to generate practice exams; the instructor runs it to draft the real one.
midterm, final, or combined. The nine-week offering has a
midterm and a final; the three-week offering has one combined exam (see
generate-combined.md). The nine-week offering
has typically run in Autumn and the three-week one in September, but either may
move to another part of the year; go by the offering’s length, not the season.docs/agenda/<term>.md (e.g. docs/agenda/2026-summer.md).
The agenda index is docs/agenda.md.docs/terms/, read it: it lists lectures that were
skipped or merged and are therefore out of scope./Users/feamster/Dropbox/Tmp/exams/ml-systems/<type>/<YYYY>/
(cloud-backed, outside the public repo — never commit exam files before the exam
is given). Students: any directory of your own; nothing here is secret.rubric.yaml, grading-notes.md, and analysis.md first where present; skip questions they mark ambiguous): 2–3 most recent under docs/midterm/<YYYY>/ and
docs/final/<YYYY>/ (each has questions.tex, instructions.tex, exam.tex,
feamster.sty, and usually a Makefile). For a combined exam, read one midterm
and one final. Imitate exams of the same kind: nine-week midterms and finals are
consistent with each other; the three-week combined exam differs in length and layout.Create an exam that:
\prob …
\eprob in \par\noindent\begin{minipage}{\linewidth} … \end{minipage}\par,
and put each section heading inside the minipage of its first question. A
minipage cannot break, so no \Needspace guessing is needed. Then grow the
boxes until every page is full: render at 72 dpi, measure the free space
above the footer on each page, and add it to that page’s boxes. Students never
complain that a box is too big; the Autumn 2026 midterm survey asked for
boxes about twice as large and a longer exam.questions.tex (with solutions), instructions.tex, exam.tex, a
Makefile, and a README.md; copy feamster.sty and the Makefile from the
most recent past exam of the same kind (e.g. the last nine-week offering’s midterm).exam.pdf and exam-solution.pdf; verify page count, point total, and
layout; iterate until they match.feamster.sty)\prob{N} … \eprob wraps a question worth N points. Do not use \prob{} for
the acknowledgment box in instructions.tex — it would add a phantom point. Use:
\noindent Write your full name here to acknowledge these instructions: \shortanswerbox{3.25}{Nick Feamster}
The name box is not a numbered question; the first \prob is question 1. Keep
the front matter to one short paragraph (points, bubbles, permitted materials)
plus that name line; a multi-paragraph preamble costs a third of a page.
questions.tex:
\newcommand{\gridbox}[3]{%
\ifthenelse{\equal{\version}{solution}}{%
\tikz[baseline=(x.base)]\draw (0,0) rectangle node (x) [text width=\dimexpr#1-6pt\relax, align=left] {\scriptsize #3} (#1, #2);%
}{%
\tikz[baseline=(x.base)]\draw (0,0) rectangle node (x) {\vphantom{Aq}} (#1, #2);%
}}
% \gridbox{width}{height}{solution}, e.g. \gridbox{6cm}{1.4cm}{integrity}, inside a tabular with the labels
\correctanswercircle{} for correct options, \answercircle{}
otherwise. Keep option text short enough for the two-column layout.\yesnoyes and \yesnono, in no fixed pattern. Before finishing, write out
the whole key (for example “Q1: B, C, F; Q5: no; Q9: D”) and fix any pattern
you can see in it.Show the answer key as a table before the exam is final, for the instructor to look over, one row per question with an answer to check:
| Question | Type | Correct answer(s) |
|---|---|---|
| Q3 | single answer | 2 of 5 |
| Q5 | select all | 1, 2, 4 of 5 |
| Q8 | yes/no | no |
Give positions as they appear on the page (count across the row, then down, in a two-column grid). Note under the table any pattern still visible, such as two single-answer keys in the same position, so the instructor can decide.
\framebox{\yesnoyes} or \framebox{\yesnono} (no braces around Yes/No).\answerbox{height-in-inches}{solution text}; 1.0–3.0 in depending on
expected length; solution text must be a single paragraph and must not contain &.
Put a blank line before \answerbox. Very short answers: \shortanswerbox{width}{text}.The solution box grows to fit its answer. In feamster.sty, the solution
branch of \answerbox must draw a node that stretches to its text, never
shorter than the student’s box, so a long model answer (or one amended after
grading) can’t spill over the next question. The student version keeps the
fixed-height rectangle. If the copied feamster.sty still has the
fixed-height solution branch, replace that one line with:
% the box grows to fit a long solution (never shorter than the exam's box)
\tikz\node[draw, align=left, inner xsep=.025\textwidth, text width=.95\textwidth, minimum height=#1 * 1.5cm] (sol) {\textbf{Solution:} #2} node[anchor=south east] at (sol.north east) {(Answer inside the box)};%
\section*{Name} inside the first question’s minipage (above), with
\vspace{1.2ex} before the minipage; \titlespacing*{\section}{0pt}{1.2ex}{1.0ex}
in exam.tex so the heading is not jammed against the question.instructions.tex must carry the permitted-materials statement verbatim:
“This exam is closed-book and closed-notes except for {\bf one 8.5\,$\times$\,11-inch
sheet of paper with handwritten notes (both sides permitted)}. No electronic devices,
additional pages, or other materials are permitted.”exam.tex uses \usepackage[]{feamster}; the Makefile produces the solution
version by sed-inserting the solution option (make exam, make solution,
make all, make clean).Run two independent reviews of the built PDFs, one on the answer key and one reading the exam as a student would, and fold both into the source before printing. Each reviewer checks every item for:
Record what the review changed in the exam’s README.md. The Autumn 2026
midterm’s in-class debrief also asked for randomized option positions (already
required above) and noted that one rubric item expected an alternative the
question had not asked for: the key must only reward what the stem asks.
make all
pdfinfo exam.pdf | grep Pages # must equal the requested page count
grep -o '\\prob{[0-9]*}' questions.tex | tr -dc '0-9\n' | awk '{s+=$1} END {print s}' # must equal the point total
Open the PDF page by page: no question split across a page, no orphaned heading,
no overlapping text, answer boxes start on a new line, multiple-choice options
don’t spill across columns. Open exam-solution.pdf too and look at where
the filled bubbles and circled yes/no answers fall: no column, row or position
should stand out. Too long: remove page breaks between sections,
shrink boxes, merge questions. Too short: enlarge boxes.
docs/<type>/<YYYY>/ afterwards, with solutions, as practice material for the
next offering.