solution for challenge 192 intermediate (markov chains)