Not sure how to solve this. Need help!

unenergizer

New member
Joined
Aug 6, 2015
Messages
2
Hi everyone,

I am having a problem coming up with a solution to my problem. I like to do computer programming as a hobby, and am trying to make something, but I am having a hard time getting past this particular math problem. This is a chart that I have:

Code:
6 = 100
8 = 
10 = 
12 = 
14 = 
16 = 
18 = 
20 = 
22 = 
24 = 
26 = 
28 = 
30 = 
32 = 
34 = 
36 = 
38 = 
40 = 49,000

I need to fill in the chart above with numbers after the equals sign. What I am trying to achieve is what I believe to be a quadratic formula.

The numbers on the left side represent a players hearts in a video game and on the left side, is their actual hit points (health). A player should start with 6 hearts and 100 health. As their health goes up, the player gains more hearts. However, there needs to be a gradual curve making getting hearts in the beginning easy and as time goes by, it gets harder. This would be similar to gaining levels in a RPG game.

I have done several hours of googling. But unfortunately I have come to the conclusion that my math skills are rusty and I need to pick up a math book (and i did purchase one yesterday). I would be very grateful if someone could help me solve this problem and explain how it should be solved.

If any of the information is unclear, please let me know and I will do by best to fill in any gaps.

Thank you for your time!
 
Hard to tell what you're trying to so.
If you want the 100 to grow to 49000 exponentially,
then you'd treat problem as a financial problem,
with an initial deposit of $100 growing to $49,000,
at an interest rate that cause this to happen.

Calculated this way:
p = present value (100)
f = future value (49000)
n = number of years (17)
i = annual interest rate (?)

Formula: f = p(1 + i)^n
49000 = 100(1 + i)^17
(1 + i)^17 = 490
1 + i = 490^(1/17)
i = 490^(1/17) - 1
That'll result in .4396165... or annual rate of ~43.96 %

And the "bank account" will look like:
Code:
YEAR     INTEREST       BALANCE
  0                      100.00
  1         43.96        143.96 ....43.96% : get it?
  2         63.29        207.25
....
 16     10,393.85     34,036.84
 17     14,963.16     49,000,00
So you can use above to represent YOUR schedule...

Thank you for the help. I greatly appreciate your assistance with my problem. :p

Just to make sure we are on the same page. Would your equation give me results like the following graph?
attachment.php
 

Attachments

  • graph.jpg
    graph.jpg
    18.1 KB · Views: 13
Hi everyone,

I am having a problem coming up with a solution to my problem. I like to do computer programming as a hobby, and am trying to make something, but I am having a hard time getting past this particular math problem. This is a chart that I have:

Code:
6 = 100
8 = 
10 = 
12 = 
14 = 
16 = 
18 = 
20 = 
22 = 
24 = 
26 = 
28 = 
30 = 
32 = 
34 = 
36 = 
38 = 
40 = 49,000

I need to fill in the chart above with numbers after the equals sign. What I am trying to achieve is what I believe to be a quadratic formula.

The numbers on the left side represent a players hearts in a video game and on the left side, is their actual hit points (health). A player should start with 6 hearts and 100 health. As their health goes up, the player gains more hearts. However, there needs to be a gradual curve making getting hearts in the beginning easy and as time goes by, it gets harder. This would be similar to gaining levels in a RPG game.

I have done several hours of googling. But unfortunately I have come to the conclusion that my math skills are rusty and I need to pick up a math book (and i did purchase one yesterday). I would be very grateful if someone could help me solve this problem and explain how it should be solved.

If any of the information is unclear, please let me know and I will do by best to fill in any gaps.

Thank you for your time!

One way to approach this is to look at the derivative (how fast the curve increases/decreases). You want the derivative to be bigger at the end than at the beginning but how much bigger. Looking at what is given, you could choose ratio of how much bigger to tie down another parameter and finally play with the last to see if you can get what you want. The 'easiest' increasing function is probably the polynominal such as a quadratic. However, you could also use higher order polynominals depending on just how fast you want to growth to be.

An example: We want to ratio to be 50. That is, if the increase from 6 to 8 is 10 then the increase from 38 to 40 is 500. To start with lets assume the highest order of our polynomial dominates so that at 6 [that should get us in the right ball park]. Assuming a polynomial of degree n whose nth coefficient is a, we then have
f' (6) ~ n a 6n-1
f'(40) ~ n a 40n-1
The ratio is about (40/6)n-1. We want that to be about 50. Well, 40/6 is about 7, 72 is 49 which is about 50, so a cubic (n-1=2) seems to be a possibly good choice and we have
Health = 100 + \(\displaystyle (\frac{hearts-6}{34})^2\, (hearts + 4760)\)

Now actually the way the above equation is written you can can play around with the squared part of it to see what happens. That is you could change the 2 exponent to 1 or 3 or even 2.123 to get that (approximate) ratio of 50 we wanted.


EDIT: Whoops - that is a 49000, not a 4900. Well just change the 4760 to 49000-40-100=48860 [and the 2.123 becomes 2.126]
 
Last edited:
Top