0
$\begingroup$

My mind is fried and I just can't think of what formula I would use for this.

I have a range of 0% to 100% that I pick. Let's call this X.
At the end of the equation 0% will be equal to 1 and 100% is equal to 0.


So for example, if X = 100%, then the result is 0, and if X = 0% then the result is 1. If X = 70%, then the result is 0.3, and if X = 30%, then the result is 0.7. So on and so forth.

| cite | improve this question | | | | |
$\endgroup$
  • $\begingroup$ Must your formula be linear? Exponential? Sinusoidal? There's infinitely many ways to do this. $\endgroup$ – Sean Roberson Nov 28 '16 at 16:49
  • $\begingroup$ Sean, I'd like it to be linear. Whatever is simplest is best, really. $\endgroup$ – lolikols Nov 28 '16 at 16:50
0
$\begingroup$

Based on new information, you wish to have a linear function $f: [0, 1] \to [0, 1]$ such that $f(0) = 1$ and $f(1) = 0$. This is easy to do.

First see that we have a y-intercept: $f(0) = 1$. Next we need the slope, again easy:

$$ m = \frac{0 - 1}{1 - 0} = -1 $$

and so your formula is $f(x) = 1-x$.

| cite | improve this answer | | | | |
$\endgroup$
  • $\begingroup$ Sorry Sean, I guess linear isn't what I needed, and I'm just dumb. Is there a standard form equation of way of achieving the same result? Oh god. Nevermind. I'm stupid. Sorry! Your solution works perfectly! $\endgroup$ – lolikols Nov 28 '16 at 16:55
  • $\begingroup$ There isn't, really, for you can find many functions that yield the same kind of boundary conditions. $\endgroup$ – Sean Roberson Nov 28 '16 at 16:56
0
$\begingroup$

I feel like the simplest way is to do this: if X is 1, Y is 0. if X is 0, Y is 1. If we plot this on a graph and draw a line between the points, we have Y=-X+1, which would seem to satisfy the purposes of your function.

| cite | improve this answer | | | | |
$\endgroup$
0
$\begingroup$

Percentages can be represented as normal numbers and 0% to 100% basically means from 0 to 1. Since you want to achieve the exact opposite just do 1 - X where X is the numerical representation of the percentage. Ex. 75% = 75/100 = 0.75 (X) 1 - X = 1 - 0.75 = 0.25

Conclusion f(x) = 1 - x/100 where x∈[0;100]

| cite | improve this answer | | | | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.