Sum of fractions until it's smaller than a threshold I have a program that reads a history of data and does a computation on it, one timestep after the other, until it's caught up with the present.
I'm trying to predict when that will happen.
The catch is that while it was processing the history, new history has been happening, which will need to be processed as well, and so on until processing the last time step takes less time than the time between two timesteps.
For instance, let's say I have a timestep every hour, and it takes me 15min to compute it. If I have 24h to catch up on, I'll start working on those 24h, and after 6h I'll be done with those, but have 6 new hours to process, which will take me 1.5h, and those 1.5h will take 22.5min to catch up, and that's when I'm done catching up with the history and I'm now running live.
$6+1.5+.375=7.875$ hours to catch up.
From my recollection of math classes, $\sum_{k=1}^{\infty} \frac{1}{2^k}=1$, but I can't figure out how to make it generic, ie. given a timestep interval, a time to process it, and a length of history to catch up, how to predict when the process will have caught up and be running live?
Thanks for your help!
 A: Say your initial block of time to work through is $H$ hours, and in 1 hour you can process $m$ hours worth of data. (So in the example given, $H=24$ and $m=4$.) $x$ hours from now, you'll have processed $xm$ hours of data, and the total accumulation through that point, processed or not, will be $H+x$. Thus we just want the value of $x$ that make these quantities equal! That is, $xm=H+x$, or
$$x=\frac{H}{m-1}.$$
(In the example, this gives an answer of 8, which is indeed where your partial sum seemed to be tending. Notice that after processing the 1.5 hours in 22.5 minutes you still have 22.5 minutes, if you allow for continuous receipt of data, which is why our answers are slightly different; to make it exactly analogous, you want to solve for $x$ in $xm=\lfloor H+x\rfloor$, which I don't think has so explicit a solution. Notice also that each term in your sum is a quarter of the previous one, so the infinite sum you wanted was $\sum\limits_{n\ge1}\frac{1}{4^n}=\frac{1}{3}$, and indeed when you scale back up by 24 to represent the initial backlog you get exactly 8.)
