Period of a function. Help. How would we find the period of 
$$(-1)^{\operatorname{floor}(2x/\pi)}?$$
Please explain in a simple way.

I graphed it on Geogebra. The period turns out to be $\pi$. But I still don't quite unserstand the nature of the function.
 A: First of all, note that the function, depending on the exponent, is 1 or -1. So you are looking for a number T (the period) for which the function $-1^a=-1^{(a +T)}$. In particular for even values of the exponent you get 1, for odd values of the exponent you get -1. Moreover, $\mathrm{floor}(t)$ is continuous in ${R/Z}$. So when $2x/\pi=n$, $n$ belonging to $Z$? The answer is $x=n(\pi/2)$. So for odd values of $n$, like $\pi/2, 3\pi/2...$ you get a -1. For even values you get a 1. So the period of the function is $2((n+1)(\pi/2)- n(\pi/2))=\pi$. For any doubts, just ask.
And sorry for the bad format of the answer...it's my first one!
A: $(-1)^{\lfloor2x/\pi\rfloor}$
So, $2x/\pi$ will be floored to $0$, then 1 when it passes $\pi/2$, then $2$ when it passes $\pi$, then $3$ at $3\pi/2$, then... etc.
And when we take (-1) to this alternating sequence of odds and evens, we'll get -1's and 1's, respectively.
But the period at least is $\pi$.
A: Hint:
Note that, for $k$ integer, we have:
$$2k\pi<x<\frac{\pi}{2}+2k\pi \quad \Rightarrow \quad 4k< \frac{2x}{\pi}<1+4k $$
so the floor is an even number. And
$$\frac{\pi}{2}+2k\pi<x<\pi+2k\pi \quad \Rightarrow \quad 1+4k< \frac{2x}{\pi}<2+4k $$
so the floor becomes odd.
