Why are Fibonacci numbers significant in computer science?

前端 未结 9 1865
有刺的猬
有刺的猬 2021-01-29 19:43

Fibonacci numbers have become a popular introduction to recursion for Computer Science students and there\'s a strong argument that they persist within nature. For these reasons

9条回答
  •  臣服心动
    2021-01-29 20:02

    Symbols with frequencies that are successive fibonacci numbers create maximum depth huffman trees, which trees correspond to source symbols being encoded with maximum length binary codes. Non-fibonacci source symbol frequencies create more balanced trees, with shorter codes. The code length has direct implications in the description complexity of the finite state machine that is responsible for decoding a given huffman code.


    Conjecture: The 1st(fib) image will be compressed to 38bits, while the 2nd(uniform) with 50bits. It seems that the closer your source symbol frequencies are to fibonacci numbers the shorter the final binary sequence, the better the compression, maybe optimal in the huffman model.

    Further Reading:

    Buro, M. (1993). On the maximum length of Huffman codes. Information Processing Letters, 45(5), 219-223. doi:10.1016/0020-0190(93)90207-p

提交回复
热议问题