Equation going infinitely towards y = 10

69 Views Asked by At

I'm programming a site on which I sell services, and the more the customers spends, the more discount they will have. Please have a look at the diagram below. Spending 700 USD will result in 5% discount. I don't want the discount to ever go above 10%.

How do I write a formula for this graph, crossing the points in the image below?

Thanks!

Points the graph must cross

  • EDIT: The points don't need to be crossed perfectly - only approximately!
  • EDIT 2: I'll give a few example values: y=5 & x=700, y=7 & x=2000, y=9 & x=5000, y=9.5 & x=10 000
2

There are 2 best solutions below

1
On BEST ANSWER

You want something simple, like $\left(10 - \dfrac{A}{x+B}\right)\%$ for suitable constants $A$, $B$. If you want to go through the points $(700,5\%)$ and $(10000,9.5\%)$, choose $A = \dfrac{15500}{3}, B = \dfrac{1000}{3}$.

0
On

I would choose sth like $$ f(x)= 10-10a^{-x} $$ for $a>0$. This satisfies $f(0)=0$ and $\lim_{x \rightarrow \infty}f(x)=10$ as well as $f(x)<10$ for all $x>0$. Now choose $a$ such that the graph fits your points best. (for this I need to know the actual values of the points)