So I have a function (I'm writing this in a pseudo-functional language, I hope its clear):
dampen (lr : Num, x : Num) = x + lr*(1-x)
And I wish to apply this n times to a value x. I could implement it recursively:
dampenN (0, lr, x) = dampen(lr, x)
dampenN (n, lr, x) = dampenN(n-1, lr, dampen(x))
But there must be a way I can do it mathematically without resorting to an iterative procedure (recursive, or a loop).
Unfortunately my algebra skills are rusty beyond belief, can anyone help?