# Mathematics | Generating Functions – Set 2

Prerequisite – Generating Functions-Introduction and Prerequisites

In Set 1 we came to know basics about Generating Functions. Now we will discuss more details on Generating Functions and its applications.

**Exponential Generating Functions –**

Let e a sequence. Then its exponential generating function, denoted by is given by,

Example 1:- Let {1, 1, 1…….} be a sequence . The generating function of the sequence is

( Here =1 for all n )

Example 2:- Let be number of k permutation in an n- element set. Then the exponential generating function for the sequence is

Exponential Generating Function is used to determine number of n-permutation of a set containing repeatative elements. We will see examples later on.

**Using Generating Functions to Solve Recurrence Relations –**

Linear homogeneous recurrence relations can be solved using generating function .We will take an example here to illustrate .

Example :- Solve the linear homogeneous recurrence equation .

Given =1 and .

We use generating function to solve this problem. Let g(x) be the generating function of the sequence .

Hence g(x)=

So we get the following equations.

g(x)=

-5xg(x)=

=

Adding these 3 quantities we obtain

Now =0 for all n>1. So,

Or g(x)=

Now =(1-2x)(1-3x)

So, g(x)=

It is easy to see that

Now

And

So g(x)=

Since this is the generating function for the sequence We observe that

Thus we can solve recurrence equations using generating functions.

**Proving Identities via Generating Functions –**

Various identities also can also be proved using generating functions.Here we illustrate one of them.

**Example:** Prove that :

Here we use the generating function of the sequence i.e .

Now,

For LHS the term containing is .For RHS the term containing is . So (proved)

Links of Various examples are given below regarding generating functions.

## Recommended Posts:

- Mathematics | Unimodal functions and Bimodal functions
- Discrete Maths | Generating Functions-Introduction and Prerequisites
- Mathematics | Representation of Boolean Functions
- Mathematics | Total number of possible functions
- Mathematics | Classes (Injective, surjective, Bijective) of Functions
- Inverse functions and composition of functions
- Dynamically generating a QR code using PHP
- Generating subarrays using recursion
- Theory of Computation | Generating regular expression from finite automata
- Mathematics | Generalized PnC Set 2
- Mathematics | Probability
- Mathematics | Generalized PnC Set 1
- Mathematics | Predicates and Quantifiers | Set 2
- Mathematics | Law of total probability
- Mathematics | Rules of Inference

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.