Results 1 to 4 of 4

Math Help - Increasing gains in diminishing returns

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    2

    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.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member
    Joined
    Dec 2008
    Posts
    319
    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}<br />
10 &\rightarrow& (0.1) \\<br />
9 &\rightarrow& (0.1)(0.9) \\<br />
8.1 &\rightarrow& (0.1)(0.9)^2 \\<br />
7.29 &\rightarrow& (0.1)(0.9)^3 \\<br />
&\vdots&<br />
\end{array}<br />

    (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}<br />
5000 &\rightarrow& (0.1)\\<br />
10000 &\rightarrow& (0.1)(0.9)\\<br />
20000 &\rightarrow& (0.1)(0.9)^2\\<br />
40000 &\rightarrow& (0.1)(0.9)^3\\<br />
&\vdots&\\<br />
\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}<br />
5000 &\rightarrow& 0.5 &\rightarrow& 0 &\rightarrow& (0.1) \\<br />
10000 &\rightarrow& 1 &\rightarrow& 1 &\rightarrow& (0.1)(0.9) \\<br />
20000 &\rightarrow& 2 &\rightarrow& 2 &\rightarrow& (0.1)(0.9)^2 \\<br />
40000 &\rightarrow& 4 &\rightarrow& 3 &\rightarrow& (0.1)(0.9)^3 \\<br />
&&&\vdots&&&\\<br />
\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}}.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Oct 2009
    Posts
    2
    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://img24.imageshack.us/img24/7991/formula1i.jpg
    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.
    Last edited by dddolls; October 24th 2009 at 04:20 PM.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member
    Joined
    Dec 2008
    Posts
    319
    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!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Diminishing Returns Problem, Revenue Problem
    Posted in the Calculus Forum
    Replies: 0
    Last Post: May 9th 2011, 03:25 PM
  2. Working out welfar gains and losses from graph
    Posted in the Business Math Forum
    Replies: 0
    Last Post: October 27th 2009, 03:28 PM
  3. Replies: 2
    Last Post: March 22nd 2009, 12:48 AM
  4. Gains over time
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: March 15th 2009, 11:04 AM
  5. Micro econ help ! Diminishing returns?
    Posted in the Business Math Forum
    Replies: 0
    Last Post: February 7th 2009, 06:51 PM

Search Tags


/mathhelpforum @mathhelpforum