Assume a binary sequence $X = (X_t)_{t=1}^T$ such that first $1 \leq N < T$ values are ones and last $T-N$ are zeros. Now define a new sequence $Y = (Y_t)_{t=1}^T$ such that \begin{align} Y_t = \begin{cases} 0 \text{ if } X_t = 0\\ 1 \text{ with probability }p \text{ if } X_t = 1 \\ 0 \text{ with probability }1 -p \text{ if } X_t = 1 \end{cases} \end{align} i.e. Bernoulli trials over $(X_1,...,X_N)$. Now, my question is: what is the expected number of zero-runs in $Y$?
I think that the easiest way would be to count transitions $1\to0$, since \begin{align} \sum_{t=1}^{T-1}\mathbb{1}\{Y_{t-1} = 1, Y_t = 0\} = \text{number of 0 runs}. \end{align} (but that works ONLY if $Y_1= 1$). Obviously, $\mathbb{P}(Y_{t-1} = 1, Y_t = 0)=(1-p)p$, and there are $N-2+1$ possible ways to place it in the sequence $(Y_1,...,Y_N)$ (however, since $Y_{N+1} = 0$, then also $Y_N=1$ is acceptable which complicates the derivation). If there is only a single $01$, then it has to be proceeded by a sequence of zeros and followed by sequence of either zeros or zeros and then ones. This quickly becomes intractable: is there any other way to approach this problem? Hints, rather than full derivations, would be much appreciated.
EDIT: I’ve come up with the following. I can think of that $10$ subsequence as of a success in a Bernoulli trial that is performed $N-1$ times. So, the number of successes follows $\text{Binom}(N-1, p(1-p))$, but since we can have $Y_N = 1$ which automatically gives $Y_{N+1} = 0$, the result is $(N-1)p(1-p) + (1-p)$. Is it by any means true?