## Phase-type distributions

Hello, can any one help me with discrete phase-type distributions? I need to derive formulate which answers questions:

What are the chance of being in state $\displaystyle i$ for the first time after $\displaystyle n$ time steps, given that you started in state $\displaystyle j$
I consider only phase-type distributions on the cannonical form:

$\displaystyle P = \begin{bmatrix} T & T^0 \\ 0 & 1 \end{bmatrix}$

Where $\displaystyle T$ contains all transient states, and $\displaystyle T^0$ is a vector such that $\displaystyle T^0 + T \mathbf{1} = (1,1,1,1,\cdots)$.
My problem is that I have no idea where to begin, can anyone point me in a direction?