count\_0\_k1[i,2] counts the number of transitions from zero to one in row i, #count\_1\_k1[i,1] counts the number of transitions from one to zero in row i # count\_1\_k1[i,2] counts the number of transitions from ne to one in row i

```
limsup = sum(alpha_init_k+count_init_k) - sum(alpha_init_k)
for(k in 0:(limsup-1)){prod_2_init = prod_2_init*((sumalphacount-1)-k)^(-1)}
prod_init_k = prod_1_init*prod_2_init
term_init_like[K+1] = prod_init_k