Markov Chains and Hidden Markov Models