cs-104 — The Streak Simulation
| Field | Value |
|---|---|
| id | cs-104 |
| difficulty | Expert |
| topics | probability, simulation |
| lecture | lecture-26 |
| estimated time | 5-minute attempt + 10-minute discussion |
| prerequisites | the full Block I-III toolbox and proof-shaped reasoning |
| objective | make and justify design decisions where the method itself is the challenge |
| solution | held by the instructor; discussed after the attempt |
Problem
How likely is a 5-win streak in a 20-game season at 55% win probability? Exact recursion vs Monte Carlo; compare and explain differences.
Your deliverable is the count (or probability) with the sample space stated, the case analysis, and a brute-force check for a small instance. 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: 20 games, win prob 0.55, ask P(streak of 5 wins somewhere)
- Output: exact recursion vs Monte Carlo (100k seasons) agree to ~2 decimal places
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
- Exact: dp over games tracking current streak capped at 5. Simulation must MATCH it - disagreement means a bug.
- 'How many total, how many favourable' is the whole skeleton of probability.
- Complements turn hairy unions into one subtraction.
Discussion starter
After the solution is revealed, the class spends five minutes on this prompt: "Where exactly did the wrong counts double-count — point at the pair."
Constraints and assumptions
- Difficulty: Expert (independent design decisions and proof-shaped arguments assumed).
- Topics: probability, simulation.
- Classroom-scale inputs unless the problem says otherwise.
- Time-box: about five minutes for the attack plan; the full argument may exceed the box - outline the proof strategy instead of grinding details.
- 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: Compute both conditionals from your table and explain the denominator swap.