Consider a binary HMM with 2 observed variables $O_n \in \{0,1\} \; \forall n \in \mathbb{N}$.
Suppose that the hidden Markov process $X_n$ is characterised by a known transition probability matrix $P$ with an also known initial distribution $\nu$. The observations $o_n$ are linked with the hidden variables $x_n$ in some way such that the emission probability matrix $B$ linking $X_n$ to $O_n$ is also known.
I was wondering if one would be able to work out a probability distribution of the number of $1$s (or zeros) in an arbitrary observation sequence $\textbf{O} = (O_1, O_2, \dots, O_n)$? I can calculate the run-time distribution but I would like to know if: $$T_n = \sum_{i=1}^{n} O_i, $$ then what is: $$f_{T_n}(x) = \mathbb{P}(T_n = x) \qquad x \in \{0, \dots, n\}$$
Any help would be appreciated! Thanks