tags:

views:

34

answers:

1

I'm creating dummy data for an app, and want to simulate exponential growth while also knowing the final number. So here's the proposal:

  • Given T = 2000. Total number of "counts" an event will have occurred.
  • And N = 7. Days of the week: 7.days.ago.day..Time.now.day.
  • What is the simplest formula for dividing T by N such that we create an exponential curve?

How do you go about solving this so I can learn how you deal with practical math problems? I'd like to apply this formula to 3 different T's: 2000, 1000, and 400.

Update

Thanks to Mathias' formula, I came up with this:

# get "r"
# in math
x(t) = (1 + r) ^ t
x(7) = (1 + r) ^ 7 = 2000 # final value
r = (2000 ^ (1/7)) - 1 # solve for r
# in ruby
r = 2000**(1.0/7.0) - 1 = 1.96193629594517

# check
# in math
x(7) = (1 + r) ^ 7 = (1 + 1.96193629594517) ^ 7
# in ruby
(1 + 1.96193629594517)**7
#=> 1999.99999999998

# build curve
values = (1..7).inject([]) { |array, i| array << (1 + r)**i }
values = [2.96193629594517, 8.77306662123741, 25.9852644521882, 76.96669794067, 227.970456209519, 675.233968650155, 2000.0]

Thanks!

+4  A: 

If I understand your question properly, you have a process that follows an exponential growth, where you know the final value X, and you are observing the process at discrete time intervals.
An exponential growth, when reduced to discrete time intervals, progresses as a geometric series, i.e.
X(t+1) = X(t) * (1+r), where r is the growth rate.
In order to infer the growth, you need to know either the starting value, or the rate. I'll assume you have X(0), the initial value. In that case,
X(T) = X(0) * (1+r)^T
Which you can solve in r, the growth rate: (1+r) = (X(T) / (X(0)) ^ (1/T)
Hope this helps!

Mathias