
1 
2 
3 
4 
5 
6 
7 
8 
9 
0.0 
0.075 
0.1 
0.15 
0.3 
0.15 
0.1 
0.075 
0.05 
There is one small trick in the above example. Full marks to you if you noticed that the number 1 would never be chosen because it has a weighting of 0.0. Watch what happens if we set the table such that 5 is the ONLY available option.
1 
2 
3 
4 
5 
6 
7 
8 
9 
0.0 
0.0 
0.0 
0.0 
1.0 
0.0 
0.0 
0.0 
0.0 
This is an important detail about stochastic matrices, the sum of all weighted choices must be equal to 1.0 and therefore if any individual choice is weighted to 1.0 all other choices must be equal to 0.0.
Another reason for the popularity of stochastic processes is the amount of data which they produce. A stochastic matrix is capable of generating any number of outcomes. Let's write a simple program which produces output based on matrix number 1.
Click here to view/download the source.





