This is a little mathematical but you can do it. There are several algorithms involved in NLP and Markov Chains are the most common.
A Markov chain is a way of countable possible states
A stochastic process is one that is a collection of random variables.
A stochastic matrix is a square matrix where each of its rows is a probability vector