2
$\begingroup$

I'm looking for a formula that, given a linear $x$ input, would yield values of $y$ in a "stairs" shape so to speak, in such a way that as the value of $x$ grows higher, the difference between each step is bigger, and it also takes longer to reach the next the step, as this graph (hopefully) illustrates:

enter image description here

As you have probably guessed by now I'm not a mathematician, but I'm fairly sure this has an easy solution. I've been playing around with modulus and powers but I couldn't quite get the graph above so far.

Edit: Graph updated.

  • 0
    For a linear stepcase, we would assume that without a "floor" function, it could be simplified to the form of $y=kx$. Then using $f(x)$ and $f^{-1}(x)$ simultaneously could achieve this effect.2012-08-12

3 Answers 3

5

My first intuition is $y=2^{\lfloor\log_2\,x\rfloor}$. It's very pretty though:

plot of 2^{\lfloor\log_2\,x\rfloor}

  • 0
    Thank $y$ou very much, this gets very near what I was after, and with a couple of variables added to the mi$x$ it works wonderfully.2012-08-12
2

Writing $[x]$ for the integer part of $x$, how about $y=[\sqrt x]^2$?

Plot

The plot

  • 0
    Great answer, I can't accept two answers but this one also came close, you have my upvote.2012-08-12
1

It might be too steep for what you want though.

$\large y = \left \lfloor \frac{-1 + \sqrt{8x+1}}{2} \right \rfloor$

Plot

A Plot of the function

  • 0
    A bit too step indeed but great approach nonetheless, I will remember this formula in case I need it in the future, thanks!2012-08-12