1: \begin{abstract}
2: We provide a unified framework to compute the stationary distribution of any finite irreducible Markov chain or
3: equivalently of any irreducible random walk on a finite semigroup $S$.
4: Our methods use geometric finite semigroup theory via the Karnofsky--Rhodes and the McCammond expansions
5: of finite semigroups with specified generators; this does not involve any linear algebra.
6: The original Tsetlin library is obtained by applying the expansions to $P(n)$, the set
7: of all subsets of an $n$ element set. Our set-up generalizes previous groundbreaking work involving left-regular bands (or
8: $\mathscr{R}$-trivial bands) by Brown and Diaconis, extensions to $\mathscr{R}$-trivial semigroups by Ayyer, Steinberg,
9: Thi\'ery and the second author, and important recent work by Chung and Graham. The Karnofsky--Rhodes expansion of
10: the right Cayley graph of $S$ in terms of generators yields again a right Cayley graph. The McCammond expansion
11: provides normal forms for elements in the expanded $S$. Using our previous results with Silva based on work by Berstel,
12: Perrin, Reutenauer, we construct (infinite) semaphore codes on which we can define Markov chains. These semaphore
13: codes can be lumped using geometric semigroup theory. Using normal forms and associated Kleene expressions, they
14: yield formulas for the stationary distribution of the finite Markov chain of the expanded $S$ and the original $S$.
15: Analyzing the normal forms also provides an estimate on the mixing time.
16: \end{abstract}
17: