Mathematics | Generating Functions - Set 2 Last Updated : 29 May, 2021 Comments Improve Suggest changes Like Article Like Report 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 h_0, h_1, h_2, ........., h_n, ...... e a sequence. Then its exponential generating function, denoted by g^e(x) is given by, g^e(x) =\sum_{n=0}^{+\infty} \frac{x^n}{n!} h_n Example 1:- Let {1, 1, 1.......} be a sequence . The generating function of the sequence is g^e(x) = \sum_{n=0}^{+\infty} \frac{x^n}{n!} ( Here h_n =1 for all n ) Example 2:- Let perm{n}{k} be number of k permutation in an n- element set. Then the exponential generating function for the sequence ^nP_0, ^nP_1, ......., ^nP_n is g^e(x) =\sum_{k=0}^{n} \frac{x^n}{n!} ^nP_k = \sum_{k=0}^{n} \frac{x^k}{k!} \frac{n!}{(n-k)!} = \sum_{k=0}^{n} \frac{n!}{k!(n-k)!} x_k = \sum_{k=0}^{n} \^nC_k x_k =(1+x)^n Exponential Generating Function is used to determine number of n-permutation of a set containing repetitive 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 h_n=5h_{n-1}+6h_{n-2} . Given h_0 =1 and h_1=-2 . We use generating function to solve this problem. Let g(x) be the generating function of the sequence h_0, h_1, h_2, ......, h_n, .... . Hence g(x)=h_0+h_1 x + h_2 x^2 +........+ h_n x^n+.... So we get the following equations. g(x)=h_0+h_1 x + h_2 x^2 +........+ h_n x^n+.... -5xg(x)= -h_0x+h_1 x^2 + h_2 x^3 +........+ h_n x^n+1+.... 6x^2g(x) =h_0 x^2+h_1 x^3 + h_2 x^4 +........+ h_n x^n+2+.... Adding these 3 quantities we obtain (1+5-6x^2)g(x)=h_0 + (h_1-5h_0)x +(h_2-5h_1+6h_0)+....... +(h_n-5h_{n-1}+6h_{n-2})x^n+..... Now h_n-5h_{n-1}+6h_{n-2} =0 for all n>1. So, (1+5x-6x^2)g(x)=h_0 + (h_1-5h_0)x = (1-7x) Or g(x)=\frac{(1-7x)}{(1+5-6x^2)} Now (1+5x-6x^2) =(1-2x)(1-3x) So, g(x)=\frac{(1-7x)}{(1-2x)(1-3x)} It is easy to see that \frac{(1-7x)}{(1-2x)(1-3x)}=\frac{5}{(1-2x)}-\frac{4}{(1-3x)} Now \frac{1}{(1-2x)}=1 + 2x+2^2 x^2 +2^3 x^3+.... +2^n x^n+...... And \frac{1}{(1-3x)}=1 + 3x+3^2 x^2 +3^3 x^3+.... +3^n x^n+...... So g(x)=5(1 + 2x+2^2 x^2 +2^3 x^3+.... +2^n x^n+......)-4(1 + 3x+3^2 x^2 +3^3 x^3+.... +3^n x^n+......) Since this is the generating function for the sequence h_0, h_1, ......h_n We observe that h_n=5*2^n-4*3^n 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 : ^nC_r=^{(n-1)}C_r+^{(n-1)}C_{r-1} Here we use the generating function of the sequence ^nC_0, ^nC_1, ......^nC_r.... i.e (1+x)^n . Now, (1+x)^n=(1+x)^{n-1}(1+x)=(1+x)^{n-1}+x(1+x)^{n-1} For LHS the term containingx^n is ^nC_r .For RHS the term containingx^n is ^{(n-1)}C_r+^{(n-1)}C_{r-1} . So ^nC_r=^{(n-1)}C_r+^{(n-1)}C_{r-1} (proved) Links of Various examples are given below regarding generating functions. GATE CS 2018 | Question 18GATE-CS-2017 (Set 2) | Question 52 Comment More infoAdvertise with us Next Article Mathematics | Generating Functions - Set 2 T tufan_gupta2000 Follow Improve Article Tags : Engineering Mathematics GATE CS Mathematics DSA Similar Reads Set Operations A set is simply a collection of distinct objects. These objects can be numbers, letters, or even peopleâanything! We denote a set using curly brackets.For example: A = {1, 2, 3}Set Operations can be defined as the operations performed on two or more sets to obtain a single set containing a combinati 10 min read Inclusion-Exclusion and its various Applications In the field of Combinatorics, it is a counting method used to compute the cardinality of the union set. According to basic Inclusion-Exclusion principle: For 2 finite sets A_1 and A_2 , which are subsets of Universal set, then (A_1-A_2), (A_2-A_1) and (A_1\bigcap A_2) are disjoint sets. Hence it ca 7 min read Properties of Power Set The power set of a set A, denoted as P(A), is the collection of all subsets of A, including:The empty set {}All single-element subsets {a}All possible combinations of elements from A, up to the entire set A itself.For example, if A={1,2}, the power set P(A) is {{},{1},{2},{1,2}}.Properties of Power 3 min read Partial Orders and Lattices Partial orders and lattices are important concepts in discrete mathematics and are widely used in computer science, especially in data structures, database theory, and the theory of computation. A partial order is a binary relation that describes a set of elements that are, in a sense, ordered, but 5 min read Group in Maths: Group Theory Group theory is one of the most important branches of abstract algebra which is concerned with the concept of the group. A group consists of a set equipped with a binary operation that satisfies four key properties: specifically, it includes property of closure, associativity, the existence of an id 13 min read Relations in Mathematics Relation in Mathematics is defined as the relationship between two sets. If we are given two sets set A and set B and set A has a relation with set B then each value of set A is related to a value of set B through some unique relation. Here, set A is called the domain of the relation, and set B is c 9 min read Discrete Mathematics | Representing Relations Prerequisite - Introduction and types of Relations Relations are represented using ordered pairs, matrix and digraphs: Ordered Pairs - In this set of ordered pairs of x and y are used to represent relation. In this corresponding values of x and y are represented using parenthesis. Example: {(1, 1), 2 min read Representation of Relation in Graphs and Matrices Understanding how to represent relations in graphs and matrices is fundamental in engineering mathematics. These representations are not only crucial for theoretical understanding but also have significant practical applications in various fields of engineering, computer science, and data analysis. 8 min read Closure of Relations Closure of Relations: In mathematics, especially in the context of set theory and algebra, the closure of relations is a crucial concept. It involves extending a given relation to include additional elements based on specific properties, such as reflexivity, symmetry, and transitivity. Understanding 6 min read Number of possible Equivalence Relations on a finite set An equivalence relation is defined as a relation that is Reflexive, Symmetric, and Transitive. Before we explore how to calculate the number of possible equivalence relations on a set â£A⣠= n, letâs first look at an example of an equivalence relation and identify its equivalence classes.Example of a 4 min read Like