Ruby implementation of various Markov models