# 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.

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: **DSA Self Paced**. Become industry ready at a student-friendly price.

## Recommended Posts:

- Mathematics | Unimodal functions and Bimodal functions
- Discrete Maths | Generating Functions-Introduction and Prerequisites
- 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
- Generating Random Numbers in Golang
- Generating regular expression from Finite Automata
- Total Recursive Functions and Partial Recursive Functions in Automata
- Mathematics | Generalized PnC Set 1
- Mathematics | Generalized PnC Set 2
- Mathematics | Probability
- Mathematics | Law of total probability
- Mathematics | PnC and Binomial Coefficients
- Mathematics | Combinatorics Basics
- Mathematics | Predicates and Quantifiers | Set 2
- Mathematics | Rules of Inference
- Mathematics | Indefinite Integrals
- Mathematics | Conditional Probability

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.