Shaping Randomness and Markov Chains