If 'x' is the level of the killed hero, the amount of experience gained is: f(x) = f(x-1) + 20x; f(0) = 220; What is the experienced gained if the killed hero is level 5?
We can do this recursively. Start by finding what f(1) is. Since you know what f(0) is, you can calculate f(1) by plugging in 1 for x and substituting f(0).
\[ \begin{split} f(x) &= f(x-1)+20x\\ &= (f(x-2)+20x)+20x\\ &= f(x-2)+2\cdot 20x \\ &=f(x-x) +x\cdot 20x\\ &=f(0) + 20x^2\\ f(x) &= 20x^2+220 \end{split} \]
ok
Hold on, what I did was not quite correct though.
Since I should have put \(f(x-1)=f(x-2)+20(x-1)\).
So \[ \begin{split} f(x) &= f(x-n) + 20x\sum_{k=1}^{n}x+1-k\\ &=f(x-n) +20x\left(n(x+1)+\frac{n(n+1)}{2}\right) \end{split} \]
This is a bit trickier, so it may be easier to just it manually.\[ f(1) = f(0) + 20(1) = 220+20 = 240\\ f(2) = f(1) + 20(2) = 240+40 = 280\\ \dots \]
ok thank you for all your help i appreciate it
Join our real-time social learning platform and learn together with your friends!