WORKED CASE
Understand binary search by changing the view
Use an example, a visual interval, and teach-back to inspect the same mechanism.
The facts stay the same
- The list is sorted in ascending order: [2, 5, 8, 11, 14].
- The target is 11. Positions in this example count from 1.
- Compare with the middle value; retain only the region that could contain the target.
- Stop at a match or when no candidates remain.
Understand binary search by changing the view
Follow each justified step
Start with all five candidates. The middle value is 8. Since 11 is greater, keep [11, 14]. Inspect 11 and report a match at position 4. Other midpoint conventions can take a different valid sequence.
Candidates: [2, 5, 8, 11, 14]
Compare target 11 with middle 8.
Keep: [11, 14]
Compare target 11 with 11.
Found at position 4.Makes visible: The comparison that justifies each reduction.
Leaves out: Following one successful example does not show that you can handle an absent target.
Watch the candidate set shrink
The labels show successive candidate regions. Values outside the retained region cannot match under the ordering assumption.
2 · 5 · 8 · 11 · 14 · 11 > 8: keep upper region → 11 · 14 · compare with 11 → 11: match
Makes visible: How the set of possible answers changes.
Leaves out: The diagram is an authored trace, not an execution engine or a performance benchmark.
Explain the condition that makes it work
Before opening the answer below, explain why a comparison permits discarding some values. Then try finding 10 in the same list.
Try this:
1. Explain why values 2, 5, and 8 can be excluded.
2. Predict what happens when the target is 10.
3. Check that the candidate region eventually becomes empty.
4. Explain why this means no match exists.Makes visible: Whether your explanation includes the ordering assumption.
Leaves out: A fluent answer can still be wrong; compare it with the actual trace.
Check your understanding
Why would this elimination rule fail if the list were unsorted?
Open the explained answer
A comparison with the middle item would no longer establish which other items are too small or too large. Discarding half could remove the target.
These are prepared representations of a bounded example. Changing views does not generate new facts or simulate unmodeled behavior.