Number of events of type B given n events of type A in a Poisson process I have a simple probability calculation I was working on that I came up with an answer for, but a question a colleague asked me led me to come up with a second approach - and a different answer. I put it aside at the time (a couple of years ago), but now it's niggling at me. 
I think my original answer is correct because of other considerations, but I failed to identify a flaw in either approach; I'd appreciate responses that throw light on why one of them must be wrong.
Imagine two (independent) Poisson processes ('type A' and 'type B' say) happening along an interval; type A happens at rate $k_1 . \lambda$ and type B at rate $k_2 .\lambda$, where $k$'s are known (this could also be regarded as a partitioned Poisson process). However, we only see the type A events (we observe $n > 0$ events of type A). The idea is to try to get the distribution of the type B events given the observed type A. Putting the B events in lower case (to emphasize that we haven't seen them):
  | b  A  b b A   A   b   AA  b bb  A b |
  0                                     1

Regarding type A as 'success' and B as 'failure' - recognizing that ignoring the actual times (which we don't actually observe) - and just considering the ordering of the events, it's immediately clear that the number of b's up to the $n^{th}$ A is NegBin$(n,p)$ where $p = k_2/(k_1 + k_2)$ (this being the 'count the failures' version of the Negative Binomial, rather than the 'count the trials' version).
The problem comes with how to deal with the number of events between the last A and the end of the interval. 
One way to look at it is to now consider looking from the right end toward the left. The number of failures to the first success from the right is NegBin$(1,p)$, making the total number of type B events conditional on $n$ events of type A in the entire interval NegBin$(n+1,p)$.
The other way to look at it is to regard the whole interval as being on a circle. Now, between each consecutive pair of A's, the number of B's is NegBin$(1,p)$ and with $n$ such intervals the total number of B's is NegBin$(n,p)$. 
(The first argument is the one the colleague's question led me to make)
By the memoryless property, it shouldn't matter where the interval starts; each time, the number of events to the next A should be NB$(1,p)$
Yet the answers cannot both be correct. Which is wrong?
 A: Dare I say that both answers are wrong? Since $A$ and $B$ come from independent processes, the number of events of type $A$ in the $[0,1]$ interval has no effect on the number of events of type $B$ on the same interval. So the distribution of $B$s is still $Pois(k_2\lambda)$.
Here is a quick simulation study to demonstrate that:
R <- 10000
lbda <- 10
k1 <- 1
k2 <- 1.2
a <- rpois(R, lambda=lbda *k1)  # number of type A events
b <- rpois(R, lambda=lbda *k2)  # number of type B events
n <- 5
# select the samples where there are 'n' type A events
b.short <- b[a==n]
# plot results
plot(ecdf(b.short), main="Conditional distribution of B", xlim=c(0,max(b.short)))
 curve(ppois(x, lambda=k2*lbda), col=2, add=TRUE)
 curve(pnbinom(x, size=n, prob=k2/(k1+k2)), col=3, add=TRUE)
 curve(pnbinom(x, size=n+1, prob=k2/(k1+k2)), col=4, add=TRUE)
 legend(0, 1, c("Simulated","Poisson", "NB(n,p)", "NB(n+1,p)"),
        col=1:4, lty=1, pch=c(19,NA,NA,NA), xjust=0, yjust=1)


Of course, this is not very helpful, because we do not know $\lambda$. We can, however, estimate it from the number of observed $A$s. From here, you would have to be specific about the estimate, and then one might be able to talk about the properties of $\hat{B}$.
EDIT: prediction interval
It seems that you are interested in the distribution of $B$ only for the purposes of a prediction interval. I think you can use your argument to build one. Let $B_n$ be the number of $B$ events before the $n$th $A$ event.  Then $B_n \sim NB(n,p)$ and $B_A | A=n \sim NB(A,p)$, and for any given sample $B_n \leq B \leq B_{n+1}$. So it is not unreasonable to use the prediction intervals for either of them. At a first glance, the first should undercover, while the second overcover, but in practice discrete confidence intervals often overcover, so even the first one could be OK.
Just to follow up on the previous simulation:
coverage <- function(values, ints){
    mean( (ints[,1] <= values) & (values <= ints[,2]))
}
pred1 <- cbind(qnbinom(0.025, size=a, prob=k1/(k1+k2)), 
               qnbinom(0.975, size=a, prob=k1/(k1+k2)))
pred2 <- cbind(qnbinom(0.025, size=a+1, prob=k1/(k1+k2)), 
               qnbinom(0.975, size=a+1, prob=k1/(k1+k2)))   
# correct prediction interval
pred3 <- cbind(qpois(0.025, lambda=k2*lbda), 
               qpois(0.975, lambda=k2*lbda))

coverage(b, pred1)
[1] 0.9565
coverage(b, pred2)
[1] 0.9632
coverage(b, pred3)   
[1] 0.9593

So pred1 undercovers with respect to the "correct" intervals (which overcover), and pred2 overcovers compared to it. Also note that a benefit of the $NB(n+1,p)$ interval is that it is defined even for $n=0$.
Just to summarize, neither of the arguments are correct, $B|A$ still has a Poisson distribution, but both of your distributions could be used for a reasonable prediction interval of $B$.
A: Sorry for having taken so much time to correctly read the statement of the problem. The Poisson processes just hide the problem. Basically you have two independent Poisson variates $X_1 \sim {\cal P}(\lambda k_1)$ and $X_2 \sim {\cal P}(\lambda k_2)$ with known $k_1, k_2$ and unknown $\lambda$, and based on a realization $x_1$ of $X_1$ the goal is to predict the realization $x_2$ of $X_2$. 
A Bayesian approach with the Jeffreys/Bernardo prior provides a prediction interval enjoying very good frequentist properties. Assume the Jeffreys prior $\Gamma(\frac12,0)$ on $\lambda$. Then after observing $x_1$ the posterior distribution on $\lambda$ is $\Gamma(x_1+\frac12, k_1)$. Integrating the distribution of $X_2$ with respect to $\lambda$ over this posterior distribution yields the ${\cal P}{\cal G}(x_1+\frac12, k_1/k_2)$ (Poisson-Gamma) distribution as the posterior predictive distribution of $x_2$, which is the same as the negative binomial distribution ${\cal N}{\cal B}(x_1+\frac12, k_1/(k_1+k_2))$. Taking quantiles of this distribution provides a prediction interval about $x_2$.
