In reply to Rick Wicklin.

yes, the transition matrix has probabilities.
I am assuming that apart from the coding aspect, there is nothing wrong by following the procedure the way I explained?