Looking for the function of $x$ for a line that approaches, but never reaches 100

567 Views Asked by At

I'm looking for the function of $x$ for a line that intersects at $(0,0)$ and $(100,80)$, and as $x$ goes off into infinity, the line approaches, but never touches $100$.

See image attached.

line

I am writing a bit of gameplay logic where the player's skill level ($x$ axis) increases with the success of a skill test ($y$ axis), but it is never a 100% success rate.

Thanks.

3

There are 3 best solutions below

2
On BEST ANSWER

It seems that you look at function such as $$y(x)=100(1-e^{-bx})$$ which goes through the origin and will never touch $100$. So, your requirements give $$80=100(1-e^{-100b})$$ This gives $$b=\frac{\log (5)}{100}$$

0
On

To expand on @jgon's comment, the function

$$100(1-\exp((0.01\ln 0.2)x))$$

would work.

0
On

It seems like a logistic equation would model this perfectly.

$$\frac{dP}{dx}=k(P-P_L)(P-P_U)$$ where $P_L$ and $P_U$ are our lower and upper bounds (by letting $P_L=-P_U$ we are given a slope of 1 at x=0, this makes things nicer)

solving this DE and using your intitial conditions, we get:

$$P(x)=\frac{100(e^{0.022x}-1)}{e^{0.022x}+1}$$

Obviously, we only care about $x\geq0$