Stochastic Dynamics: Markov Chains, Random Transformations and Applications