floor(x/y)=y graph

267 Views Asked by At

I was experimenting with some equations on Desmos and stumbled upon the floor function. I tried using it in different equations, but nothing caught my attention until I tried y = floor(x/y) (Screenshot). This graph looks like a step function with an increasing step of 0.5, which is confusing to me. I asked MathGPT and tried to figure it out myself, but I still don't understand it. Can you please explain why this is happening?

3

There are 3 best solutions below

0
On BEST ANSWER

The graph is a little misleading. It only includes the "flat" parts, not the "diagonal" segments connecting them.

The complete graph is the union of the horizontal half-open segments

$$\left(\bigcup_{n\in\mathbb{N}}[n^2,n^2+n)\times\{n\}\right)\cup\left(\bigcup_{n\in\mathbb{N}}(n^2-n,n^2]\times\{-n\}\right)$$

The first union comprises segments above the x-axis, and the second comprises those below the x-axis. As you move to the right, each segment is one unit longer and one unit higher (lower, for segments below the x-axis) than the previous segment. There is a longer and longer gap between segments. Ignore the diagonal "connectors" in your graph and it is right.

1
On

floor(x/y) is the integer $n$ satisfying:

$$n \le \frac{x}{y} < n + 1$$

If $n = y$, then:

$$y \le \frac{x}{y} < y + 1$$

If $y > 0$, then:

$$y^2 \le x < y^2 + y$$ $$\frac{-1 + \sqrt{1+4x}}{2} < y \le \sqrt{x}$$

If $y < 0$, then:

$$y^2 \ge x > y^2 + y$$ $$y^2 + y < x \le y^2$$ $$-\sqrt{x} \le y < \frac{-1 - \sqrt{1+4x}}{2}$$

So, you get a graph that's similar to $y = \pm \sqrt{x}$ (with both positive and negative branches), except that $y$ takes on only nonzero integer values.

0
On

(see figures below)

In such 2D questions, it is often rewarding to "take a step back" by considering curves as "level sets" (here at height $z=0$) of a surface, here with equation

$$z= y-\lfloor \tfrac{x}{y} \rfloor\tag{1}$$

The level set (intersection with plane $z=0$) gives "your" curve. This surface is discontinuous with unbounded triangular "facets" (see Fig. 1) ; think to a spiraling staircase with 45° inclined steps (!), each step being more narrow than the previous one...

enter image description here

Fig. 1 : (Matlab generated) Representation of surface with equ. (1). The "triangular" facets of this surface aren't connected : they are separated by unit jumps, artificially "materialized" in black.

There is more to say (see Fig. 2) in the spirit of the answer by @Dan :

enter image description here

Fig. 2 : (Geogebra generated) Surface with equ. (2) ($x$,$y$ axis in red and green resp.)

Indeed, the facet-surface with eq. (1) is close to the "smooth" surface with equation :

$$z=y-\frac{x}{y} \iff z=\frac{y^2-x}{y}$$

Otherwise said : $$y^2-yz-x=0 \ \ \ (y \ne 0)\tag{2}$$

which is a quadric surface known as a "hyperbolic paraboloid" (sometimes said to have the shape of a horse saddle). Its name comes from the fact that its intersections with specific planes can give either parabolas (one of them is the smoothed version of "your" curve) or hyperbolas.