{
  "slug": "tsetlin-library",
  "term": "Tsetlin library",
  "aliases": [
    "Move-to-front Markov chain"
  ],
  "definition": "A Tsetlin library is a Markov chain that repeatedly moves an independently requested object to the front of an ordered list.",
  "note": "For fixed positive request probabilities p_i, a state lists all objects from most to least recently requested. Its stationary probability is the product, over positions k, of p at position k divided by the total p of objects at positions k through n. This is successive popularity-weighted sampling without replacement, not a uniform permutation. [rhodes] [enumerative]\n\nLRU connection: with equal-size objects, instantaneous fills and demand admission, the first C positions are the resident set. Under independent requests, averaging their total request probability over stationary states gives the hit ratio. For weights (3, 2, 1), exact arithmetic gives 7/18 at one slot and 133/180 at two slots. These are constructed probabilities, not trace measurements. [fricker] [control]\n\nThe model specifies request identities, not elapsed time. Stationarity does not supply a warm-up duration, and measured popularities alone do not establish request independence. A deterministic periodic sequence may have the same frequencies but different cache behavior. [fricker]\n\nWarm-up selection: in an exact two-object IID model with probabilities (2/3, 1/3), a one-slot cache has next-hit probability 5/9 after a fixed request index, but 4/9 just after first seeing both labels. The completing miss is excluded. [warmup-control]\n\nCoverage is not conditional stationarity: given collection at request 2, A is resident with probability 1/2, not 2/3. One fresh request resets this one-slot IID state, not arbitrary caches. [strong-stationary] [warmup-control]",
  "status": "research",
  "advantages": [],
  "limitations": [
    {
      "text": "Complete state enumeration grows factorially with catalogue size; the linked six-state control is not a scalable cache estimator.",
      "citationIds": [
        "control"
      ]
    }
  ],
  "related": [
    "che-approximation",
    "independent-reference-model",
    "lru-replacement",
    "move-to-front"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-22",
  "citations": [
    {
      "id": "rhodes",
      "title": "Rhodes and Schilling. Unified theory for finite Markov chains. arXiv:1711.10689v3 (2019), section 3.1.",
      "url": "https://escholarship.org/content/qt30d0p416/qt30d0p416.pdf",
      "accessed": "2026-11-21"
    },
    {
      "id": "enumerative",
      "title": "Chatterjee, Diaconis and Kim. Enumerative Theory for the Tsetlin Library. arXiv:2306.16521v1 (2023), equation (1) and section 2.2.",
      "url": "https://arxiv.org/pdf/2306.16521v1",
      "accessed": "2026-11-21"
    },
    {
      "id": "fricker",
      "title": "Fricker, Robert and Roberts. A versatile and accurate approximation for LRU cache performance. arXiv:1202.3974v1, sections 2-3.",
      "url": "https://arxiv.org/pdf/1202.3974v1",
      "accessed": "2026-11-21"
    },
    {
      "id": "control",
      "title": "Hesela. Exact rational three-object stationary LRU control and move-to-front transition check.",
      "url": "https://hesela.dev/research/tsetlin/evidence.json",
      "accessed": "2026-11-21"
    },
    {
      "id": "code",
      "title": "Hesela. Reproduce the six-state calculation using Python's standard-library rational arithmetic.",
      "url": "https://hesela.dev/research/tsetlin/model.py",
      "accessed": "2026-11-21"
    },
    {
      "id": "observatory",
      "title": "Hesela. Exact recency probabilities under independent requests.",
      "url": "https://hesela.com/analyses/ssd-mapping-cache-hmb/#tsetlin-library",
      "accessed": "2026-11-21"
    },
    {
      "id": "strong-stationary",
      "title": "Nestoridi. Optimal strong stationary times for random walks on the chambers of a hyperplane arrangement. arXiv:1706.00310v2, section 2.1, Definition 7.",
      "url": "https://arxiv.org/pdf/1706.00310v2",
      "accessed": "2026-11-22"
    },
    {
      "id": "warmup-control",
      "title": "Hesela. Exact two-object warm-up stopping-time control, formulae and post-collection window means.",
      "url": "https://hesela.dev/research/tsetlin/warmup.json",
      "accessed": "2026-11-22"
    },
    {
      "id": "warmup-code",
      "title": "Hesela. Reproduce the exact warm-up selection calculation with Python rational arithmetic.",
      "url": "https://hesela.dev/research/tsetlin/warmup.py",
      "accessed": "2026-11-22"
    }
  ],
  "provenance": [
    "Primary-source review of the stationary product formula and its application to equal-size LRU under independent references. This is not a new theorem or a hardware benchmark.",
    "The exact six-state arithmetic separately checks probability mass, full transition stationarity and pairwise order identities. No warm-up or convergence rate is inferred.",
    "The 2024 journal paper DOI is 10.1016/j.jalgebra.2023.08.009; the explicitly versioned 2023 preprint supplies the cited equation.",
    "Warm-up counterexample uses original exact arithmetic, independent finite-history enumeration and transition-reward checks. The source supplies the definition of strong stationarity; the control is not a replication of its general hyperplane-walk results."
  ]
}
