# I need a math genius!

Chat about anything not covered in these forums, but keep it civil!

### » Thu Mar 07, 2013 10:08 pm

No, not really a genius. I'm so bad at maths anyone could probably help me out.

There is some kind of diminishing return pattern I want to use for my game, but I can't figure out the formula for it. Without a formula I'd have to use a long array of values for my variables to match up with. I can do that instead, but I'm curious if there is a formula exist for this kind of pattern.

It goes something like this: 100% -> 50% -> 33% -> 25%-> 18%-> 14%, and so on. The pattern pictures some kind of a declining curve graph in my mind, but I just can't remember any terminology related to that sort of mathematics to google it in the first place.
B
19
S
6
G
1
Posts: 116
Reputation: 2,730

### » Thu Mar 07, 2013 10:29 pm

I'd say try out y = (1/x+1) * 100. With an input of 0 'steps' you will get an output of 100, with input of 1 you will get 50, 2 gives you 33, 3 gives you 25, just as you asked.

See the graph here.sqiddster2013-03-07 22:29:26
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,739

### » Thu Mar 07, 2013 10:36 pm

One way to go about it is to look up graphs of various formulas and see which most closely matches the shape of a plot of your numbers. Then you could then use some sort of regression to find a formula for it.

In this case a little bit of intuition helped me find the formula. The more you do the easier it gets.

formula:
(1-n/(n+1))*100
where n is the nth number (0 for the first)

Edit: ninja'd with a simplified formula.R0J0hound2013-03-07 22:38:56
B
95
S
34
G
128
Posts: 5,497
Reputation: 81,682

### » Fri Mar 08, 2013 12:35 am

Thank you guys. Never have thought I'd be interested in maths one day.
B
19
S
6
G
1
Posts: 116
Reputation: 2,730