counting the number of m in the initial state
for(n in 0:(2^K-1)){if(mbase_init[j] == n){
count_init_k[mbase_init[j]+1] = count_init_k[mbase_init[j]+1] + 1}}}