Skip to main content

Week 9 Lab: Share the draw

Build two complete finishing-position distributions from paired synthetic trials, then compare strategies under the same interruption and weather draws

3 May 2027

Two hours, completed and submitted inside the session. This lab carries 2% of the course. You will turn one supplied synthetic uncertainty model into two complete finishing-position distributions, with both strategies consuming the same scenario on every trial.

The codebase is standalone. It imports none of your earlier work. The outcome map, strategy records and pseudo-random wrapper are supplied so the work stays on validation, shared-draw plumbing, accumulation and comparison.

Before the session

Install the supplied codebase and run its test suite. Read the strategy, uncertainty, trial and report schemas until you can name every field and its type. Trace the public four-trial fixture by hand: for each row, map the two uniform values to one interruption-and-weather scenario, then look up A and B against that same scenario.

Run the generator-wrapper self-test unchanged. The wrapper emits two named uniform values per trial in a fixed order. It is supplied test machinery, not a random-number generator for you to implement or evaluate. The locked seed and 200-trial ground truth remain unavailable before the checkpoint.

What is supplied

Every threshold, outcome, generator choice and result in this fixture is synthetic. The wrapper makes a run reproducible; it makes no claim about the quality of randomness needed for real analysis.

In the session

  1. Validate before sampling (20 minutes). Reject a missing strategy, a strategy requiring an unavailable physical set, malformed or unordered thresholds, duplicate position bins, and a trial count that is not a positive integer. Add a spy or counter proving that the wrapper is never called after a feasibility failure. Run the altered unavailable-W1 ledger: both dependent strategies must fail before the first draw.
  2. Make one trial reproducible (25 minutes). Consume u_sc and u_weather from the supplied wrapper, map them through the synthetic thresholds, and pass the resulting scenario to both A and B. Reproduce the public first-six trace exactly. Do not call the wrapper separately for each strategy.
  3. Keep full distributions (25 minutes). Initialise P1 through P8 for both strategies, including zeros. Accumulate counts, divide each count by the stated trial count, and assert that both count totals equal that count and both probability sums equal one.
  4. Compare paired outcomes (30 minutes). Lower finishing position wins. Consult adjusted finish only when positions tie; the supplied SC–M row is the fixture that exercises that branch. Reproduce the public 5–15 result with no unresolved ties. Add a test that fails if A and B receive different draw pairs. Explain why the four-row independent-sample example compares different luck, without claiming that shared draws remove sample noise or reduce variance in every model.
  5. Unlock, reproduce and report (20 minutes). After the shared-draw checkpoint, run the locked 200-trial fixture. Match both full distributions and the paired win, loss and tie totals in the released ground truth. Run the unavailable-W1 failure again, then emit the complete report.

What you hand over

A marker checks these in the room:

A head-to-head proportion stays beside both marginal distributions. It never replaces them, and it does not establish how often the same proportion will occur in real races.

The spec

What you bring to the session. Written so a reader can tell whether it has been met without asking you.

Teaching team