Need help with formula: 100 => 0.00, ..., 50 => -0.125, ..., 1 => -0.250

ihatejs

New member
Joined
Dec 18, 2017
Messages
1
Hi,

Sorry for the bad title, but not having English as my native language, I simply do not know the correct math phrases :)

Anyway, I am struggeling with a formula for some software I am developing, and I could surely use your help.

Code:
Value (A) = Result (B)

A = B

--------------------

100 = 0.00
...
50 = -0.125
...
1 = -0.250
As you can see from that short snippet, I would need to have an algorithm that takes a value A and gives the result B. The maximum for A is 100 (which gives: 0.00), and minimum = 1 (which gives: -0.250).

I hope my description is clear enough :)

Regards
 

mmm4444bot

Super Moderator
Staff member
Joined
Oct 6, 2005
Messages
10,255
100 = 0.00
...
50 = -0.125
...
1 = -0.250
Those three points do not lie on a straight line. If you want a single formula, then it can't be linear, but a parabola goes through those three points (its graph appears almost linear from 1 to 100). Do you care what type of model is used?

Also, is this homework?
 

mmm4444bot

Super Moderator
Staff member
Joined
Oct 6, 2005
Messages
10,255
Denis, I had considered whether ihatejs meant A starting at zero, instead of one. Yet, ihatejs said it was a struggle to figure out the formula (B=-0.0025A). This is why I decided to go with what they posted. Your guess is possible; maybe ihatejs will confirm it, for us. :cool:
 

BeeCuz

New member
Joined
Jun 6, 2016
Messages
17
Code:
Value (A) = Result (B)
100 = 0.00
...
50 = -0.125
...
1 = -0.250
As you can see from that short snippet, I would need to have an algorithm that takes a value A and gives the result B. The maximum for A is 100 (which gives: 0.00), and minimum = 1 (which gives: -0.250).
The graph is a line.

Capture.PNG
 

mmm4444bot

Super Moderator
Staff member
Joined
Oct 6, 2005
Messages
10,255
The graph is a line.
You may have misread something. The following (x,y) points are given, in the OP.

(1, -0.250)

(50, -0.125)

(100, 0)

These points do not lie on a straight line, and the equation

y = 0.0025x - 0.2521

is not true for any them.
 

mmm4444bot

Super Moderator
Staff member
Joined
Oct 6, 2005
Messages
10,255
… I could surely use your help.
You didn't answer my questions. Were you able to find what you need? :cool:

Here's a formula that provides a smooth transition from (1,-0.250) to (100,0). It's based on a quadratic-polynomial model:

y = (-1/1000)*(5/9702·x^2 - 8335/3234·x + 1225250/4851)
 
Top