cs-107 — The Duplicate Students
| Field | Value |
|---|---|
| id | cs-107 |
| difficulty | Intermediate |
| topics | deduplication, matching |
| lecture | lecture-27 |
| estimated time | 5-minute attempt + 10-minute discussion |
| prerequisites | loops, lists, and tracing from lectures 1-6 |
| objective | choose the technique, trace it faithfully, and defend the boundary behaviour |
| solution | held by the instructor; discussed after the attempt |
Problem
Same student appears with name variants and id typos. Design a matching rule with a manual-review queue; measure how much the rule catches vs leaves.
Your deliverable is the stated assumptions, the matching rule (what counts as the same student) made precise, and one borderline pair with your verdict. If the problem is ambiguous anywhere, state the assumption you are making and carry on — a stated assumption is part of a good answer.
Examples
- Input: "Ada Lovelace" / "ada lovelace" / "A. Lovelace" / id "S2023-0471" vs "s2023-0471 "
- Output: match rule: lowercase+strip id first (exact); name fuzzy (initials + surname); manual queue for the rest
Solve for the worked instance first. Then ask what would change if one number, name, or condition were replaced by something stranger.
What to notice
- Design the rule in tiers: exact key match, normalised key match, fuzzy match, human queue - and report each tier's catch rate.
- Writing the rules IS the solution; code is transcription.
- Every assumption is a place where two good answers can differ.
Discussion starter
After the solution is revealed, the class spends five minutes on this prompt: "Propose one extra rule that would change the verdict — is it an improvement?"
Constraints and assumptions
- Difficulty: Intermediate (loops and lists assumed).
- Topics: deduplication, matching.
- Classroom-scale inputs unless the problem says otherwise.
- Time-box: about five minutes for the plan and trace; finishing the details is a bonus, defending the method is the target.
- Optional stretch (not required): describe an alternative approach and say when it beats the obvious one.
Hints and extension
- First nudge: identify the pattern the worked instance uses before computing anything.
- If stuck after three minutes, write the input/output line you expect and trace the smallest example by hand.
- After the reveal, attempt the extension below before the next lecture.
- Extension challenge: Draft the audit trail paragraph a reviewer would need to trust your cleaning.