Awesome intro! I've used Markov Chain libraries before but never took the time to try and understand them. This makes a lot of sense.
Are there different or more efficient probability calculations that can be done other than the provided algorithm? It seems somewhat simple.