Properties of the differences of floor functions

216 Views Asked by At

I was thinking about:

$$\left\lfloor\frac{a}{b}\right\rfloor - \left\lfloor\frac{c}{d}\right\rfloor = \frac{a}{b} - \left\{\frac{a}{b}\right\} - \frac{c}{d} + \left\{\frac{c}{d}\right\}$$

It occurred to me that:

$$-1 <\left\{\frac{c}{d}\right\} - \left\{\frac{a}{b}\right\} < 1$$

So that:

$$\left\{\frac{c}{d}\right\} -\left\{\frac{a}{b}\right\} = \left\{\frac{c}{d} - \frac{a}{b}\right\}$$

But if that's the case, then:

$$\left\lfloor\frac{a}{b}\right\rfloor - \left\lfloor\frac{c}{d}\right\rfloor = \left(\frac{a}{b}-\frac{c}{d}\right) - \left\{\frac{a}{b} - \frac{c}{d}\right\} = \left\lfloor\frac{a}{b} - \frac{c}{d}\right\rfloor$$

If my reasoning was valid, I expected to find this property in the wikipedia article on ceiling functions.

I found this:

$$\left\lfloor{x}\right\rfloor + \left\lfloor{y}\right\rfloor \le \left\lfloor{x+y}\right\rfloor$$

Is there a mistake in the reasoning? If my reasoning is valid, I would have expected the wikipedia article to include:

$$\left\lfloor{x}\right\rfloor - \left\lfloor{y}\right\rfloor = \left\lfloor{x-y}\right\rfloor$$

Apologies if this is a duplicate question. I went through all the similar questions and could not find it. I did a search on floor functions on this site but it returned too many questions to go through all of them.

1

There are 1 best solutions below

1
On BEST ANSWER

Your equality relating fractional parts isn't true. For instance, $\{ 1 - 0.5\} = 0.5$ but $\{1\} - \{0.5\} = -0.5$.