I'm looking for a formula to subtract a percentage (e.g. $10\%$) from a number (e.g. $100$) a certain number of times (e.g. $4$) in which case:
$p=0,1$ (i.e. $10\%$)
Doing it manually goes like this:
$y_1 = 100 - 10\% = 90$
$y_2 = 90 - 10\% = 81$
$y_3 = 81 - 10\% = 72.9$
$y_4 = 72.9 - 10\% = 65.61$
The formulas for these steps I've managed to figure out are:
- $y_1 = x - 1\cdot px$
- $y_2 = x - 2\cdot px + 1\cdot p^2x$
- $y_3 = x - 3\cdot px + 3\cdot p^2x - 1\cdot 0.1^3x$
- $y_4 = x - 4\cdot px + 6\cdot p^2x - 4\cdot0.1^3x + 0.1^4x$
The formula 'grows' with each iteration.
Is there a single universal formula that would use $x$, $p$ to find $y_n$ for any $n$?
I suppose in function notation the question would look like $y = f(x,p,n)$.