# Thread: Increasing gains in diminishing returns

1. ## Increasing gains in diminishing returns

Hello Math Help Forum,

I'm working on a web script for a game that will increase a stat in diminishing returns depending on the value of that stat.

For instance, a user with 5000 Stat points will gain a 10% bonus to their stats per day, so it will be 5050 the next day.

However, I need to figure out a formula so users with higher Stat points, for example 10000, will receive less of a bonus. As an example I'll list how it should scale below (the checkpoints of 5000, 10000, 20000, etc were just doubled each time since I figured it would scale better if the checkpoints weren't as frequent as "every 5000 points". If it would be better to do it another way please tell me.)

5000 - 10% per day
10000 - 9% per day
20000 - 8% per day
40000 - 7% per day
80000 - 6% per day
160000 - 5% per day

And so on. This was my original idea, but then we would have a problem when it reaches below 1% because it would scale unevenly. I need a formula that will indefinitely scale down, so maybe something it should be reduced by 10% each time? For example,

5000 - 10% per day
10000 - 9% per day
20000 - 8.1% per day
40000 - 7.29% per day
80000 - 6.56% per day
160000 - 5.9% per day

(I rounded the percentages down for simplicities sake.)

So my question is, is there a formula that I could use so the returns will automatically diminish over time? Thanks for your time, and please tell me if I wasn't clear enough in my description.

2. The game you're writing sound interesting, and yes, there is a formula that allows us to obtain the percent bonuses you've given. The percentages can be listed as follows:

$\begin{array}{rcl}
10 &\rightarrow& (0.1) \\
9 &\rightarrow& (0.1)(0.9) \\
8.1 &\rightarrow& (0.1)(0.9)^2 \\
7.29 &\rightarrow& (0.1)(0.9)^3 \\
&\vdots&
\end{array}
$

(Sorry, I haven't figured how to display percentages yet.) Now we need a function that will map the Stat points as follows:

$\begin{array}{rcl}
5000 &\rightarrow& (0.1)\\
10000 &\rightarrow& (0.1)(0.9)\\
20000 &\rightarrow& (0.1)(0.9)^2\\
40000 &\rightarrow& (0.1)(0.9)^3\\
&\vdots&\\
\end{array}$

On the left, we see multiples of $10000$ increasing in powers of $2$, and on the right we see $0.9$ increasing one power at a time. To get the power of $0.9$ from a number on the left, we may therefore divide by $10000$, take the base $2$ logarithm of the result, add $1$ in this case, and raise $0.9$ to that power:

$\begin{array}{rcccccl}
5000 &\rightarrow& 0.5 &\rightarrow& 0 &\rightarrow& (0.1) \\
10000 &\rightarrow& 1 &\rightarrow& 1 &\rightarrow& (0.1)(0.9) \\
20000 &\rightarrow& 2 &\rightarrow& 2 &\rightarrow& (0.1)(0.9)^2 \\
40000 &\rightarrow& 4 &\rightarrow& 3 &\rightarrow& (0.1)(0.9)^3 \\
&&&\vdots&&&\\
\end{array}$

This operation can be summarized as

$S\rightarrow\frac{S}{10000}\rightarrow\log_2{\left (\frac{S}{10000}\right)}+1\rightarrow(0.1)(0.9)^{\ log_2{\left(\frac{S}{10000}\right)+1}},$

which gives us the formula

$S=S+S\cdot(0.1)\cdot(0.9)^{\log_2{\left(\frac{S}{1 0000}\right)+1}}.$

3. Thank you Scott H, you have no idea how much you're helping me here.

I tried out the formula you provided, but found it's not scaling fast enough. After some testing I decided it would be best if the gains will be between 0.5%~1% by the time the stat is at 500,000 or so.

A method a friend suggested is this formula:

base = 0.1
factor = 60,000

= (base * ( Stat / (Stat * ( 1 + (Stat/ factor)) )))

http://img43.imageshack.us/img43/1484/formula2.jpg

This is the result; my main concern is that it "plateaus" at around 5000 numerical gain and doesn't budge much from there. While this isn't a big problem, I wonder if it can transition smoother. Also the image shows scaling starting at 1000, but I'd like it to start scaling from 10000 or so.

Is there a bigger advantage in using log functions like your method? I'm willing to try both methods, but so far this formula seems easier to edit the values.

I know this formula is completely different so I may be missing something big here.

4. The formula your friend gave simplifies to

$b\frac{S}{S\left(1+\frac{S}{f}\right)}=\frac{bS}{\ frac{fS}{f}+\frac{S^2}{f}}=\frac{bfS}{fS+S^2}=\fra c{bf}{f+S}=\frac{6000}{60000+S}.$

After graphing, it appears that your formula involving logarithms does not plateau in the way that your friend's does. To get the effect you desire you could try various constants to adjust the Stat increments or different functions that increase with the value of $S$. Other than that, I'm not sure what it is you're looking for.

Best of luck!