I've been working on this for few hours and no luck. I'd appreciate any help.

Based on the Viterbi algorithm, marginal probability of a sequences being generated by a given HMM model with the Forward algorithm, I'm trying to calculate both, the most probable path-Viterbi- as well as the marginal probability of observing the sequence “ILDE”, for the model defined below.

a. The model has two possible states: transmembrane state (TM) and non-transmembrane state (NT)

b. The state transition matrix A:

S _{t+1}TM NT S _{t}TM 0.8 0.2 NT 0.2 0.8

a. The emission matrixE:

Amino Acids L I E D State TM 0.45 0.45 0.05 0.05 NT 0.05 0.05 0.45 0.45

Assume that transition fromtostart stateorTMhas equal chance 0.5.NT