Maths

Fibonacci coding

From Wikipedia, the free encyclopedia

In mathematics, Fibonacci coding is a universal code which encodes positive integers into binary code words. All tokens end with "11" and have no "11" before the end.

The formula used to generate Fibonacci codes is:

  1. N = \sum_{i=0}^k d(i) F(i)
  2. d(i) = 1 \Rightarrow d(i+1) = 0\,\!

where F(i) is the ith Fibonacci number. No two adjacent coefficients d(i) can be 1.

The code begins as follows:

Syndicate content