cs-111 — The Waiting-Time Twist
| Field | Value |
|---|---|
| id | cs-111 |
| difficulty | Intermediate |
| topics | inspection paradox, averages |
| lecture | lecture-28 |
| 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
Buses every 10 minutes, yet average wait is 15. Why your sample differs from the schedule's average (length-biased sampling), and the fix.
Your deliverable is the stated assumptions, the waiting-time summary recomputed correctly, and one hidden averaging choice that changes the story. 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: buses every 10 min exactly; you arrive at a random minute
- Output: your expected wait 5 min if you believe the schedule; with bunching (headways 2,2,26 avg 10), rider average = (2^2+2^2+26^2)/(2*30) = 11.4 min
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
- You are more likely to land in a LONG gap: rider-wait weights each gap by its length (inspection paradox).
- 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: inspection paradox, averages.
- 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: Write the two honest headlines for this summary and their audiences.