# Problem with Floor Function

I have $f_k(x)=kx-\lfloor kx \rfloor$, where $k\in \mathbb N$ and $x\in\{0,1\}$ and $x\in \mathbb Q$. When I plug in some numbers it seems obvious that $$f_k(x)+f_k(1-x)=1$$ for example $k=28, x=\frac{21}{38}$ gives $$28\frac{21}{38} - \lfloor 28\frac{21}{38} \rfloor + 28\frac{17}{38} - \lfloor 28\frac{17}{38} \rfloor = \frac{294}{19} - 15 + \frac{238}{19} - 12 = \frac{532}{19} -27=1$$ but I have trouble to prove this in general. I get $$(x+(1-x))k-\lfloor kx\rfloor - \lfloor k(1-x)\rfloor=k -\lfloor kx\rfloor- \lfloor k(1-x)\rfloor$$ How to continue?

-
Oh sorry there's an error $\lfloor kx \rfloor \neq (k-1)$...But the problem remains... – draks ... Apr 18 '14 at 20:33
You should get $\lceil kx\rceil - \lfloor kx\rfloor$, by the way. – Daniel Fischer Apr 18 '14 at 20:33
Separate the problem into two cases, $kx \in Z$ and $kx \not \in \mathbb Z$ . For the second case, represent $kx$ as $a + b$ for $a \in \mathbb Z$ and $0 < b < 1$. – DanielV Apr 18 '14 at 20:39
Are you trying to prove the general difference between the "steps" or "jumps" of a greatest integer function? – TheGreatDuck Dec 5 '15 at 5:19
Because if so, the jumps are just [kx]. – TheGreatDuck Dec 5 '15 at 5:19

Continuing your calculation: \begin{align}k-\lfloor kx\rfloor-\lfloor k-kx\rfloor=k-\lfloor kx\rfloor-k-\lfloor-kx\rfloor=-\lfloor-kx\rfloor-\lfloor kx\rfloor=\lceil kx\rceil-\lfloor kx\rfloor\end{align} So it's $0$ if $kx\in\mathbb Z$, else it's $1$.
$f_k(x) = \{kx\}$. Then let $f_k(x) = a$. Note that $f_k(1-x) = \{k(1-x)\} = \{-kx\} = \{1-kx\}$ since $\{k\} = 0$ so the result follows.