Learn about the period of a mathematical function in this article and accompanying interactive application.
A lot of mathematical functions are periodic. That is, if you start in some place and move forward, eventually the sequence of values repeats itself. The time it takes for that repetition to occur is called the period.
Written in mathematical terms, we can say that a function (f(x)) is periodic with period (r) if
For example, consider (f(x) = 3^x bmod 10), where (bmod) is the modulo operator. The modulo operator gives you the remainder when you divide the two numbers, or equivalently, the last digit of the number rewritten in that base (here, ten):
We can see the cycle (1rightarrow 3rightarrow 9rightarrow 7rightarrow 1), so the period (r = 4): (f(0) = f(4) = f(8) = f(12) = 1). This period does not change depending on where you start; we can see that the period is still four if we look at (f(1) = f(5) = f(9) = 3).
To be clear about the modulo arithmetic as well as the cycle, let us look at a second example, (f(x) = 5^x mod 7):
We can see a period of (r = 6): (1rightarrow 5rightarrow 4rightarrow 6rightarrow 2rightarrow 3 rightarrow 1). Thus, (f(4) = f(10) = f(16) = f(22) = 2).
As with many problems we are discussing, these examples are not hard when the problem size is small, but as the problem size grows, the difficulty of determining that period (r) increases quickly.