Hello Professor,
The transitions are deterministic:
R -> G
G -> B
B -> R
This means that once the first hidden state is chosen, the rest of the hidden-state sequence is already fixed.
The observation sequence is:
1, 2, 3, 4, 1, 3, 1, 2, 3
Since the initial state is equally likely to be R, G, or B, we only need to check the three possible starting sequences.
If we start with R, the hidden-state sequence is:
R, G, B, R, G, B, R, G, B
But at time step 4, the hidden state would be R. This is impossible because R cannot emit observation 4. So this sequence has probability 0.
If we start with G, the hidden-state sequence is:
G, B, R, G, B, R, G, B, R
At time step 4, the hidden state would be G. This is also impossible because G cannot emit observation 4. So this sequence also has probability 0.
If we start with B, the hidden-state sequence is:
B, R, G, B, R, G, B, R, G
Now check the observations:
B emits 1 with probability 0.4
R emits 2 with probability 0.5
G emits 3 with probability 0.4
B emits 4 with probability 0.4
R emits 1 with probability 0.4
G emits 3 with probability 0.4
B emits 1 with probability 0.4
R emits 2 with probability 0.5
G emits 3 with probability 0.4
This is the only sequence where every observation has nonzero probability.
The likelihood is:
(1/3)(0.4)(0.5)(0.4)(0.4)(0.4)(0.4)(0.4)(0.5)(0.4)
First multiply the emission probabilities:
0.4 * 0.5 * 0.4 * 0.4 * 0.4 * 0.4 * 0.4 * 0.5 * 0.4 = 0.0004096
Including the initial probability:
(1/3) * 0.0004096 = 0.0001365
Since the other two possible sequences have probability 0, this one is the maximum likelihood explanation.
Final answer:
B, R, G, B, R, G, B, R, G
So the observation sequence was most likely generated by starting in Blue