0

I've been struggling with what is probably some basic mathematics. I've got a summation formula which I use to calculate the 'experience' required to reach a particular 'level'. The formula:

$experience\;=\;\left\lfloor\frac14\times{\textstyle\sum_{x=1}^{L-1}}\left\lfloor x+300\cdot2^\frac x7\right\rfloor\right\rfloor$

I've run into a few situations where I actually need to calculate the 'level' based off of the 'experience' and thus need to effectively invert the formula. Any ideas on how I would go about doing that? Example of the solved formula is below.

$\left\lfloor\frac14\times{\textstyle\sum_{x=1}^{2-1}}\left\lfloor x+300\cdot2^\frac x7\right\rfloor\right\rfloor\;=\;83$

I'd like to be able to provide $\\e=83$ and have it tell me that $\\l=2$

Celant
  • 3
  • 1
    The mix of polynomial and exponential terms will make inverting the formula hard. How about tabulating the values as a function of $L$ and looking them up in the table. A spreadsheet can automate it with VLOOKUP – Ross Millikan Dec 15 '19 at 22:07
  • @RossMillikan that was my first thought. This is actually being calculated within Javascript, but it was my first thought but my tired brain couldn't work out how to do that :) – Celant Dec 16 '19 at 12:14

1 Answers1

1

Starting from $L=2$, the formula generates the sequence $$\{83,174,276,388,512,650,801,969,1154\}$$ This could be quite well represented by $$E=83+\frac{33624 }{413}(L-2)+\frac{1467}{226}(L-2)^2$$ Rounding the results, this would generate the sequence $$\{83,171,272,386,513,652,805,971,1150\}$$ which is not too bad.

So, for a given value of $E$, at the price of a quadratic equation in $(L-2)$, you would have a "reasonable" estimate of $L$.

For sure, if the range of $E$ is more limited, repeat the regression work for the interval of interest.

Edit

Looking directly at the inverse problem, it seems that the simplistic $$L=\frac3 {31}\left(2+ E^{19/29}\right)$$ could be a quite good approximation. For example, using $E=600$, this would give $L=6.59$. Round the number the way you want.