Input -->[10,20,30,40,50]
Desired Output ---> [10,19.21,56.51,110.83,181.14]
**Calculation**
10-->10
20-->20*exp(-0.04)
30-->30*exp(-0.04)+((30*exp(-0.04))*exp(-0.04))
40--->40*exp(-0.04)+((40*exp(-0.04))*exp(-0.04))+(((40*exp(-0.04))*exp(-0.04))*exp(-0.04)))
Attaching calculation table for easy understanding
Please help me to write function to resolve the above issue using R and python code
Not sure how to do this in
R
but it is pretty straightforward inPython
. You will neednumpy
for this in order to get the exponential of-0.04
.