$\DeclareMathOperator{\p}{Pr}$ $\DeclareMathOperator{\P}{Pr}$ $\DeclareMathOperator{\c}{^C}$ $\DeclareMathOperator{\or}{ or}$ $\DeclareMathOperator{\and}{ and}$ $\DeclareMathOperator{\var}{Var}$ $\DeclareMathOperator{\E}{E}$ $\DeclareMathOperator{\std}{Std}$ $\DeclareMathOperator{\Ber}{Bern}$ $\DeclareMathOperator{\Bin}{Bin}$ $\DeclareMathOperator{\Poi}{Poi}$ $\DeclareMathOperator{\Uni}{Uni}$ $\DeclareMathOperator{\Exp}{Exp}$ $\DeclareMathOperator{\N}{N}$ $\DeclareMathOperator{\R}{\mathbb{R}}$ $\newcommand{\d}{\, d}$

CS109 Midterm
Tue Oct 26th, 7pm in Hewlett 200

The Midterm and Solutions

Do Review: If you missed some points, we encourage you to look over the answers and understand what went wrong. Make the midterm a learning experience and set yourself up for the final.

Regrade Requests: Humans graded your exam and they might have made a mistake! If they did, we would like to fix it. Please submit a regrade request on gradescope by Monday Nov 8th at 11:59p. Requests that often get points back: grader didn't see my answer. Requests that often don't get points back: The grader was accurate, but I think this approach deserves more points. We reserve the right to regrade the whole exam if you submit a regrade request.


The median grade was an 95 out of 120 (amazing!), the mean was just above 93, and the standard deviation was an 14. Here is the distribution color coded with a way of interpreting your score:


The CS109 midterm is a 2-hour, closed book, closed calculator/computer exam. You are, however, allowed to bring 10 pages (front and back) of notes in the exam, formatted in any way you like. Make sure to practice before the exam.

Location and Time

When: 7pm to 9pm Oct 26th
Where: Hewlett 200

Alternative Arrangements

If you have an academic conflict with the midterm time (say you also have a CS999 exam at the same time) you should let us know right away (before thursday Oct 21st at 9a). Email cs109@cs.stanford.edu. Similarly if you have special university accommodations please contact us before Thursday to help us schedule.


The midterm puts special emphasis on the material from the first three problem sets and the first four sections. This includes material in lecture up to and including class on Wednesday Oct 20th Monday Oct 18th. In the reader this corresponds to Part 1 and Part 2, and Part 3 up through the "inference" section.

Answer Format

You are going to be solving probability questions by hand. To that extent we are not interested in numberic answers, but rather in formulaic answers. It is fine for your answers to include summations, products, factorials, exponentials, and combinations, unless the question specifically asks for a numeric quantity or closed form. Where numeric answers are required, the use of fractions is fine. You must show your work. Any explanation you provide of how you obtained your answer can potentially allow us to give you partial credit for a problem. For example, describe the distributions and parameter values you used, where appropriate.

What about the Phi table? I am not going to make you look up values from a phi table. Instead you can leave your answer in terms of phi (the CDF of the standard normal). For example $\Phi(\frac{3}{4})$ is a fine final answer. This was not the case in the past so you will see questions which ask for a numeric answer in the practice exams.

Essential Practice

Extra Practice

Note: You should not expect that a TA will know these problems in office hours (there are far too many for them to "prep" them all)

Review Session

There was a one time review session Thursday at 7p on zoom. Here is a link to the Recording and the Writeup from the review session.

You can do it!