I found an expression for calculating the floor function:
floor(x)=x+tan-1(cot(px))/p - 1/2
First, can anyone explain to me why it does what it does...
and second, Is there anyway of simplifying it, and/or making it
useful in other expressions, (the atan part is what makes it
uncomfortable)
Thnx,
Yatir
Well done. I've never seen anything like this before, yet it is
beyond a doubt true! You can prove it in a rather unrigorous way
using differentiation at intervals where x is not an integer, and
recognize that at x=integer, tan(px)=0,
and tan-1(1/0)=p/2 (I say
that hesitantly, but we all know what I mean by 1/0). Plugging this
into your equation, we see that it shows that at integers, the
function is equal to that integer, and it is equal to that integer
until the next integer. This gives you an idea of why the relation
is true, but I'm still trying to come up with a rigorous proof (I
think I've got one, but I'm just working out the tweaks). Anyone
know if this relation has been discovered before?
Brad
It's neat, but it shouldn't come as too
much of a surprise. As Yatir pointed out, the atan part should make
you uncomfortable. The reason this works is that atan(x) picks out
the principal branch of the inverse to tan, i.e. the value which
lies between -p/2 and p/2. So, if you take tan-1(tan(x)) you
get a sort of "sawtooth" function. Obviously, if tan-1
could pick out the "correct" branch of the inverse to tan then you
would get tan-1(tan(x))=x, but it can only pick out the
principal branch which effectively means you are saying something
like "suppose x was an angle, what is the principal value of that x
angle?" which is clearly very similar to saying "what is the
fractional part of x?" - and once you have the fractional part you
just need to subtract it from the original number to get the
integer part, which is the floor. You can do a similar thing with
log, because x-(1/2p)Log(e2ipx)=[x]=Floor(x) if Log takes the branch
which gives angles being between 0 and 2p.
The reason you can do it with a cot(x) is because there is a
relation something like cot(p/2-x)=tan(x) or something like that. You can
rewrite it without using cot(x) by saying
Floor(x)=x-1/2-(1/p)tan-1(tan(px+p/2)). If you choose
the branch of tan-1(x) which gives values between 0 and
2p then you get
Floor(x)=x-(1/p)tan-1(tan(
px)), which is even simpler.
Hope that clears it up, unfortunately it's not very useful but it
is quite clever. It's a bit like saying that for real numbers,
|x|=sqrt(x2).
As an afterthought, if f(x+a)=f(x) for all x and for 0<x<a f(x) is increasing, then Floor(x)=x-f-1(f(ax))/a for the principal branch of f-1 returning values between 0 and a. So, there is nothing special about tan or Log or cot going on here...
I think I have a fully rigorous proof of your equality. For the
sake of rigorousness, however, it is very long. I'll try to type it
all out, but I may end up fizzling out halfway, and posting the
rest later. First, a trivial addition to your original formula:
Technically as we do have a 1/0 when we are dealing with your
result, we should say
floor(x)=x+tan-1(cot(px))/p - 1/2 if x not an
integer, and equal to x if x is an integer
I've typed up the proof in word, as it is very heavy in symbols,
and as it is rather long. Indeed, if you have a problem
understanding it, the problem is most likely symbology. For all
practical purposes, the "proof" I've typed above works fine. But
nonetheless:
proof_floor_function_result.doc (26 k) |
Oops, hadn't yet seen your post Dan.
Brad and Dan, Thank you both for your proofs.
Both are very nice and suprisingly i understood them.
The proof i had in mind is something like yours, dan, but brad
yours is great as well.
I can't take credit for it, because it is not mine, i god it from
mathworld.wolfram.com, While doing some research on the floor
function.
Now, the real question, is there any use to this
expression???
Thnx,
Yatir