Example 1 — Average of a list
EasyProblem
A formula computes the average as . What edge case must you handle?
Solution
-
The boundary input is an empty list, where count is .
Name the structure before touching arithmetic — that is what makes the right method obvious.
-
Ask the recognition question: Am I deliberately testing the extreme or special inputs where a formula or argument might behave differently?
If the answer is yes, the concept applies; the cue, not a keyword, decides the method.
-
Probe count: the formula becomes , undefined.
The rule is chosen only after the structure matches, so the steps mean something.
-
Division by zero means the average of an empty list needs a special rule, not the formula.
Keep units, shape, or answer form tied to the story so the work does not become symbol pushing.
-
Check the answer against the original question.
It should fit the mental model — test the corners where rules break. If it does not, revisit the recognition step before changing the arithmetic.
Answer
Empty-list case is undefined and must be handled separately
Takeaway: Always test the extremes — zero, empty, boundary — where the general rule can fail.