Combinatorial mathematics and its application--recurrence relation and generating function

Source: Internet
Author: User

The result of the count or the information of a particular sequence is presented in a function relation, which we call a generative function, such as the name, we are essentially talking about a function parse, but this analytic formula holds a count sequence in the form of an infinite series.

For the time being, we don't seem to see any good use for the new definition of this "generative function", but as the problem progresses, it will appear, for example, the concept of generating functions when solving Catalan recursive relationships of numbers.

Example 1:

In some problems, we use the concept of generating function, through other operation theorem, transform a ∑ form of generating function into other form and then perform operation on function level, which can make us deal with the problem to stand in a new angle of view.

Example 2:

Example 3:

What is the generating function for a sequence of numbers?

Example 4: Determine the number of n combinations of apples, bananas, oranges, and pears, where the number of each n-combination Apple is even, the number of bananas is odd, the number of oranges is between 0 and 4, and at least one pear.

Example 5:

The number of apples, bananas, oranges and pears in the basket of possible h (N), where each fruit basket Apple number is even, the number of bananas is a multiple of 5, there are up to 4 orange trees, and the number of pears is 0 or 1.

Although the linear recurrence relation is given in this form, but the coefficients are not all constant, we introduce a general solution method to solve the linear constant coefficient recurrence relation.

The function of this theorem is to be able to obtain a sequence of O (n) time complexity that can be solved in O (logn).

EX2:

A string consisting of a, B, C, the length of the communication text is n, the communication text is not able to have two consecutive a appear, then how many kinds of situation?

Echoing the conclusion that we gave at the outset: to solve a recursive relationship for a faster calculation of an item in a sequence h[n], comparing 1 or 22 examples we found that, in terms of programming calculations, Ex1 in this way is good, because the final form of comparison is simple without the radical. The form of Ex2, if given to computer computing, looks ugly. For example, the Fibonacci sequence, the solution obtained by using this theorem also has a radical, at this time in order to simplify the calculation of an item in the sequence of time complexity, we have to seek other methods (such as Matrix Fast Power).

Combinatorial mathematics and its application--recurrence relation and generating function

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.