Approximate and accurate proof of time complexity of the Fibonacci series

Source: Internet
Author: User

The Fibonacci series can be derived from many applications. We know that the time complexity of the Fibonacci series is exponential. Now let's roughly prove it:

Fibonacci SeriesRecurrence:

F (n) = f (n-1) + f (n-2)

F (1) = F (2) = 1

It is roughly proved that decision_tree can be used. For more intuitive purposes, I reference another constant function f (x) = 0; X = 1, 2, 4, 5 ,............

SoFibonacci SeriesRecursive deformation is as follows:

F (n) = f (n-1) + f (n-2)+ F (N)

F (1) = F (2) = 1

Draw the decision_tree

// F (n) = f (n) /// F (n-1) f (n-2) /////// F (n-2) F (n-3) f (n-3f )//.... //... F (2) /// \\// F (1) F (2) 1 ///\/// 1 1 1 1

Because F (n) is always equal to 0, F (n) is equal to the sum of leaf nodes multiplied by theta (1). The longest link is the leftmost subtree, and the shortest link is the rightmost subtree.

So there are: 2 ^ (n/2) <F (n) <2 ^ N, that is, F (n) = theta (2 ^ N ).

Exact proof:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.