Rubric for Algorithm HW

Six rows for a written solution, with the proof and the running time in rows of their own.

Press a number to score, any words to change them.
Name
Date
Score
Total
/ 24

Lines from a written solution, and what to write beside them

The idea

  • “See the code.” Ask for three sentences that would make sense with the code covered.
  • “We use dynamic programming.” That names a method. What are the smaller problems, and which one is the answer?
  • “Sort the list, and then it is easy.” Sort it by what, and what is easy afterward?

Sources: ocw.mit.edu, cmu.edu, apcentral.collegeboard.org, Wikipedia.

Show all 21

The steps

  • “Repeat until done.” What has to be true for it to be done?
  • “Pick the best one.” Best by which measure, and which one on a tie?
  • “Set smallest to 0.” In a list of positive numbers nothing is smaller than 0, so 0 comes out. Start with the first number of the list.
  • “For i from 1 to n, compare A[i] with A[i + 1].” When i is n, there is no A[n + 1]. The loop ends at n − 1.

The example

  • “Input: 7. Output: 7.” One item shows no step. Take four or five.
  • “To show the sort: 1, 2, 3, 4.” The list is sorted already, so it may hide most steps. Mix it, and put two equal numbers in.

The proof

  • “It worked on the example, so it is right.” One input is not every input.
  • “Clearly, this path is the shortest.” The word clearly stands where the reason should.
  • “Assume it works for n. Then it works for n.” The step has to go from n, or from smaller cases, to the next one.
  • “The loop keeps the total right.” Right in what way? Say what the total is after i passes.
  • “When it stops, the answer is right.” That is half. Why does it stop?

The running time

  • “It is O(n).” That may be so. What is done n times, and how long does each take?
  • “There are two loops, so it is O(n²).” One loop of n after another is O(n). One inside the other is n times n if both run n times.
  • “It took 0.2 seconds.” On one machine, on one input. Count steps as the input grows.
  • “Merge sort is O(n²).” True, since O is an upper bound, but too large: n log n is enough.
  • “Sorting first costs nothing.” Add it in: a sort that compares items takes at least about n log n steps in the worst case.

Easy to follow

  • “Let x be the smallest. Let x be the next node.” One name, one thing.
  • “This follows from class.” From which result? Name it, or state it.

How this list was compiled: What a written algorithm holds (a description in English and, if helpful, pseudocode; a worked example or diagram; a proof or indication of correctness; an analysis of the running time), that being understood counts as much as being right, that a simple analysis is worth more, correctness by induction and loop invariants, and worst-case running time: MIT OpenCourseWare, 6.046J Introduction to Algorithms (SMA 5503), Fall 2005, Syllabus, ocw.mit.edu . The parts of a rubric (criteria, descriptions, levels): Carnegie Mellon University, Eberly Center, cmu.edu . High school: that efficiency is told as a function of the size of the input, that it can be measured informally by how often statements run, and that formal analysis (Big-O) is outside the course: College Board, AP Computer Science Principles Course and Exam Description, topic 3.17, apcentral.collegeboard.org . Loop invariants, induction, merge sort, and the least that a sort by comparing needs: Wikipedia, en.wikipedia.org , en.wikipedia.org , en.wikipedia.org and en.wikipedia.org , text under the Creative Commons Attribution-ShareAlike license. Read December 1, 2026. The rubrics, the lines and every sentence are our own.

How it works

This rubric for algorithm HW scores what is written on paper, not a program that runs: the idea in words, steps or pseudocode, a worked example, the proof, the running time, and how easy it is to follow. 24 points.

Read the full guide

Four other sheets and a blank

The menu has High school computer science, which asks how the work grows in place of a bound; Proof only; Trace an algorithm by hand at three levels; and a Peer check before handing in. The last is blank.

Make the proof count double

Each row is out of 4. Type 8 after the slash in the proof row, and a 3 there counts 6. Take off a row you did not ask for with its ×.

Grade a pile

Press a number in each row, or type a half such as 2.5, then print. Next student empties the name and scores only. The list under the sheet has 21 sample lines from solutions, each with a comment to write beside it.

  • Cover the steps and read the idea aloud. If nobody can say what the steps will do, score the first row 2.

Questions and answers

What should a written algorithm include?

A description in words, with pseudocode if it helps, a worked example, a proof that it is right, and its running time. MIT’s Introduction to Algorithms course (6.046J, 2005) asked for these four.

How do you grade an algorithm proof?

Ask what it claims, where it starts, why each step holds, and why it ends. An example alone gets 1 in the proof row: it shows one input.

Does a right running time with no reason get full points?

No, it gets 2 of 4 here. So does a bound that is true but too large, such as O(n²) for merge sort, where n log n is enough.

Can I use it for a program?

Not as it stands. No row asks whether code runs, passes tests or has comments. It suits pseudocode and proofs on paper.

Do high school classes need Big-O?

AP Computer Science Principles leaves formal Big-O out and measures efficiency by how often statements run. The high school sheet asks how the steps grow when the input is twice as long.