-1

I am attempting to write a formula for the following:

if Input $0 - 50$ Result is $1$,

if Input $51 - 120$ Result is $2$,

if Input $121 - 271$ Result is $3$,

if Input $271 - 579$ Result is $4$,

if Input $580 - 1169$ Result is $5$,

and so on...

The maximum allowed value from result $1$ to result $2$ is a multiplication of $2.4$ times, but multiplying factor of this number I would like to decrease by $10 percent$ each time, so result $2$ to result $3$ is $2.26$ (1 + 1.4 * 0.9), result $3$ to result $4$ is $2.134$, result $4$ to result $5$ is $2.0206$ and so on.

i have rounded all inputs to the nearest significant figure as all inputs will be in whole numbers

  • 288*2.4 = 691.2 ? So are you taking GIF or something? – IamKnull Sep 10 '19 at 16:24
  • i rounded to the nearest whole number since all input will be whole numbers – Curiosa Sep 10 '19 at 16:28
  • So your intervals are not the same size, so all we have to work with is the interval number in the series of intervals....Given x=288 which interval would it be in, if you don't store the start and end of each interval? – NoChance Sep 10 '19 at 16:52
  • According to this description, your multiplication factor, which starts at $2.4$, then goes to $2.4\cdot0.9,$ then $2.4\cdot0.9^2,$ then $2.4\cdot0.9^3,$ and so forth. If you continue long enough like that, eventually your multiplication factor will be less than $1$ (so it makes things smaller). Is that the intention? – David K Sep 10 '19 at 18:49
  • good pont david, no this is not the intention, therefore i would like to take the 2.4 minus 1 to 1.4 then reduce this number by 10% each time ( *0.9 ) then add the 1 – Curiosa Sep 10 '19 at 19:10

1 Answers1

1

-Edit- This answer was written before the change to the problem including this "10% decrease in the increase amount each time" occurred.

$$\left\lceil\log_{2.4}\left(\frac{x}{50}\right)\right\rceil + 1$$

with the following exception made for when $x<50$ that it should output $1$

JMoravitz
  • 79,518
  • 1
    How does this account for the $10%$ decrease of the factor? – Arnaud Mortier Sep 10 '19 at 19:23
  • thank you JMoravitz, this works but doesnt include the 10% decrease to the multiplying factor, i tried replacing the '2.4' value with '1+1.4⋅0.9^x' but this doesnt work and whatever 'x' is the result is always 2. – Curiosa Sep 10 '19 at 19:28
  • @ArnaudMortier The "10% decrease of the factor" was not present in the question at the time this answer was written. – JMoravitz Sep 10 '19 at 19:32
  • With that included, I do not anticipate a particularly clean solution, you would probably be better off making a lookup table – JMoravitz Sep 10 '19 at 19:33
  • the problem with that is the input goes upto 300 million, which should make the result around 4,000 – Curiosa Sep 10 '19 at 19:37