Repository

czekster/markov

Markov Chains for Programmers

Open github.com

czekster/markov

Markov Chains for Programmers

Free book teaching Markov chains through C code, with matrices, power method, steady-state DTMC/CTMC, simulation, tests, and CI. Includes ~14 models.

Visit project

Show me a random project

First shared
Oct 15, 2026
HN activity
51

Show HN@raisterOct 15, 2026

Show HN: Markov Chains for Programmers – free book (2nd ed.) with C code

I have just finished reviewing the 2nd edition for my Markov Chains book. This for programmers who want Markov chains explained through code, not proofs. You build chains as matrices and solve them in C: power method, steady state for DTMCs/CTMCs, simulation to check the numbers. 2nd edition just out: errata fixed, new material on uniformised/embedded DTMCs, and the code now has tests and CI. Repo has the PDF (CC BY), C solutions (GPLv3), and ~14 models (Land of Oz, mouse maze, a Shakespeare sonnet...) also in PRISM, MATLAB and Excel. Errata and feedback welcome.

Community

Hacker News discussion

Loading the thread…