# Probability of a sequence of events in a Poisson process.

I am starting to study Poisson processes and I came up with this question:

Let there be two Poisson processes with rates $\lambda$ and $\mu$ respectively, monitoring the occurrence of events (e.g. emissions or bus arrivals) $A$ and $B$. $A$ happens with rate $\lambda$ and $B$ with rate $\mu$.

Let $ABA$ be the event that $A$,$B$,$A$ happen in that particular order.

What is the probability that a particular sequence of events happens? For instance, what are $P(ABAAB)=?$ and $P(BBBBBA)=?$

Poisson process is memoryless so after $n$ arrival, the probability of $A$ be the first arrival (or similarly for $B$) remains same for all $n$.
Suppose that $X$ is the first arrival of the Poisson process with parameter $\lambda$ and $Y$ is the first arrival of the Poisson process with parameter $\mu$. From another question we know that $P(X>Y)=\frac \mu{\mu+\lambda}$. Therefore the probability that you get a sequence of points starting with $B$, is simply $\frac \mu{\mu+\lambda}$.
Therefore, the probability of getting a first sequence of $n$ points as $ABABBA...$ with number of $A$'s as $k$, is equal to: $$\left(\frac \lambda{\mu+\lambda}\right)^{k}\left(\frac \mu{\mu+\lambda}\right)^{n-k}.$$