Why are Fibonacci numbers significant in computer

2019-03-07 14:25发布

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, many of us are familiar with them.

They also exist within Computer Science elsewhere too; in surprisingly efficient data structures and algorithms based upon the sequence.

There are two main examples that come to mind:

  • Fibonacci heaps which have better amortized running time than binomial heaps.
  • Fibonacci search which shares O(log N) running time with binary search on an ordered array.

Is there some special property of these numbers that gives them an advantage over other numerical sequences? Is it a spatial quality? What other possible applications could they have?

It seems strange to me as there are many natural number sequences that occur in other recursive problems, but I've never seen a Catalan heap.

9条回答
我想做一个坏孩纸
2楼-- · 2019-03-07 14:30

Greatest Common Divisor is another magic; see this for too many magics. But Fibonacci numbers are easy to calculate; also it has a specific name. For example, natural numbers 1,2,3,4,5 have too many logic; all primes are within them; sum of 1..n is computable, each one can produce with other ones, ... but no one take care about them :)

One important thing I forgot about it is Golden Ratio, which has very important impact in real life (for example you like wide monitors :)

查看更多
不美不萌又怎样
3楼-- · 2019-03-07 14:31

Just to add a trivia about this, Fibonacci numbers describe the breading of rabbits. You start with (1, 1), two rabbits, and then their population grows exponentially .

查看更多
仙女界的扛把子
4楼-- · 2019-03-07 14:32

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.

huffman.ooz.ie/?text=ABBCCCDDDDDEEEEEEEE

enter image description here

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

查看更多
做个烂人
5楼-- · 2019-03-07 14:35

If you have an algorithm that can be successfully explained in a simple and concise mannor with understandable examples in CS and nature, what better teaching tool could someone come up with?

查看更多
迷人小祖宗
6楼-- · 2019-03-07 14:36

Their computation as a power of [[0,1],[1,1]] matrix can be considered as the most primitive problem of Operational Research (sort of like Prisoner's Dilemma is the most primitive problem of Game Theory).

查看更多
冷血范
7楼-- · 2019-03-07 14:45

Fibonacci sequences are indeed found everywhere in nature/life. They're useful at modeling growth of animal populations, plant cell growth, snowflake shape, plant shape, cryptography, and of course computer science. I've heard it being referred to as the DNA pattern of nature.

Fibonacci heap's have already been mentioned; the number of children of each node in the heap is at most log(n). Also the subtree starting a node with m children is at least (m+2)th fibonacci number.

Torrent like protocols which use a system of nodes and supernodes use a fibonacci to decide when a new super node is needed and how many subnodes it will manage. They do node management based on the fibonacci spiral (golden ratio). See the photo below how nodes are split/merged (partitioned from one large square into smaller ones and vice versa). See photo: http://smartpei.typepad.com/.a/6a00d83451db7969e20115704556bd970b-pi

Some occurences in nature

http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/sneezewort.GIF

http://img.blogster.com/view/anacoana/post-uploads/finger.gif

http://jwilson.coe.uga.edu/EMAT6680/Simmons/6690Pictures/pinecone3yellow.gif

http://2.bp.blogspot.com/-X5II-IhjXuU/TVbHrpmRnLI/AAAAAAAAABU/nv73Y9Ylkkw/s320/amazing_fun_featured_2561778790105101600S600x600Q85_200907231856306879.jpg

查看更多
登录 后发表回答