[tst]Everyone heard about fibonacci numbers. But did you know that with their help you can compress the data?

in #science7 years ago

  

Introduction

    If you don't know or don't remember what are the fibonacci numbers i will  briefly summarize their definitions.    Fibonacci numbers create sequence called... the Fibonnaci sequence. In the fibonnaci sequence every number expect the first two is the sum of the two preceding numbers.  As you can see in the illustration with the spiral we start with two ones  Then we have 2 (1+1), 3 (2+1), 5 (2+3), 8 (3+5) and so on.

Fibonacci coding

    Fibonacci coding is not as popular as other codings methods such as huffman coding or arithmetic coding. According to the Zeckendorf's theorem every integer can be written uniquely as sum of  nonconsecutive fibonacci numbers.  By adding a 1 and reversing the resulting sequence we form a prefix code. Thanks to the properties of fibonacci numbers we can be sure that token "11" indicates the end of code word.  the In the prefix code, none of the code words are prefixes of another word, this makes the prefix code  unambiguously decodable. 

 Sample encoding looks like this. 

for n = 1 fibonacci code is 11 as we add 1 at the end
for n = 2 fibonacci code is 011
for n = 11 fibonacci code is 001011 because 11 = 8 + 3 

Field of application

     At first glance it may seem that the use of fibonacci coding does not make sense. However, they are applicable for compressing a set of small integers also decoding is very fast.  Fibonacci coding can be used in communication channels where high noise levels because they are resistant to insertions and deletions. More informations abour fibonacci codes robustness you can find here > http://www.sciencedirect.com/science/article/pii/0166218X9300116H

Dont forget fibonacci is everywhere!

Sort:  

@whd:

By adding a 1 and reversing the resulting sequence we form a prefix code.

In case of n = 11, I don't see this ... :(
11 = 1011 binary. So then you add a 1?
as: prefix it with a 1? suffix it with a 1? or actually add 1?
prefix: 11011
suffix: 10111
adding: 1100
If I reverse that, I don't get your result. What did I misunderstand.

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.029
BTC 63578.99
ETH 2611.82
USDT 1.00
SBD 2.85