Conjecture: $\lfloor\frac{n}4\rfloor+\lfloor\frac{n+1}4\rfloor-\lfloor\frac{n+2}4\rfloor-\lfloor\frac{n+3}4\rfloor=\cos(\frac{n\pi}2)-1$

123 Views Asked by At

I was playing around with numbers when I noticed that this peculiar expression seemed to be true:

$$\left\lfloor\frac{n}4\right\rfloor+\left\lfloor\frac{n+1}4\right\rfloor-\left\lfloor\frac{n+2}4\right\rfloor-\left\lfloor\frac{n+3}4\right\rfloor=\cos\left(\frac{n\pi}{2}\right)-1,\quad n\in\mathbb N$$

I'm at a complete loss as to how floor functions and the cosine are related in a rather simple form. Could somebody give me a proof/intuitive understanding of the above?

3

There are 3 best solutions below

1
On BEST ANSWER

I find it useful to view your expression not within the realm of calculus, but rather in terms of constructing a digital signal. In particular, this repeating 3-valued signal is the goal:

enter image description here

i.e. $\cos(n\pi/2)$ for integer $n$. It is clear that we can achieve it as the sum of these two binary signals, each having half the frequency:

enter image description here

Note these two summands are, in form, hardly different from each other; the phase difference is worth noting, and that one is "down", the other "up".

The first summand is $\left\lfloor\frac{n}4\right\rfloor-\left\lfloor\frac{n+2}4\right\rfloor$ while the second is $1 + \left\lfloor\frac{n+1}4\right\rfloor-\left\lfloor\frac{n+3}4\right\rfloor$. We see that each binary oscillation is expressible as the difference of two (non-periodic) staircase signals, one lagging behind the other.

1
On

Notice that if $m\in\mathbb{N}$ and $a\in\mathbb{R}$, then

$$\left\lfloor m+a\right\rfloor=m+\left\lfloor a\right\rfloor.$$

Now write $n=4k+r$ for some $k,r\in\mathbb{N}$ with $0\leq r\leq3$. Then the left hand side is

$$\left\lfloor\frac{n}{4}\right\rfloor+\left\lfloor\frac{n+1}{4}\right\rfloor-\left\lfloor\frac{n+2}{4}\right\rfloor-\left\lfloor\frac{n+3}{4}\right\rfloor=\left\lfloor k+\frac{r}{4}\right\rfloor+\left\lfloor k+\frac{r+1}{4}\right\rfloor-\left\lfloor k+\frac{r+2}{4}\right\rfloor-\left\lfloor k+\frac{r+3}{4}\right\rfloor=\left\lfloor \frac{r}{4}\right\rfloor+\left\lfloor \frac{r+1}{4}\right\rfloor-\left\lfloor \frac{r+2}{4}\right\rfloor-\left\lfloor \frac{r+3}{4}\right\rfloor$$

and the right hand side is

$$\cos\left(\frac{n\pi}{2}\right)-1=\cos\left(2\pi k+\frac{r\pi}{2}\right)-1=\cos\left(\frac{r\pi}{2}\right)-1.$$

Thus you can see that only $r$ matters, so check the cases $r=0,1,2,3$ and you are done.

1
On

The function $f_0(x) = \lfloor\frac x4\rfloor - x$ is a periodic function of period $4$. Likewise each of the functions $f_1(x) = \lfloor\frac{x+1}4\rfloor - x,$ $f_2(x) = \lfloor\frac{x+2}4\rfloor - x,$ and $f_3(x) = \lfloor\frac{x+3}4\rfloor - x$ is a periodic function of period $4.$

If you take any linear combination of those functions, you'll get another periodic function of period $4$ (or possibly a shorter period).

The function $f(x) = \cos(\frac\pi2 x) - 1$ also is a periodic function of period $4.$

You have found a linear combination of $f_0,$ $f_1,$ $f_2,$ and $f_3$ that agrees with $f$ for integer values of $x.$