← All projects
Project record1 mention
Originally shared on Hacker News

Markov Chains for Programmers

Free 2nd-edition book teaching Markov chains to programmers through code rather than proofs. Chains are built as matrices and solved in C (power method, steady state for DTMCs/CTMCs, simulation to check the numbers). The repo includes the PDF (CC BY), GPLv3 C solutions, and ~14 example models also in PRISM, MATLAB and Excel; the 2nd edition adds material on uniformised/embedded DTMCs plus tests and CI.

Last shared For Programmers who want Markov chains explained through code, not proofs.
01 / The problem

What it addresses

Programmers want Markov chains explained through code, not proofs.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Markov Chains for Programmers

    Free 2nd-edition book teaching Markov chains to programmers through code rather than proofs. Chains are built as matrices and solved in C (power method, steady state for DTMCs/CTMCs, simulation to check the numbers). The repo includes the PDF (CC BY), GPLv3 C solutions, and ~14 example models also in PRISM, MATLAB and Excel; the 2nd edition adds material on uniformised/embedded DTMCs plus tests and CI.

    Problem: Programmers want Markov chains explained through code, not proofs.

    Audience: Programmers who want Markov chains explained through code, not proofs.

    Posted by @raister · Original source ↗

    Story title · @raister · · Source ↗

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

    Submitted URL · @raister · · Source ↗

    https://github.com/czekster/markov

    Source text · @raister · · Source ↗

    I have just finished reviewing the 2nd edition for my Markov Chains book.

    Source text · @raister · · Source ↗

    This for programmers who want Markov chains explained through code, not proofs.

    Source text · @raister · · Source ↗

    You build chains as matrices and solve them in C: power method, steady state for DTMCs/CTMCs, simulation to check the numbers.

    Source text · @raister · · Source ↗

    2nd edition just out: errata fixed, new material on uniformised/embedded DTMCs, and the code now has tests and CI.

    Source text · @raister · · Source ↗

    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.

    Source text · @raister · · Source ↗

    Link: https://github.com/czekster/markov