Skip to main content

Module 1: Algorithm Analysis & Design Paradigms: Mistake Clinic

This clinic turns wrong moves into reusable judgment. Use it after each practice page and again before the quiz or checkpoint.


Module-Specific Mistake Radar

Start with these traps. Replace or extend them with real mistakes from your own work.

Mistake to look forWhere it shows upSymptomRepair evidence
Finishing Complexity Analysis Workshop with only a final answerComplexity Analysis WorkshopThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Algorithm Correctness Lab with only a final answerAlgorithm Correctness LabThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Design Paradigm Clinic with only a final answerDesign Paradigm ClinicThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Code Katas with only a final answerCode KatasThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Treating Big-O, Omega, and Theta Bound Growth, Not Time as vocabulary instead of a toolBig-O, Omega, and Theta Bound Growth, Not TimeThe explanation names the concept but cannot decide between two cases.Write one example, one non-example, and the rule that separates them.
Treating Loops and Summations Turn Code Into a Sum as vocabulary instead of a toolLoops and Summations Turn Code Into a SumThe explanation names the concept but cannot decide between two cases.Write one example, one non-example, and the rule that separates them.

Practice Mistake Checks

Pull any miss from these checks into your mistake log.

Complexity Analysis Workshop

Source: practice/01-complexity-analysis-workshop.md

Identify the error in each statement:

  1. "Because the algorithm is O(n^2), on n = 10 it runs in roughly 100 operations."
  2. "T(n) = 2 T(n/2) + n^2 solves to Theta(n^2 log n) by the Master Theorem."
  3. "Merging two linked lists of length n is Theta(log n) because we halve the work."
  4. "A binary counter's n increments cost Theta(n log n) because each increment flips up to log n bits."
  5. "Because my algorithm has the same big-O as quicksort, it will run equally fast in practice."

Algorithm Correctness Lab

Source: practice/02-algorithm-correctness-lab.md

Identify the error:

  1. "My invariant is that the array will be sorted after the loop ends."
  2. "I proved correctness by running the algorithm on 50 random inputs and it always worked."
  3. "My recursive function calls itself on n - 1 or on n depending on the branch; termination is obvious."
  4. "I do not need a base case because the inductive step handles everything."
  5. "The loop terminates because the index variable changes every iteration."

Design Paradigm Clinic

Source: practice/03-design-paradigm-clinic.md

Identify the error:

  1. "My greedy works on all the sample inputs, so it is correct."
  2. "I memoized the recursion, so the runtime is polynomial."
  3. "Divide-and-conquer is always faster than iteration."
  4. "Backtracking is the same as brute force, just recursive."
  5. "Since I have optimal substructure, greedy will work."

Repair Protocol

For each real mistake:

  1. Reproduce the failure on the smallest example, trace, proof, query, command, or design sketch.
  2. Name the hidden assumption.
  3. Repair the artifact.
  4. Save evidence that changed: failing then passing test, corrected proof step, revised diagram, safer command, benchmark, or review note.
  5. Add one retrieval card beginning with Check... before... or Do not use... when....

Mistake Log

DateMistakeSymptomRoot causeRepair evidenceRetrieval card
StarterPick one radar row aboveExplain how it would fail in this moduleName the assumptionAdd a counterexample or corrected artifactWrite the card before closing the page

Completion Standard

  • At least five real mistakes are logged.
  • At least two mistakes include a counterexample or failing test.
  • At least one mistake connects to an older semester skill.
  • At least one correction changes code, a proof, a diagram, a command transcript, a query, or a design decision.