Struggling to see a very simple way to do the following calculation. It strikes me that it must be similar to working out what percentage of uranium atoms in a sample of uranium will decay in a given period, that's why i mentioned half life in the title.
Imagine there is a pool of programmers. Some have signed up to stackoverflow, and the others (Ustart) have not.
I know that every month, a fixed proportion Rsignup of the remaining will sign up. Rsignup is a number between 0 and 1 (so if 50% of the unsigned will sign up every month, Rsignup = 0.5).
I want to know, after each month, how many will have signed up in total between now and the end of that month. Let's call the total number of new signups S.
Working it out by hand - let's say that Ustart = 100, ie there are 100 unsigned-up programmers. My signup rate Rsignup is 40%.
After 1 month:
signups this month = 100 * 0.4 = 40. There are 60 left.
total signups S = 40
After 2 months: signups this month = 60 * 0.4 = 24. There are 36 left. total signups S = 64
After 3 months: signups this month = 36 * 0.4 = 14.4. There are 21.6 left. total signups S = 78.4
After 4 months: signups this month = 21.6 * 0.4 = 8.64. There are 12.96 left. total signups S = 87.04
etc
BTW - it's fine that i'm using floats along the way, even though there's no such thing as 0.4 of a programmer: as long as i round my final figure down i'll get a sensible answer.
So, i can do this by hand-cranking it through a loop, but it feels like there must be an equation for it. What i'd like to produce ultimately is a table with different values for Rsignup down the left, and a grid of months to the right, showing the total percentage after that many months, for that value of Rsignup. For this, i'd just want an equation that i can pump Rsignup and NMonths into, and get S back.
thanks in advance - Max
Ustart - (Ustart * (1 - Rsignup) ^ NMonths)to get the total signed up in that time. Brilliant. If you want to put that in an anwer i'll tick it. cheers – Max Williams Jun 11 '14 at 08:15