I need some help with this exercise: The infinitesimal generator of a continuous time Markov chain is the matrix \begin{equation} Q= \begin{pmatrix} -\lambda q & \lambda q\\ \lambda p & -\lambda p \end{pmatrix} \end{equation}
with $p+q=1$.
Compute the semigroup $P(t)=\exp(tQ)=\sum_{n=0}^\infty\frac{(tQ)^n}{n!}$.
SOLUTION
First i notice that: \begin{equation*} Q^n=\lambda^n\begin{pmatrix}-q & q\\ p & -p\end{pmatrix}^n=(-\lambda)^n\begin{pmatrix} q & -q\\ -p & p\end{pmatrix} \end{equation*} I set \begin{equation} A= \begin{pmatrix} q & -q\\ -p & p \end{pmatrix} \end{equation}
then the exponential becomes: \begin{equation*} P(t)=\exp(tQ)=\displaystyle\sum_{n=0}^\infty\frac{(tQ)^n}{n!}=\displaystyle\sum_{n=0}^\infty\frac{(-\lambda t)^n}{n!}A=\exp(-\lambda t)A \end{equation*}
Is it correct? Am I missing something?
You're almost correct, but you have to be careful about what happens in the case that $n = 0$. Although your result is correct for $n \geq 1$, the case of $n = 0$ yields $Q^0 = I$. To account for this, we could write $$ \exp(tQ) = (I - A) + \sum_{n=0}^\infty \frac{(- \lambda t)^n}{n!} A = (I - A) + \exp(-\lambda t) A. $$