In equation (2), θk denotes the template switch probability between markers k and k+1 (analogous to a recombination fraction), Sk+1 is the genotype in the study sample, P(Sk+1|Yi) is the genotype emission probability, and Ni is the number of haplotypes matching Yi in the original state space (for example, in Fig. 1, N1 = 4, N2 = 2, and N3 = 2). Once we obtain LQ(.) values for all the reduced states, we use them to calculate LQ(Xj) at the final block boundary, enabling us to transition between blocks. To accomplish this, we split probability LQ(.) into two parts, LQNR(.) and LQR(.), where LQNR(.) denotes the left probability at marker Q when no template switches occur between markers P and Q and LQR(.) denotes the probability when at least one switch occurs. This leads to equation (3) (where i is such that Yi = Xj) (3)LQ(Xj)=LQR(Yi)×[1Ni]+LQNR(Yi)[LP(Xj)LP(Yi)]