← Back to the playground
WORKED EXAMPLE / 01

Equal chances. Different sequences.

Two processes, 50 tickets each, one-unit quanta. The expectation is equal CPU time; any particular short run can look uneven.

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

Read the experiment

A and B are continuously runnable, with 50 tickets each. Every selection gives either process a 50% chance. The seed equal-tickets and 100 rounds define this reproducible example. Step through the first decisions, then finish the run to inspect the observed counts.

Calculate the expectation

Expected selections per process = 100 × 0.5 = 50. Because every slice is one time unit, selection share and CPU-time share are identical here. The displayed observed share comes from the actual winning-ticket trace, not from replacing it with the theoretical expectation.

Try another sample

Change the seed while keeping the weights fixed. The sequence will change but the next-draw probabilities will not. Increase the number of rounds to explore how relative deviations often become smaller. One run alone is not proof of convergence or randomness quality.

Next: unequal weights · Read the probability explanation

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