Rubric — Assignment 3 (20 marks)

Applies to Assignment 3.

Part A (10)

(a) Visit counts (3)

BandDescriptor
3V1: n (average) + n (scan) = 2n; V2: n × (n + n) = 2n² or equivalent per-element accounting; V3: n log n sort + log n search. Expressions tied to the n-values.
2Right shapes but one version's bookkeeping off (e.g. V2 counted as n² without the inner pair).
0–1Constant-time claims for re-computation, or no expressions.

(b) Empirical timings (4)

BandDescriptor
4Both n values × both versions with raw times and the ratio; the ratio's agreement with 2n vs 2n² (≈ ×10 time growth for ×10 data on V1, ≈ ×100 on V2) checked explicitly.
2–3Timings present but no ratio/agreement analysis, or one version missing.
0–1Single numbers, no measurement conditions.

(c) Binary search correctness (2)

BandDescriptor
2A concrete unsorted list where the average is present but binary search misses it (e.g. [4, 2, 8, 6], average 5 is absent — pick one where it is present, like [2, 4, 8, 2], average 4, present but unsorted), plus the statement that V3 sorts the copy first, which is the fix.
1Vague "needs sorted data" without the concrete list.
0Wrong or missing.

(d) Shipment verdict (1) — any defensible choice with a stated reason.

Part B (10)

(a) Model precision (3)

BandDescriptor
3State = remaining minutes (start 120); decision = "does the next arrival's need fit in remaining?"; stopping rule = first non-fit ends the slot (arrival order only); ties and zero remaining handled.
2Model right but one rule implicit.
0–1Ambiguous state or no stopping rule.

(b) Trace (3)

BandDescriptor
3Table: 15→105, 20→85, 30→55, 20→35, 15→20, 30→refused (30 > 20 remaining). One patient referred (the last).
2Correct flow, one arithmetic slip.
0–1Wrong rule (e.g. serving the refused patient partially).

(c) Shortest-first (3)

BandDescriptor
3Sorted needs [15, 15, 20, 20, 30, 30]: 15→105, 15→90, 20→70, 20→50, 30→20, 30 refused → 5 served vs 5 in (b) — same count here (say so honestly); fairness discussed (later arrivals with small needs leapfrog — longer waits for earlier, longer cases).
2Trace right but fairness unargued, or count wrong.
0–1Reordering not traced.

(d) No-better-ordering claim (1)

Award for either a concrete instance where arrival order is already optimal (any set that fills 120 exactly in arrival order) or a coherent argument that with these sizes an optimal order always exists offline — the rubric rewards the reasoning, not a specific answer.

Cross-cutting adjustments