Distribution of waiting time conditioned on a fixed time length

37 Views Asked by At

Suppose, I work in a factory production line. The time for me to finish wrapping product A (or B) is exponentially distributed with parameter $\lambda_1$ (or $\lambda_2$), i.e., $X\sim\exp(\lambda_1)$, $Y\sim\exp(\lambda_2)$. My routine is to take turns wrapping product A and B. I start with A, which takes $X_1$ time, then $B$, which takes $Y_1$ time, and so on. When I finish wrapping $A$, no time is lapsed before I start wrapping B. When my legal daily working hour $T$ is reached, I stop working immediately. I am interested in how many $A$ and $B$ I have wrapped during this $T$ time period. I want to know the distribution of numbers of product A or B, expectation and variance. Also I want to know the conditioning on $T$, the distribution of time $T_1$, $T_2$ and so on.

Let $$f_X(x)=\lambda_1\exp(-\lambda_1x)$$ $$f_Y(y)=\lambda_2\exp(-\lambda_2y)$$ Let $N(A)$ (or $N(B)$) to represent the number of product A (or B) I have wrapped during the time period $T$. Then, $$P(N(A)\ge n)=\int_0^T f_X\star f_Y\star \cdots\star f_X(x) dx$$ where $\star$ denotes convolution and in this expression $f_X$ is convoluted $n$ times.

I am wondering is there a closed formula for this pmf and its expectation and variance. Similarly, we can work out $N(B)$. Is there a closed formula for its pmf and its expectation and variance? Conditioned on $T$, what is the distribution of $T_1$, $T_2$ and so on. I am sure there are literature results on this, kindly let me know some references as well.