← Back to the playground
WORKED EXAMPLE / 02

Three tickets to one.

A has 75 tickets and B has 25. Both stay runnable, so A has a 75% chance of winning each independent selection.

SINGLE CPU / V1.0

Your workload

3 PROCESSES
Simulation model

PROCESSTICKETSARRIVEBURST
◈ Saved on this device
Ready when you are0 / 64 decisions
TIME ELAPSED0 units
CPU BUSY0 units
DECISIONS0

Execution timeline

ONE BLOCK = ONE DISPATCH
⌁A schedule starts with a decision.Press Run or take it one step at a time.

Expected vs. observed

More rounds tell a clearer story.

Expected Observed

Every ticket is a chance at the next slice. Your observed share will take shape as the simulation runs.

Decision trace 0 dispatches+
Abstract time units · no context-switch overhead

Map the tickets

There are 100 ready tickets. A owns 0–74; B owns 75–99. With a one-unit quantum and 100 rounds, the expected CPU allocations are 75 units for A and 25 for B. Use seed weighted-tickets to reproduce the example.

Inspect a winning ticket

Open the decision trace and look at any row. A ticket below 75 selects A; a ticket of 75 or higher selects B. The trace shows zero-based ticket numbers, start and end times, and the selected process. This makes each result inspectable.

A different question for finite jobs

Switching to finite workloads changes the experiment. Once one job finishes, it can no longer receive turns. The remaining process receives every subsequent slice. Use the workload-share chart in that mode; an initial 75/25 ticket split is not a target for the final shares of finite CPU bursts.

Compare equal weights · Compare a cyclic scheduler

KEEP EXPLORINGUnderstand lottery scheduling ↗Lottery vs. round robin ↗Work through arrival times ↗