Solved

# find all possible sequence value from a matrix

Posted on 2006-10-30

hi,

| a | b | c |

---------------------------------|

a| 0.5 | 0.25 | 0.25 | =1

---------------------------------|

b| 0.375| 0.125 | 0.375 | =1

---------------------------------|

c| 0.125| 0.675 | 0.375 | =1

-----------------------------------

I need calculate the probability from a above matrix

for example, if I want to find a sequence of aab, it should calculate like:

a-->a-->b = 0.5 * 0.25 = 0.125

could someone give me some codes to find "all possible paths" for any given sequence? for example for sequence of 3, there is 3^3=27 possible paths (aaa,aab,aac, aba....ccc.etc). I want to find the probability of all 27 paths.