12

It's well known that the Fibonacci sequence $\pmod m$ (where $m \in \mathbb N$) is periodic. I have figured out a proof for this, but upon googling, I found proofs online that were far more complicated. This leads me to suspect that my proof may be fallacious - that's why I am posting here.

Proof:

Let us list out the Fibonacci sequence modulo m, where m is some integer. It will look something like this at first (for $10$ at least):

$$ 1,2, 3,5,8, 3,1, 4, 5, 9, 4, 3, 7 {\dots}$$

Obviously, any number in the sequence is the sum of the last two numbers modulo $m$. Therefore, if at any point in the series modulo m a pair of numbers repeat, the numbers following that pair must repeat as well. eg. if at some point later we see the pair $1, 1$, then $2, 3, 5, \dots$ must follow that pair.

Now there are $m^2$ possible pairs in the series $\text{mod} m$. By the pigeonhole principle, after $m^2 + 1$ terms, a pair must repeat. If a pair repeats once, it must repeat again the same number of terms later. Therefore, the Fibonacci sequence $\pmod m$ is periodic $\forall m$ .

Is my proof correct?

GoodDeeds
  • 11,185
  • 3
  • 22
  • 42
  • 3
    Your proof is correct. It happens to be the first proof I ever saw for this fact. IMHO it is the simplest, too! – Jyrki Lahtonen Jan 08 '14 at 09:11
  • I have this same question now and since there's already a question mine woukd get closed as a duplicate. So, I'll ask my clarification here. – Saikat Feb 28 '16 at 02:31
  • If any one pair repeats, the enitre sequence after that repeats and the Pigeonhole Principle says that at least one pair must repeat. But, what we have to prove os that the FIRST pair repeats specifically. How do we do that? – Saikat Feb 28 '16 at 02:32

1 Answers1

8

No, you haven't proven yet that the Fibonacci sequence is periodic ($\exists t, \forall n, F(n+t) = F(n)$), you have proven that it is eventually periodic ($\exists t, \exists n, \forall m, m \ge n \implies F(m+t) = F(m)$)

If you have a finite set $S$ (here, the set of pairs modulo $m$) and a function $f :S \to S$, any sequence obtained by iterating $f$ on some element of $S$ is eventually periodic, by the pigeonhole principle. If you want every such sequence to be periodic, you need $f$ to be a bijection :

If $f$ is a bijection and $F(n+1+t) = F(n+1)$ for some $n$, then by applying $f^{-1}$ we get $F(n+t) = F(n)$, and we repeat until we obtain $F(t) = F(0)$.

If $f$ is not bijective, it is not surjective, so if you start your sequence on some element not in the image of $f$, it will never be periodic because that element can't appear again in the sequence.

Here, $f(a,b) = (b,a+b)$, which is a bijection because its inverse is given by $f^{-1}(a,b) = (b-a,a)$

mercio
  • 50,180
  • 3
    Just to clarify, if it is eventually periodic it will get into a repeating pattern eventually. If it is (strictly) periodic, it starts in the repeating pattern. – Arthur Jan 08 '14 at 09:50
  • eventually periodic is also known as preperiodic. See http://en.wikipedia.org/wiki/Periodic_point. – lhf Jan 08 '14 at 09:51
  • Can you explain what the function $f$ does please? What does it mean to iterate $f$? – Saikat Feb 28 '16 at 02:43
  • @user230452 iterating $f$ on an element $x$ means computing the sequence $x,f(x),f(f(x)),f(f(f(x)))$ etc – mercio Feb 28 '16 at 11:03
  • Your proof is beautiful. It took me two days to understand it :) – Saikat Feb 28 '16 at 13:08
  • I understood that if $f$ is a bijection, and $F$ is eventually periodic... The sequence is completely periodic. But, how do we kow that $f$ is a bijection? It's easy to prove $f$ is injective, but can you add some exposition on why $f$ is surjective. Is it by contradiction? – Saikat Feb 28 '16 at 13:13
  • If $b-a$ does not exist in the sequence, it would imply that it is greater than $m$. But, both $a,b$ are smaller than $m$. So $b-a$ has to be greater than $m$. Is this the argument for why $f$ is surjective? – Saikat Feb 28 '16 at 13:34
  • @user230452 Try making an injective function $f : {1;2;3} \to {1;2;3}$ that is not surjective. It turns out that if $f : S \to S$ and $S$ is finite, then $f$ is injective if and only if it is surjective (if and only if it is bijective) .As for your second comment, all the numbers and all the operations here are modulo $m$, saying $a$ is smaller or larger than $m$ is completely meaningless. – mercio Feb 28 '16 at 18:04