Clearing a manufacturing backlog I have a simple problem that I think I may be over complicating, but I'm not certain.  I work in a manufacturing environment as a process engineer and I'm setting up a calculator to determine how long it will take to clear our backlog from a certain step in our process.
There are two stages.  We'll call them X and Y.  Stage X can process a certain number of products a day.  And stage Y can process a certain number of products a day, but not necessarily equal to stage X. 
When stage X produces at a faster rate than stage Y, a backlog B is created. 
To clear the backlog as it stands at any particular moment, it will simply take B/Y.  However, while that backlog is being cleared, more cases are being added to it at a rate of X.  
So to clear the current backlog and the backlog that is created while clearing the current backlog, it will take B/Y + ( (B/Y) * (X) ) / Y.  
But... while you clear that additional backlog, the backlog is still growing.  So we have ourselves an infinite series (I think).  My questions is how can I simplify this into an equation that I can use programmatically (like in Excel or something)?  
I would think that calculating the number of days required to clear the backlog would only produce a number less than infinity if X is less than Y... 
 A: Let's call $X$ the number of units processed by stage $\mathbb{X}$ in one day, $Y$ the number of units processed in stage $\mathbb{Y}$ in one day, and $B_t$ the backlog on day $t$.  (I have used blackboard to distinguish numbers from names.)  The quantities $X$ and $Y$ are rates or flows, while $B_t$ is a stock.  If we start with some existing backlog, we'll call that $B_0$.
My initial way of thinking was slightly differently from yours.  Each day, some of the backlog goes through $\mathbb{Y}$ but some more is added from $\mathbb{X}$.  So, if we have $B_t$ units in backlog at the end of the $t^{th}$ day, on the $(t+1)^{st}$ day we have $B_{t+1} = B_t - Y + X$ units, since stage $\mathbb{Y}$ has processed $Y$ units from the backlog and stage $\mathbb{X}$ has added $X$ units to the backlog.  This would be an Excel formula.
A closed expression for the number of units in backlog is: $B_t = B_0 + (X - Y)t$.  If $X > Y$, then as your intuition suggests, the number of units in the backlog will grow forever.  If $X < Y$, then the initial backlog will be cleared after $\frac{B_0}{Y - X}$ days.
From your approach, at any initial backlog $B_0$, if $\mathbb{X}$ is turned off, the number of days remaining to clear the backlog is $B_0/Y$ days.  (This is also my answer if $X = 0$.)  
If $\mathbb{X}$ is turned on, then to clear the initial backlog, we still need $B_0/Y$ days.  In that time, as you note we have added $XB_0/Y$ units, which will take another $XB_0/Y^2$ days to clear.  But during that time, we have added $X^2B_0/Y^2$ units.  Here's where your thought was headed: the total time to clear the initial backlog $B_0$, if $X > 0$, is the infinite series
$$\frac{B_0}{Y} + \frac{B_0X}{Y^2} + \frac{B_0X^2}{Y^3} + \cdots = \frac{B_0}{Y}\sum_{k = 0}^\infty \bigg(\frac{X}{Y}\bigg)^k.$$
The sum is a geometric series.  As your intuition suggests (again correctly) if $X \geq Y$, the series diverges.  If $X < Y$, then the series converges to $\frac{1}{1 - \frac{X}{Y}} = \frac{Y}{Y - X}$, so 
$$\frac{B_0}{Y}\sum \bigg(\frac{X}{Y}\bigg)^k = \frac{B_0}{Y}\frac{Y}{Y - X} = \frac{B_0}{Y - X}.$$
This confirms that the algebra we did earlier was probably correct, and that your line of thinking was productive.  Hopefully this answers your question!
