# Two choices: the age of the queue snapshot

This original Hesela example allocates four unit jobs to three initially empty
eligible servers. Nothing departs during allocation. Draws are independent,
uniform, ordered and with replacement. Each job is assigned once; this is not
hedging. "Current" observes every preceding assignment; "frozen" never changes
the initial zero counts. Ties select the first sampled candidate, except the
explicit lowest-ID control. Duplicate candidate draws are allowed.

Run with Python 3 standard library:
```sh
python3 -B model.py --check
python3 -B -m unittest discover -s . -p test_model.py
python3 -B -O -m unittest discover -s . -p test_model.py
sha256sum -c SHA256SUMS
```
Run model.py without --check to regenerate results and the manifest.

The generator aggregates integer counts of all elementary sequences by state.
An independently written exhaustive path oracle checks every small case, and a
multinomial formula checks both frozen policies. For four arrivals there are
3^4=81 one-choice and 3^8=6561 ordered two-choice sequences. Reported
probabilities have these explicit denominators; reduced fractions are included.

With all reported counts equal and first-sample ties, frozen two-choice routing
uses exactly the first uniform draw. The whole allocation distribution is
therefore identical to one random choice, not merely its expectation.
Choosing the lower server ID on ties changes selection probabilities to
5/9, 3/9 and 1/9. That is an implementation control, not the default algorithm.

These are finite allocation probabilities, not queueing equilibrium, p99 latency,
a universal penalty for stale information, or a reproduction of the cited papers.
There is no sampling error or confidence interval: all modeled sequences are
counted. Model mismatch remains. Local outstanding counters, different initial
states, without-replacement sampling, unequal work and service completions change
the experiment.

Background, not input data:
- Mitzenmacher, The Power of Two Choices in Randomized Load Balancing,
  IEEE TPDS 12(10), 2001, pp. 1094-1104, sections 1 and 2.2-2.4:
  https://www.eecs.harvard.edu/~michaelm/postscripts/tpds2001.pdf
- Mitzenmacher, How Useful Is Old Information?, IEEE TPDS 11(1), 2000,
  pp. 6-20, sections 2, 3.1-3.4 and 4.3:
  https://www.eecs.harvard.edu/~michaelm/postscripts/tpds2000.pdf

The papers are linked, not redistributed. Code and results are authored here;
no third-party measurement dataset or figure was copied.
