Skip to main content

Week 7 Lab: Pricing the wait

Validate a supplied interruption scenario, gate actions on the physical set ledger, and make a one-lap stop call from an analytic expected cost

19 April 2027

Two hours, completed and submitted inside the session, for 2% of the course. You arrive with the codebase running and the simpler case finished: the Safety Car is already deployed, so the event is known and there is no hazard decision to make.

What leaves the room is a feasible stop now or wait one lap call. Its report names the projected position, expected adjusted cost, required physical set, supplied hazard and break-even hazard. It also states that the hazard is a synthetic scenario value, not an estimated or calibrated Formula 1 probability.

Before the session

Install the supplied codebase and run its test suite. Read the hazard, candidate and set-ledger schemas closely enough to identify each field and its units or state. The candidate traces already carry projected position and adjusted cost; the ledger distinguishes available, used and electronically returned sets.

Complete the already-deployed-Safety-Car warm-up. A deployed Safety Car is an observed race state, not a possible next-lap arrival, so this exercise checks candidate validation, the physical-set gate and report formatting without asking you to price uncertainty.

Then work the preparation fixture by hand. It supplies a constant synthetic hazard of 0.10 for each of two laps. One-lap survival is 0.90; two-lap survival is 0.90 × 0.90 = 0.81; arrival by the end of lap two is 0.19. Write one sentence explaining why the second lap still has hazard 0.10 among races that reached it, rather than 0.19.

What is supplied

The codebase consumes supplied Week 3 and Week 4 outputs. It does not import your earlier lab code. No random draw belongs in this implementation: the one-lap expectation has two terms and both are known once the fixture opens.

In the session

  1. Validate state — 20 minutes. Reject a probability outside [0, 1], a negative or non-finite cost, a missing action, duplicate physical-set IDs, and any candidate that names a returned set. Keep these failures distinct; a malformed scenario must not fall through to a strategic answer.
  2. Make the hazard executable — 25 minutes. Implement the next-lap hazard and survival functions. Pass the supplied hand-calculated fixture, including the two-lap survival result, and explain in a code comment that the hazard’s denominator contains only races with no earlier Safety Car.
  3. Gate, then score — 30 minutes. Build the feasible action set from the physical ledger before computing any expected cost. For wait one lap, use h × C_SC + (1 - h) × C_green. Compare projected finishing position first; use expected adjusted cost only where positions match.
  4. Commit the threshold, then unlock — 25 minutes. Derive the break-even hazard symbolically without the hidden hazard. Record which side selects stop now and which selects wait one lap, commit that checkpoint, then unlock the assessed fixture and reproduce its locked result exactly.
  5. Test and report — 20 minutes. Run the altered-ledger case that marks the waiting action’s required set as returned; it must reject the action before scoring. Reproduce the supplied low-hazard flip, then emit the complete decision report from the canonical locked fixture.

What you hand over

A marker checks the following before the session closes:

Sampling is not evidence here. If your code draws a Bernoulli event, remove the draw and calculate the two-term expectation.

The spec

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

Teaching team