Skip to main content

Mistake Clinic

Module-Specific Mistake Radar​

MistakeCounterexample or diagnosticRepair
Nested loops imply quadratic timeDoubling inner index yields logarithmic iterationsSum actual iterations
Two evaluations classify an arbitrary recurrenceFunctions can agree on sampled sizes and differ laterUse symbolic assumptions and prove the bound
Recursion depth equals total costBinary tree has logarithmic depth and linear leavesCount every node's work
Empty capacity 1 has potential2*size-capacity equal0It equals-1Include the correct initial potential or shift it
Amortized3 means every append costs at most3The 17th doubling append costs17Report total and maximum separately
Any equal key satisfies lower_bound[2,2] needs index 0Preserve the first qualifying candidate
A decreasing positive real proves terminationRepeated halving never reaches zero exactlyUse a well-founded rank or another valid argument
Count-optimal greedy is value-optimalTwo value 1 short jobs lose to one value 5 long jobRe-prove the changed objective
Overshoot pruning works with signed items5 plus-2 reaches target 3Bound possible completions under stated domains
A DP recurrence alone proves implementation complexityLinear predecessor search at every state is quadraticCount state, transition, setup, and recovery costs
Two variables mean constant bit storageExact Fibonacci values grow in bit lengthDistinguish slots from bits
Oracle agreement proves all inputs correctBoth programs can share endpoint mistakesValidate the oracle and retain a separate proof

Practice Mistake Checks​

After A, justify an exact sum and a matching lower bound. After B, explain why lo=mid can fail to progress and why lexicographic order allows later coordinates to increase. After C, state exactly what an exchange preserves and why the weighted objective breaks that reasoning.

Keep the original failure, a minimal input, hidden assumption, correction, and fresh transfer attempt. Use solutions after attempting the repair. Log real mistakes; do not manufacture errors to meet a quota. Critical errors in the rubric must be repaired even if the code checker passes.