Let us consider the homogeneous continuous time Markov chain $(X\_t)\_{t\ge 0}$ with two states {0,1} and the intensity matrix


$Q=\begin{pmatrix}-\lambda& \lambda\\\ \mu& -\mu\end{pmatrix}$


Let $N\_t$ be the number of $1 \to 0$ transitions of $X\_t$ in the interval [0, t].


The main interesting question is to find the probability $p\_{ij}(k,t)=P(N\_t=k, X\_t= j| X\_0=i)$.


May be we can use its generating functions $P\_{ij}(z,t)=\sum\_{k=0}^{\infty}z^kp\_{i,j}(k,t)$ and recursion to obtain the result. 


Have any ideas for a calculation?



Number of transitions of a markov chain in a time interval
The usual infinitesimal analysis leading to a differential system applies, with a twist: for small $s>0$, 
$$
p\_{i0}(k,t+s)=(1-\lambda s)p\_{i0}(k,t)+\mu sp\_{i1}(k-1,t)+o(s),
$$ 
and 
$$
p\_{i1}(k,t+s)=(1-\mu s)p\_{i1}(k,t)+\lambda sp\_{i0}(k,t)+o(s),
$$ 
with the convention that $p\_{ij}(-1,t)=0$ for every $t\geqslant0$. Hence,
$$
\partial\_tp\_{i0}(k,t)=-\lambda p\_{i0}(k,t)+\mu p\_{i1}(k-1,t),
$$
and
$$
\partial\_tp\_{i1}(k,t)=-\mu p\_{i1}(k,t)+\lambda p\_{i0}(k,t).
$$
With the initial condition $p\_{ii}(0,0)=1$ for every $i$, $p\_{ij}(0,0)=0$ for every $i\ne j$, and $p\_{ij}(k,0)=0$ for every $(i,j)$ and every $k\geqslant1$, this determines uniquely $p\_{ij}(k,t)$ for every $(i,j)$, $k\geqslant0$ and $t\geqslant0$.


